Opened 11 years ago
Closed 4 years ago
#10241 closed bug (fixed)
ARM builds broken after PM, missing built-in atomics in libgcc for Haiku
Reported by: | kallisti5 | Owned by: | ithamar |
---|---|---|---|
Priority: | normal | Milestone: | Unscheduled |
Component: | Build System | Version: | R1/Development |
Keywords: | arm bootstrap | Cc: | |
Blocked By: | Blocking: | ||
Platform: | arm |
Description (last modified by )
Buildtools for arm work...
../configure -j8 --build-cross-tools arm ../../buildtools --bootstrap /home/kallisti5/Code/haikuporter /home/kallisti5/Code/haikuports.cross /home/kallisti5/Code/haikuports
EDIT: I was building the wrong target.
Now we are running into issues with the gcc_bootstrap build on arm. (jam -q -sHAIKU_BOOT_BOARD=verdex @bootstrap-raw)
/bin/bash ../libtool --tag CXX --mode=link arm-unknown-haiku-c++ --sysroot=/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/ -DPIC -Wall -Wextra -Wwrite-strings -Wcast-qual -Wabi -fdiagnostics-show-location=once -ffunction-sections -fdata-sections -frandom-seed=libstdc++.la -o libstdc++.la -version-info 6:18:0 -lm -rpath /packages/gcc_bootstrap-4.8.2_2014_02_27-1/.self/develop/tools/lib compatibility.lo compatibility-debug_list.lo compatibility-debug_list-2.lo compatibility-c++0x.lo compatibility-atomic-c++0x.lo compatibility-thread-c++0x.lo compatibility-chrono.lo ../libsupc++/libsupc++convenience.la ../src/c++98/libc++98convenience.la ../src/c++11/libc++11convenience.la libtool: link: arm-unknown-haiku-c++ --sysroot=/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/ -shared -nostdlib /home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/boot/system/develop/lib/crti.o /home/kallisti5/Code/haiku/generated.arm/cross-tools-arm/lib/gcc/arm-unknown-haiku/4.8.2/crtbegin.o /home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/boot/system/develop/lib/init_term_dyn.o .libs/compatibility.o .libs/compatibility-debug_list.o .libs/compatibility-debug_list-2.o .libs/compatibility-c++0x.o .libs/compatibility-atomic-c++0x.o .libs/compatibility-thread-c++0x.o .libs/compatibility-chrono.o -Wl,--whole-archive ../libsupc++/.libs/libsupc++convenience.a ../src/c++98/.libs/libc++98convenience.a ../src/c++11/.libs/libc++11convenience.a -Wl,--no-whole-archive -L/home/kallisti5/Code/haiku/generated.arm/cross-tools-arm/lib/gcc/arm-unknown-haiku/4.8.2 -L/home/kallisti5/Code/haiku/generated.arm/cross-tools-arm/lib/gcc/arm-unknown-haiku/4.8.2/../../../../arm-unknown-haiku/lib -L/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/boot/system/develop/lib -lroot -lgcc /home/kallisti5/Code/haiku/generated.arm/cross-tools-arm/lib/gcc/arm-unknown-haiku/4.8.2/crtend.o /home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/boot/system/develop/lib/crtn.o -Wl,-soname -Wl,libstdc++.so -o .libs/libstdc++.so .libs/compatibility-atomic-c++0x.o: In function `std::atomic_flag::test_and_set(std::memory_order)': /home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/arm-unknown-haiku/libstdc++-v3/include/bits/atomic_base.h:287: undefined reference to `__sync_val_compare_and_swap_1' collect2: error: ld returned 1 exit status make[5]: *** [libstdc++.la] Error 1 make[5]: Leaving directory `/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/arm-unknown-haiku/libstdc++-v3/src' make[4]: *** [all-recursive] Error 1 make[4]: Leaving directory `/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/arm-unknown-haiku/libstdc++-v3/src' make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory `/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/arm-unknown-haiku/libstdc++-v3' make[2]: *** [all] Error 2 make[2]: Leaving directory `/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj/arm-unknown-haiku/libstdc++-v3' make[1]: *** [all-target-libstdc++-v3] Error 2 make[1]: Leaving directory `/home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/sources/gcc_bootstrap-4.8.2_2014_02_27-obj' make: *** [all] Error 2 Command '['/bin/bash', '-c', '. /home/kallisti5/Code/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/wrapper-script']' returned non-zero exit status 2
This seems to be due to a missing built-in atomic for Haiku. When gcc arm attempts to build gcc arm under Haiku this happens.
Attachments (2)
Change History (19)
comment:1 by , 11 years ago
by , 11 years ago
Attachment: | buildlog-haiku_loader.txt added |
---|
comment:3 by , 11 years ago
Description: | modified (diff) |
---|
http://vincesoft.blogspot.com/2012/04/how-to-solve-undefined-reference-to.html
The issue is due to this source missing for Haiku: http://cgit.haiku-os.org/buildtools/tree/gcc/libgcc/config/arm/linux-atomic.c
This gets included via: http://cgit.haiku-os.org/buildtools/tree/gcc/libgcc/config/arm/t-linux-eabi
Which gets included via: http://cgit.haiku-os.org/buildtools/tree/gcc/libgcc/config.host#n332
comment:4 by , 11 years ago
Summary: | ARM builds broken after PM → ARM builds broken after PM, missing built-in atomics in libgcc for Haiku |
---|
comment:5 by , 11 years ago
patch: | 0 → 1 |
---|
comment:6 by , 11 years ago
This patch implements the libgcc part of the missing atomic intrinsics for ARMv5 and lower. It requires kernel patch to function on ARMv5 and lower (part of my gsoc project).
This patch also furthers the compilation point, we now have:
/home/shantanu/haiku/haiku/generated.arm/cross-tools-arm/lib/gcc/arm-unknown-haiku/4.8.2/../../../../arm-unknown-haiku/bin/ld: error: .libs/libstdc++.so uses VFP register arguments, /home/shantanu/haiku/haiku/generated.arm/objects/haiku/arm/packaging/repositories/HaikuPortsCross-build/sys-devel/gcc_bootstrap/work-4.8.2_2014_02_27/boot/cross-sysroot/arm/boot/system/develop/lib/init_term_dyn.o does not
comment:7 by , 11 years ago
Please ignore the above patch, I have a revision in the work which doesn't depend on linux like user helper function in the kernel.
comment:8 by , 11 years ago
patch: | 1 → 0 |
---|
comment:9 by , 11 years ago
patch: | 0 → 1 |
---|
comment:10 by , 11 years ago
This patch implements the same atomic intrinsics as before but tries to use already implemented atomic syscalls for ARMv5 and lower in haiku.
The next compilation error is same as mentioned in my previous comments, libstdc++v3 uses fp register arguments while init_term_dyn.o does not.
by , 11 years ago
Attachment: | 0001-gcc-libgcc-Implement-atomic-intrinsics.patch added |
---|
Implement atomic intrinsics in libgcc
comment:11 by , 11 years ago
Hi, I have used the stdatomic.c implementation from FreeBSD. It is integrated on libroot side, which avoids further patching of gcc.
However, we get to the VFP error anyway. I was trying to build for the beagle board, maybe trying to build for a non-VFP target would work?
comment:12 by , 11 years ago
Hi,
I've tried building for the default verdex board (xScale) which doesn't use softabi/hardabi flags but yet compilation halts on the very same error regarding incompatible vfp flags while linking init_term_dyn.o with libstdc++v3.
comment:13 by , 11 years ago
Mentionning this here after discussing with zeusk over IRC: the stdatomic I imported from FreeBSD works well for ARMv6+, but on ARMv5, it uses a trap function to implement atomic operations, which we can avoid by using the patch he attached here.
However, the ARMv6+ implementation from FreeBSD is likely more efficient, so we want to keep that, and I think it would make sense to keep everything in libroot rather than putting them on gcc side.
comment:14 by , 11 years ago
It (bsd's stdatomic) doesn't use syscall, It uses trap functions like linux does and my previous patch. I was recommended against such implementation and was asked to use the haiku's atomic syscalls which works without any modifications to the kernel for any CPU regardless if it is ARMv5 or ARMv6. As for efficiency, you can improve those functions in my patch if you think there is a more efficient way to do things.
comment:15 by , 10 years ago
Owner: | changed from | to
---|---|
Priority: | high → normal |
Status: | new → assigned |
comment:16 by , 4 years ago
This ticket looks closable now, I'm pretty certain we're pumping out nightly ARM images at the moment. :)
comment:17 by , 4 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
https://download.haiku-os.org/nightly-images/arm/
Looks like it, closing.
From the shortened output it's hard to say much. The respective Jamfile (src/system/boot/platform/generic/Jamfile) correctly declares the zlib dependency of video_splash.cpp and it also adds the zlib headers. Since the zlib header directory doesn't even appear on the command line, there's likely an earlier problem.