crosstool-ng / crosstool-ng

A versatile (cross-)toolchain generator.
Other
2.1k stars 657 forks source link

MacProM1 armv8-rpi3-linux-gnueabihf gcc 10.4 and below compile error #1882

Open SmashingWB opened 1 year ago

SmashingWB commented 1 year ago

Issue submission guidelines

See detaled guidelines. In short:

I compiled GCC 11.3 +libc 2.34-ok, 2.35-ok, 2.36-ok (lower versions of Glibc do not work) I compile a simple program and sent to raspberry pi3, run it and get error:

home/pi/Test: /lib/arm-linux-gnueabihf/libc.so.6: version GLIBC_2.34 not found (required by /home/pi/Test)

Gcc version in raspberryPi: arm-linux-gnueabihf-gcc (Raspbian 10.2.1) GLIBC 2.31

I thought my glibc version was too high, I'll try with a lower gcc, because GCC 11.3 with glibc 2.31 does not compile together Trying to compile: gcc 10.4.0, 10.3.0 gcc-9.4.0, gcc-8.5.0 and I got the same error for all GCC:

[ALL ] "_use_cmse", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] ld: symbol(s) not found for architecture arm64 [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ERROR] make[1]: *** [Makefile:2868: build/gencondmd] Error 1 [ALL ] make[1]: Leaving directory '/Volumes/xtool-build-env/.build/armv8-rpi3-linux-gnueabihf/build/build-cc-gcc-core/gcc' [ERROR]
[ERROR] >> [ERROR] >> Build failed in step 'Installing core C gcc compiler' [ERROR] >> called in step '(top-level)' [ERROR] >> [ERROR] >> Error happened in: CT_DoExecLog[scripts/functions@376] [ERROR] >> called from: do_gcc_core_backend[scripts/build/cc/gcc.sh@653] [ERROR] >> called from: do_cc_core[scripts/build/cc/gcc.sh@210] [ERROR] >> called from: main[scripts/crosstool-NG.sh@697]

build.log config.txt

inflation commented 1 year ago

Related: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92061#c5

SmashingWB commented 1 year ago

Still the same problem, GCC 10.5

ALL ] aarch64-build_apple-darwin22.6.0-g++ -g -I/Volumes/xtool-build-env/.build/arm-linux-gnueabihf/buildtools/include -Qunused-arguments -fno-common -fbracket-depth=512 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-strict-aliasing -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wno-error=format-diag -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -DGENERATOR_FILE -L/Volumes/xtool-build-env/.build/arm-linux-gnueabihf/buildtools/lib -framework CoreFoundation -o build/gencondmd build/gencondmd.o build/errors.o ../build-aarch64-build_apple-darwin22.6.0/libiberty/libiberty.a [ALL ] Undefined symbols for architecture arm64: [ALL ] "_arm_abi", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch4", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_armarch5t", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch5te", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_armarch6", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch6k", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_armarch6m", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch7", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_armarch7em", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch8", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch8_1mmain", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch_arm_hwdiv", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] "_arm_archcde", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch_iwmmxt", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_arm_archlpae", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_arch_notm", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_arm_archthumb2", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_arm_base_arch", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_arm_disable_literal_pool", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] "_arm_restrictit", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_flag_pic", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_inline_thumb1_jump_table", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] "operands", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_optimize_size", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_reload_completed", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] "_reload_inprogress", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_target_flags", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_target_threadpointer", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_this_target_rtl", referenced from: [ALL ] _cxx_global_var_init in gencondmd.o [ALL ] "_unalignedaccess", referenced from: [ALL ] cxx_global_var_init in gencondmd.o [ALL ] "_use_cmse", referenced from: [ALL ] ___cxx_global_var_init in gencondmd.o [ALL ] ld: symbol(s) not found for architecture arm64 [ERROR] clang: error: linker command failed with exit code 1 (use -v to see invocation) [ERROR] make[1]: *** [Makefile:2916: build/gencondmd] Error 1 [ALL ] make[1]: Leaving directory '/Volumes/xtool-build-env/.build/arm-linux-gnueabihf/build/build-cc-gcc-core/gcc'

QBos07 commented 1 year ago

try bulding the toolchain using gcc and binutils ld from brew or simillar