Error in building Julia for Alpine Linux (ARM v7 32bits)

Hello folks

I try to built Julia for a custom Alpine linux armv7 on Docker. The container I use is this one (https://github.com/balena-io-library/base-images/tree/master/balena-base-images/device-base/zc702-zynq7/alpine/3.12)

After some time of compilation I get the following error

    In file included from /home/rgerzagu/work/julia/src/processor.cpp:844:
    /home/rgerzagu/work/julia/src/processor_arm.cpp:13:31: warning: "__GLIBC_PREREQ" is not defined, evaluates to 0 [-Wundef]
       13 | #if defined(_CPU_AARCH64_) || __GLIBC_PREREQ(2, 16)
          |                               ^~~~~~~~~~~~~~
    /home/rgerzagu/work/julia/src/processor_arm.cpp:13:45: error: missing binary operator before token "("
       13 | #if defined(_CPU_AARCH64_) || __GLIBC_PREREQ(2, 16)
          |                                             ^
    make[1]: *** [Makefile:165: processor.o] Error 1
    make[1]: *** Waiting for unfinished jobs....

I understand that it is link to the fact that the Linux uses musl and not libc but not sure how I can handle that (it is possible though ?)

Thanks in advance
Robin

I don’t know much about this but there has been a recent post with successful build for ARM:

Maybe you find some help there.

1 Like

I believe it’s fixed recently.

2 Likes

Thank you very much for the feedback.
I switch to the master branch, and the error disappears… which is great and I get a new one :point_up: !

[ 85%] Linking CXX shared library ../../lib/libLLVM-9jl.so
/usr/lib/gcc/armv7-alpine-linux-musleabihf/9.3.0/../../../../armv7-alpine-linux-musleabihf/bin/ld: ../../lib/libLLVMVectorize.a: member ../../lib/libLLVMVectorize.a(LoopVectorize.cpp.o) in archive is not an object
collect2: error: ld returned 1 exit status
make[4]: *** [tools/llvm-shlib/CMakeFiles/LLVM.dir/build.make:220: lib/libLLVM-9jl.so] Error 1
make[3]: *** [CMakeFiles/Makefile2:18887: tools/llvm-shlib/CMakeFiles/LLVM.dir/all] Error 2
make[3]: *** Waiting for unfinished jobs....
[ 85%] Built target llvm-exegesis
make[2]: *** [Makefile:172: all] Error 2
make[1]: *** [/home/pi/work/julia/deps/llvm.mk:4

Again, any clue on this would be greatly appreciated !