On 26.04.2025 9:23, Mark Millard wrote:
FreeBSD has not and does not support all the __aeabi_ prefixed
symbols to make everything work for all the lang/gcc* .

It has gotten to the point that for lang/gcc14 (so modern) that
the likes of:

__aeabi_unwind_cpp_pr0
__aeabi_unwind_cpp_pr1
__aeabi_unwind_cpp_pr2

lead to the likes of:

/usr/local/bin/ld: a.out: hidden symbol `__aeabi_unwind_cpp_pr0' in 
/wrkdirs/usr/ports/lang/gcc14/work/.build/./prev-gcc/libgcc_eh.a(unwind-arm.o) 
is referenced by DSO

I am afraid that this is an incorrect and misleading analysis:
1) FreeBSD provides (and has provided for a long time) __aeabi_unwind_cpp_pr* symbols in /usr/lib/libgcc_eh.lib in very similar manner as gcc.

2) The problem is exactly the opposite, gcc14 does not provide these symbols.

In the configuration phase, configure builds executable with the bootstrap libgcc(in this case the static libgcc.a), but with the host(FBSD) libc. The FBSD libc uses unwinder, but the bootstrap libgcc.a does not provide it.

see:
"/usr/ports/lang/gcc14/work/.build/./prev-gcc/xgcc -B/usr/ports/lang/gcc14/work/.build/./prev-gcc/ -B/usr/local/armv7-portbld-freebsd15.0/bin/ -B/usr/local/armv7-portbld-freebsd15.0/bin/ -B/usr/local/armv7-portbld-freebsd15.0/lib/ -isystem /usr/local/armv7-portbld-freebsd15.0/include -isystem /usr/local/armv7-portbld-freebsd15.0/sys-include -fno-checking -g -O2 -fno-checking -gtoggle -DLIBICONV_PLUG -static-libstdc++ -static-libgcc conftest.c

In any case, I don't see any way to fix this on the FBSD (kernel, userland) side. There is only one little strange item: that each single object references __aeabi_unwind_cpp_p* symbols...

Michal

when attempting a build of lang/gcc14 for:

OPTIONS_DEFAULT_armv7= STANDARD_BOOTSTRAP

# find /wrkdirs/ -name config.log -exec grep -q __aeabi_unwind_cpp_pr0 {} \; 
-print | more
/wrkdirs/usr/ports/lang/gcc14/work/.build/libdecnumber/config.log
/wrkdirs/usr/ports/lang/gcc14/work/.build/libbacktrace/config.log
/wrkdirs/usr/ports/lang/gcc14/work/.build/libiberty/config.log
/wrkdirs/usr/ports/lang/gcc14/work/.build/lto-plugin/config.log

Note: The poudriere log file ends up instead reporting the likes of:

checking for library containing strerror... configure: error: Link tests are 
not allowed after GCC_NO_EXECUTABLES.

So: Giving no clue about the specifics.

Going in the direction of instead having:

#OPTIONS_DEFAULT_armv7= STANDARD_BOOTSTRAP

so that gcc is not used at all, the "jit" in:

LANGUAGES:=     c,c++,objc,fortran,jit

prevents having the system clang/clang++ do all
the build: after the early stages, gcc/g++
depends on library coding conventions specific
to gcc/g++ and clang/clang++ based builds do
not follow those conventions in libc++ or such.
(Poisoned names are detected and stop the build.)

As I do not need jit, I do the following in
order to have lang/gcc14 build on/for armv7
(and, presumably could for armv6 as well) :

# git -C /usr/ports/ diff lang/gcc14/ | cat
diff --git a/lang/gcc14/Makefile b/lang/gcc14/Makefile
index 74c59905c48d..7f082e68ecfe 100644
--- a/lang/gcc14/Makefile
+++ b/lang/gcc14/Makefile
@@ -39,8 +39,8 @@ CXXFLAGS:=    ${CXXFLAGS:N-mretpoline}
OPTIONS_DEFINE= GRAPHITE
  OPTIONS_DEFAULT_aarch64=STANDARD_BOOTSTRAP
-OPTIONS_DEFAULT_armv6= STANDARD_BOOTSTRAP
-OPTIONS_DEFAULT_armv7= STANDARD_BOOTSTRAP
+#OPTIONS_DEFAULT_armv6=        STANDARD_BOOTSTRAP
+#OPTIONS_DEFAULT_armv7=        STANDARD_BOOTSTRAP
  OPTIONS_DEFAULT_amd64=        STANDARD_BOOTSTRAP
  OPTIONS_DEFAULT_i386= STANDARD_BOOTSTRAP
  OPTIONS_DEFAULT_powerpc=      STANDARD_BOOTSTRAP
@@ -80,7 +80,11 @@ CONFIGURE_TARGET=    x86_64-portbld-${OPSYS:tl}${OSREL}
  CONFIGURE_ARGS+=      --with-abi=elfv2
  .endif
+.if ${ARCH} == armv7 || ${ARCH} == armv6
+LANGUAGES:=    c,c++,objc,fortran
+.else
  LANGUAGES:=   c,c++,objc,fortran,jit
+.endif
  TARGLIB=      ${PREFIX}/lib/gcc${SUFFIX}
  TARGLIB32=    ${PREFIX}/lib32 # The version information is added later
  LIBEXEC=      ${PREFIX}/libexec/gcc${SUFFIX}


(I do not show my disabling of install-strip use,
which is done for other reasons.)

At least for now that allows me to have lang/gcc14
other than for the jit language that I do not use.
But gcc14 or g++14 is not involved in producing
that gcc14 and g++14 .


===
Mark Millard
marklmi at yahoo.com




Reply via email to