Post by Tony CookPost by Dennis Clarke via perl5-portersI see a strange error when I attempt to configure perl on a NetBSD 9.3
...
Post by Tony CookThe "--whole-archive" option was needed in very old NetBSD, though
no-one involved (including myself, who added the CBU) added a ticket
reference.
Tony
OKay I seem to have exocised the demons.
A few trivial edits later and we get a clean compile :
pollux#
pollux# pwd
/opt/bw/build/perl-5.38.2
pollux#
pollux#
pollux# uname -a
NetBSD pollux.bw.genunix.com 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0:
Tue Mar 12 12:45:42 UTC 2024
***@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc64/compile/GENERIC sparc64
pollux#
pollux# pwd
/opt/bw/build/perl-5.38.2
pollux#
pollux# diff -u ./hints/netbsd.sh.orig ./hints/netbsd.sh
--- ./hints/netbsd.sh.orig 2023-11-28 11:57:28.000000000 +0000
+++ ./hints/netbsd.sh 2024-04-17 15:10:10.598422488 +0000
@@ -41,8 +41,8 @@
# system gcc to build correctly, so check for it
echo 'int f(void) { return 0; }' >try.c
if ${cc:-cc} $cccdlflags -c try.c -otry.o 2>&1 &&
- ${cc:-cc} --whole-archive $lddlflags try.o -otry.so 2>&1 ; then
- lddlflags="--whole-archive $lddlflags"
+ ${cc:-cc} $lddlflags try.o -otry.so 2>&1 ; then
+ lddlflags=" $lddlflags"
fi
rm try.c try.o try.so 2>/dev/null
EOCBU
@@ -55,8 +55,7 @@
# built as C++ objects (__eh_alloc, __pure_virtual,
# etc.) will always be defined.
#
- ccdlflags="-Wl,-whole-archive -lgcc \
- -Wl,-no-whole-archive -Wl,-E $ccdlflags"
+ ccdlflags=" -lgcc -Wl,-E $ccdlflags"
;;
*)
ccdlflags="-Wl,-E $ccdlflags"
pollux#
pollux# diff -u ./hints/freemint.sh.orig ./hints/freemint.sh
--- ./hints/freemint.sh.orig 2023-11-28 11:57:28.000000000 +0000
+++ ./hints/freemint.sh 2024-04-17 15:10:27.922457397 +0000
@@ -5,7 +5,7 @@
archname="m68k-freemint"
cccdlflags=' '; # avoid -fPIC
-ccdlflags="-Wl,-whole-archive -lgcc -lpthread -Wl,-no-whole-archive"
+ccdlflags="-lgcc -lpthread"
# libs
libpth="$prefix/lib /usr/local/lib /usr/lib"
pollux#
pollux# diff -u ./Porting/bisect-runner.pl.orig ./Porting/bisect-runner.pl
--- ./Porting/bisect-runner.pl.orig 2024-04-17 14:56:05.271872880 +0000
+++ ./Porting/bisect-runner.pl 2023-11-28 11:57:27.000000000 +0000
@@ -3028,7 +3028,7 @@
d_dlerror=$define
ccdlflags="-Wl,-E -Wl,-R${PREFIX}/lib $ccdlflags"
cccdlflags="-DPIC -fPIC $cccdlflags"
- lddlflags="-shared $lddlflags"
+ lddlflags="--whole-archive -shared $lddlflags"
elif [ "`uname -m`" = "pmax" ]; then
# NetBSD 1.3 and 1.3.1 on pmax shipped an 'old' ld.so, which will not
work.
d_dlopen=$undef
pollux#
Let me get that tested and report back.
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken