Bug 108943 - Build fails on ppc64le with meson
Summary: Build fails on ppc64le with meson
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Other (show other bugs)
Version: 18.3
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact: mesa-dev
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-12-04 14:06 UTC by Igor Gnatenko
Modified: 2019-02-14 22:17 UTC (History)
0 users

See Also:
i915 platform:
i915 features:


Attachments
build.log (4.55 MB, text/plain)
2018-12-04 14:06 UTC, Igor Gnatenko
Details
0001-build-correctly-check-for-ppc64le.patch (1.15 KB, patch)
2018-12-04 18:19 UTC, Igor Gnatenko
Details | Splinter Review

Description Igor Gnatenko 2018-12-04 14:06:36 UTC
Created attachment 142717 [details]
build.log

FAILED: src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o 
c++ -Isrc/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta -Isrc/gallium/state_trackers/clover -I../src/gallium/state_trackers/clover -Iinclude -I../include -Isrc -I../src -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.3.0-rc5"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DGLX_USE_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=1 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LLVM=0x0700 -DMESA_LLVM_VERSION_PATCH=0 -DUSE_LIBGLVND=1 -DHAVE_VALGRIND -DMESA_SELINUX -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=return-type -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -fvisibility=hidden  -MD -MQ 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -MF 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o.d' -o 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -c ../src/gallium/state_trackers/clover/tgsi/compiler.cpp
../src/gallium/state_trackers/clover/tgsi/compiler.cpp: In function 'void {anonymous}::read_header(const string&, clover::module&, std::__cxx11::string&)':
../src/gallium/state_trackers/clover/tgsi/compiler.cpp:44:15: error: expected unqualified-id before '__attribute__'
          std::vector<module::argument> args;
               ^~~~~~

and more errors. attaching full build.log.
Comment 1 Eric Engestrom 2018-12-04 15:58:59 UTC
This sounds like one of your system headers is #define'ing `vector` as `__attribute__((something))`, but if that's the case then good luck compiling *any* C++ code :/

Can you confirm this by adding this next to that sts::vector line and seeing if it fires when you compile?

#ifdef vector
#error "`vector` is #define'd"
#endif

Looking at the rest of the build log, it looks like `bool` is also #define'd to something that can't be used as a type...

What OS are you running this on?
Comment 2 Eric Engestrom 2018-12-04 16:00:48 UTC
(In reply to Eric Engestrom from comment #1)
> What OS are you running this on?

and what toolchain?
Comment 3 Igor Gnatenko 2018-12-04 16:03:51 UTC
> What OS are you running this on?

Fedora Rawhide. I'm mesa maintainer in Fedora and trying to switch from autotools to meson in our RPM package.

> and what toolchain?

GCC, the standard one in Fedora ;)
Comment 4 Igor Gnatenko 2018-12-04 16:53:39 UTC
(In reply to Eric Engestrom from comment #1)
> This sounds like one of your system headers is #define'ing `vector` as
> `__attribute__((something))`, but if that's the case then good luck
> compiling *any* C++ code :/

Interestingly it works fine if I use autotools as a buildsystem.

> Can you confirm this by adding this next to that sts::vector line and seeing
> if it fires when you compile?
> 
> #ifdef vector
> #error "`vector` is #define'd"
> #endif

[1694/1840] c++ -Isrc/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta -Isrc/gallium/state_trackers/clover -I../src/gallium/state_trackers/clover -Iinclude -I../include -Isrc -I../src -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.3.0-rc5"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DGLX_USE_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=1 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LLVM=0x0700 -DMESA_LLVM_VERSION_PATCH=0 -DUSE_LIBGLVND=1 -DHAVE_VALGRIND -DMESA_SELINUX -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=return-type -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -fvisibility=hidden  -MD -MQ 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -MF 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o.d' -o 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -c ../src/gallium/state_trackers/clover/tgsi/compiler.cpp
FAILED: src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o 
c++ -Isrc/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta -Isrc/gallium/state_trackers/clover -I../src/gallium/state_trackers/clover -Iinclude -I../include -Isrc -I../src -I../src/gallium/include -Isrc/gallium/auxiliary -I../src/gallium/auxiliary -fdiagnostics-color=always -pipe -D_FILE_OFFSET_BITS=64 -std=c++11 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS '-DVERSION="18.3.0-rc5"' -DPACKAGE_VERSION=VERSION '-DPACKAGE_BUGREPORT="https://bugs.freedesktop.org/enter_bug.cgi?product=Mesa"' -DGLX_USE_TLS -DHAVE_ST_VDPAU -DENABLE_ST_OMX_BELLAGIO=1 -DENABLE_ST_OMX_TIZONIA=0 -DHAVE_X11_PLATFORM -DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_DRM -DHAVE_DRM_PLATFORM -DHAVE_SURFACELESS_PLATFORM -DENABLE_SHADER_CACHE -DHAVE___BUILTIN_BSWAP32 -DHAVE___BUILTIN_BSWAP64 -DHAVE___BUILTIN_CLZ -DHAVE___BUILTIN_CLZLL -DHAVE___BUILTIN_CTZ -DHAVE___BUILTIN_EXPECT -DHAVE___BUILTIN_FFS -DHAVE___BUILTIN_FFSLL -DHAVE___BUILTIN_POPCOUNT -DHAVE___BUILTIN_POPCOUNTLL -DHAVE___BUILTIN_UNREACHABLE -DHAVE_FUNC_ATTRIBUTE_CONST -DHAVE_FUNC_ATTRIBUTE_FLATTEN -DHAVE_FUNC_ATTRIBUTE_MALLOC -DHAVE_FUNC_ATTRIBUTE_PURE -DHAVE_FUNC_ATTRIBUTE_UNUSED -DHAVE_FUNC_ATTRIBUTE_WARN_UNUSED_RESULT -DHAVE_FUNC_ATTRIBUTE_WEAK -DHAVE_FUNC_ATTRIBUTE_FORMAT -DHAVE_FUNC_ATTRIBUTE_PACKED -DHAVE_FUNC_ATTRIBUTE_RETURNS_NONNULL -DHAVE_FUNC_ATTRIBUTE_VISIBILITY -DHAVE_FUNC_ATTRIBUTE_ALIAS -DHAVE_FUNC_ATTRIBUTE_NORETURN -D_GNU_SOURCE -DUSE_GCC_ATOMIC_BUILTINS -DMAJOR_IN_SYSMACROS -DHAVE_SYS_SYSCTL_H -DHAVE_LINUX_FUTEX_H -DHAVE_ENDIAN_H -DHAVE_DLFCN_H -DHAVE_STRTOF -DHAVE_MKOSTEMP -DHAVE_POSIX_MEMALIGN -DHAVE_TIMESPEC_GET -DHAVE_MEMFD_CREATE -DHAVE_STRTOD_L -DHAVE_DLADDR -DHAVE_DL_ITERATE_PHDR -DHAVE_ZLIB -DHAVE_PTHREAD -DHAVE_PTHREAD_SETAFFINITY -DHAVE_LIBDRM -DHAVE_LLVM=0x0700 -DMESA_LLVM_VERSION_PATCH=0 -DUSE_LIBGLVND=1 -DHAVE_VALGRIND -DMESA_SELINUX -DHAVE_WAYLAND_PLATFORM -DWL_HIDE_DEPRECATED -DHAVE_DRI3 -DHAVE_DRI3_MODIFIERS -Werror=return-type -fno-math-errno -fno-trapping-math -Wno-non-virtual-dtor -Wno-missing-field-initializers -Wno-format-truncation -O2 -g -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mcpu=power8 -mtune=power8 -fasynchronous-unwind-tables -fstack-clash-protection -fPIC -fvisibility=hidden  -MD -MQ 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -MF 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o.d' -o 'src/gallium/state_trackers/clover/src@gallium@state_trackers@clover@@cltgsi@sta/tgsi_compiler.cpp.o' -c ../src/gallium/state_trackers/clover/tgsi/compiler.cpp
../src/gallium/state_trackers/clover/tgsi/compiler.cpp:35:2: error: #error "`vector` is #define'd"
 #error "`vector` is #define'd"
  ^~~~~
Comment 5 Igor Gnatenko 2018-12-04 16:54:44 UTC
Might it be related to this meson part:

if get_option('power8') != 'false'
  if host_machine.cpu_family() == 'ppc64le'
    if cc.get_id() == 'gcc' and cc.version().version_compare('< 4.8')
      error('Altivec is not supported with gcc version < 4.8.')
    endif
    if cc.compiles('''
        #include <altivec.h>
        int main() {
          vector unsigned char r;
          vector unsigned int v = vec_splat_u32 (1);
          r = __builtin_vec_vgbbd ((vector unsigned char) v);
          return 0;
        }''',
        args : '-mpower8-vector',
        name : 'POWER8 intrinsics')
      pre_args += ['-D_ARCH_PWR8', '-mpower8-vector']
    elif get_option('power8') == 'true'
      error('POWER8 intrinsic support required but not found.')
    endif
  endif
endif

?
Comment 6 Eric Engestrom 2018-12-04 17:54:10 UTC
(In reply to Igor Gnatenko from comment #3)
> > What OS are you running this on?
> 
> Fedora Rawhide. I'm mesa maintainer in Fedora and trying to switch from
> autotools to meson in our RPM package.
> 
> > and what toolchain?
> 
> GCC, the standard one in Fedora ;)

Oh, good to see you're doing the move! Don't hesitate to cc me and Dylan on any meson issue you have.

(In reply to Igor Gnatenko from comment #4)
> Interestingly it works fine if I use autotools as a buildsystem.

Good comparison point, I forgot to ask that.

(In reply to Igor Gnatenko from comment #4)
> ../src/gallium/state_trackers/clover/tgsi/compiler.cpp:35:2: error: #error
> "`vector` is #define'd"
>  #error "`vector` is #define'd"
>   ^~~~~

So that really is the issue :/

(In reply to Igor Gnatenko from comment #5)
> Might it be related to this meson part:
> 
> if get_option('power8') != 'false'
>   ...
> endif
> 
> ?

Yes indeed, it sounds like a reasonable candidate for this issue.
You can try disabling it with `meson configure -D power8=false`.

I'll try to have a closer look tomorrow so see if `-mpower8-vector` is meant to work with C++ or not.
Comment 7 Dylan Baker 2018-12-04 18:16:22 UTC
I see some code in autotools we don't have an equivalent of in meson, does adding `-Dcpp_std=gnu++11` fix this issue?
Comment 8 Igor Gnatenko 2018-12-04 18:19:11 UTC
Created attachment 142723 [details] [review]
0001-build-correctly-check-for-ppc64le.patch

Some trivial fix for correctly detecting power8.
Comment 9 Igor Gnatenko 2018-12-04 18:25:32 UTC
(In reply to Dylan Baker from comment #7)
> I see some code in autotools we don't have an equivalent of in meson, does
> adding `-Dcpp_std=gnu++11` fix this issue?

It seems that autotools was building clover with gnu++11 while the rest was built with c++11 which is not the case with meson.

Trying it out.

FYI, patch from earlier comment is not related to fix this bug, but is correcting altvec detection.
Comment 10 Dylan Baker 2018-12-04 18:26:39 UTC
I have a similar patch in a series I'm about to send out (the debian guys ran into the same thing), but we actually need to do `host_machine.system().startswith('ppc64')` since we still support versions of meson that return `ppc64le` :/

There's another place where you need the same change.

you might be interested in:
 gitlab.freedesktop.org:dbaker/mesa.git fix-less-common-arches
Comment 11 Igor Gnatenko 2018-12-04 18:44:37 UTC
Yeah, the gnu++11 fixes problem.

And also submitted https://gitlab.freedesktop.org/dbaker/mesa/issues/21.
Comment 12 Dylan Baker 2019-02-14 22:17:25 UTC
I think this should be fixed now.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.