Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build error on power architecture #1648

Open
eschnett opened this issue Jan 24, 2024 · 4 comments
Open

Build error on power architecture #1648

eschnett opened this issue Jan 24, 2024 · 4 comments
Labels
Architecture Architecture specific Build Env

Comments

@eschnett
Copy link

I am cross-building zlib-ng for a powerpc64le-linux-gnu system. The build fails with the error message

[16:27:09] /opt/bin/powerpc64le-linux-gnu-libgfortran3-cxx03/powerpc64le-linux-gnu-gcc --sysroot=/opt/powerpc64le-linux-gnu/powerpc64le-linux-gnu/sys-root/ -DHAVE_ALIGNED_ALLOC -DHAVE_ATTRIBUTE_ALIGNED -DHAVE_BUILTIN_CTZ -DHAVE_BUILTIN_CTZLL -DHAVE_POSIX_MEMALIGN -DHAVE_SYMVER -DHAVE_SYS_AUXV_H -DHAVE_VISIBILITY_HIDDEN -DHAVE_VISIBILITY_INTERNAL -DPOWER_FEATURES -DPPC_FEATURES -DPPC_VMX -DWITH_GZFILEOP -DZLIBNG_NATIVE_API -DZLIB_DLL -D_LARGEFILE64_SOURCE=1 -D__USE_LARGEFILE64 -I/workspace/srcdir/zlib-ng/build -I/workspace/srcdir/zlib-ng -O2 -DNDEBUG -fPIC -Wall -std=c11 -MD -MT CMakeFiles/zlib.dir/gzwrite.c.o -MF CMakeFiles/zlib.dir/gzwrite.c.o.d -o CMakeFiles/zlib.dir/gzwrite.c.o -c /workspace/srcdir/zlib-ng/gzwrite.c
  | [16:27:09] /workspace/srcdir/zlib-ng/arch/power/power_features.c: In function ‘power_check_features’:
  | [16:27:09] /workspace/srcdir/zlib-ng/arch/power/power_features.c:34:24: error: ‘AT_HWCAP2’ undeclared (first use in this function)
  | [16:27:09]      hwcap2 = getauxval(AT_HWCAP2);
  | [16:27:09]                         ^
  | [16:27:09] /workspace/srcdir/zlib-ng/arch/power/power_features.c:34:24: note: each undeclared identifier is reported only once for each function it appears in
  | [16:27:09] /workspace/srcdir/zlib-ng/arch/power/power_features.c:30:19: warning: variable ‘hwcap2’ set but not used [-Wunused-but-set-variable]
  | [16:27:09]      unsigned long hwcap2;
  | [16:27:09]                    ^
  | [16:27:09] make[2]: *** [CMakeFiles/zlib.dir/build.make:454: CMakeFiles/zlib.dir/arch/power/power_features.c.o] Error 1
  | [16:27:09] make[2]: *** Waiting for unfinished jobs....
  | [16:27:10] make[2]: Leaving directory '/workspace/srcdir/zlib-ng/build'
  | [16:27:10] make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/zlib.dir/all] Error 2
  | [16:27:10] make[1]: Leaving directory '/workspace/srcdir/zlib-ng/build'
  | [16:27:10] make: *** [Makefile:156: all] Error 2
 ```

I think the statement `#include <linux/auxvec.h>` is missing in this source file.
@eschnett
Copy link
Author

I have since received this feedback from @giordano (see JuliaPackaging/Yggdrasil#8007): "I think the problem is that we target an old glibc (2.17), which doesn't have that header, but the corresponding linux header does that job. Unless upstream plans to support old glibc, it's probably fair for us to ship the patch, we do it elsewhere as well."

In other words, this issue might be caused by us using an old version of glibc, and if so, please disregard this issue.

@mtl1979
Copy link
Collaborator

mtl1979 commented Jan 24, 2024

In normal cross-build toolchain in Debian/Ubuntu, AT_HWCAP2 is defined in both bits/auxv.h (included by sys/auxv.h) and linux/auxvec.h. We already detect some unusual toolchains during configure time, but I can't fix for every possible toolchain unless I have the specific toolchain, that fails to build, on my build cluster.

This seems regression from 2fa631e.

@nmoinvaz
Copy link
Member

nmoinvaz commented Mar 6, 2024

@eschnett, a regression has been fixed in develop branch if you want to try it out.

@eschnett
Copy link
Author

eschnett commented Mar 7, 2024

Thanks. I was setting up a build recipe for Julia language bindings, and we usually stay with released versions there. I'm looking forward to needing fewer patches then!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Architecture Architecture specific Build Env
Projects
None yet
Development

No branches or pull requests

3 participants