concurrencykit / ck

Concurrency primitives, safe memory reclamation mechanisms and non-blocking (including lock-free) data structures designed to aid in the research, design and implementation of high performance concurrent systems developed in C99+.
http://concurrencykit.org/
Other
2.34k stars 312 forks source link

which compiler version is okay to do the aarch64 cross compile? #182

Closed xuteng935 closed 2 years ago

xuteng935 commented 2 years ago

Hi, I downloaded the latest code and want to cross compile on my Ubuntu 18.04 PC. I failed to do the configure operation, looks like my gcc compiler(aarch64-linux-gnu-gcc 8.4.0) is not suitable. May I know which compiler version is okay to do the aarch64 cross compile? Thanks.

~/source/ck-master$ CC=aarch64-linux-gnu-gcc ./configure --host=aarch64-linux-gnu
Detecting operating system.......success [linux]
Detecting machine architecture...success [x86_64]
Finding dirname command..........success [/usr/bin/dirname]
Determining build directory......success [/home/xuteng/source/ck-master]
Finding gzip tool................success [/bin/gzip]
Finding suitable compiler........failed  [update compiler]
~/source/ck-master$ aarch64-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=aarch64-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc-cross/aarch64-linux-gnu/8/lto-wrapper
Target: aarch64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 8.4.0-1ubuntu1~18.04' --with-bugurl=file:///usr/share/doc/gcc-8/README.Bugs --enable-languages=c,ada,c++,go,d,fortran,objc,obj-c++ --prefix=/usr --with-gcc-major-version-only --program-suffix=-8 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-libquadmath --disable-libquadmath-support --enable-plugin --enable-default-pie --with-system-zlib --disable-libphobos --enable-multiarch --enable-fix-cortex-a53-843419 --disable-werror --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=aarch64-linux-gnu --program-prefix=aarch64-linux-gnu- --includedir=/usr/aarch64-linux-gnu/include
Thread model: posix
gcc version 8.4.0 (Ubuntu/Linaro 8.4.0-1ubuntu1~18.04)
jrtc27 commented 2 years ago

The home-grown configure script is broken for cross-compiling, it does various probing via uname and tries to run binaries produced by CC (the latter being what tries to detect if the compiler is supported, which of course fails because it's an AArch64 binary being run on x86). If you install qemu-user and run configure with --platform=aarch64 then you might be able to work around its limitations, but it's clearly unsupported.

sbahra commented 2 years ago

Wouldn't be tough to address. I'm out of pocket until January, but happy to help review patches.

xuteng935: The recommended approach for cross-compiling is to set up your own .build files (use configuration profile), which is what others have done.