Skip to content

Commit 44ef343

Browse files
rockdrillarobimarko
authored andcommitted
toolchain: gcc: fix build error with glibc for aarch64 targets
GCC 14+ fails to build due to libatomic specific -march handling. This build error triggers only with glibc and not with musl libc which is default. Related: openwrt/openwrt#16073 Signed-off-by: Konstantin Demin <[email protected]> Link: openwrt/openwrt#18647 Signed-off-by: Robert Marko <[email protected]>
1 parent 2a9316f commit 44ef343

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
libatomic: Do not enforce march on aarch64
2+
3+
Inspired by The Yocto Project [1].
4+
5+
[1] https://github.com/yoctoproject/poky/blob/51192a79f1717786dda42776f916c3d97ada7971/meta/recipes-devtools/gcc/gcc/0022-libatomic-Do-not-enforce-march-on-aarch64.patch
6+
7+
Signed-off-by: Konstantin Demin <[email protected]>
8+
9+
libatomic/Makefile.am | 1 -
10+
libatomic/Makefile.in | 1 -
11+
2 files changed, 2 deletions(-)
12+
13+
--- a/libatomic/Makefile.am
14+
+++ b/libatomic/Makefile.am
15+
@@ -130,7 +130,6 @@ libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix _$(s)_.lo,$(SIZEOBJS)))
16+
## On a target-specific basis, include alternates to be selected by IFUNC.
17+
if HAVE_IFUNC
18+
if ARCH_AARCH64_LINUX
19+
-IFUNC_OPTIONS = -march=armv8-a+lse
20+
libatomic_la_LIBADD += $(foreach s,$(SIZES),$(addsuffix _$(s)_1_.lo,$(SIZEOBJS)))
21+
22+
endif
23+
--- a/libatomic/Makefile.in
24+
+++ b/libatomic/Makefile.in
25+
@@ -452,7 +452,6 @@ M_SRC = $(firstword $(filter %/$(M_FILE), $(all_c_files)))
26+
libatomic_la_LIBADD = $(foreach s,$(SIZES),$(addsuffix \
27+
_$(s)_.lo,$(SIZEOBJS))) $(am__append_1) $(am__append_2) \
28+
$(am__append_3) $(am__append_4)
29+
-@ARCH_AARCH64_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv8-a+lse
30+
@ARCH_ARM_LINUX_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=armv7-a+fp -DHAVE_KERNEL64
31+
@ARCH_I386_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -march=i586
32+
@ARCH_X86_64_TRUE@@HAVE_IFUNC_TRUE@IFUNC_OPTIONS = -mcx16 -mcx16

0 commit comments

Comments
 (0)