Discussion:
Strange error message during configuration on NetBSD 9.3
Add Reply
Dennis Clarke via perl5-porters
2024-04-16 17:55:18 UTC
Reply
Permalink
I see a strange error when I attempt to configure perl on a NetBSD 9.3
server :

.
.
.
If this doesn't make any sense to you, just accept the default 'n'.
Build a threading Perl? [n]
Your platform has some specific hints regarding threaded builds, using
them...

Perl can be built so that multiple Perl interpreters can coexist
within the same Perl executable.

If this doesn't make any sense to you, just accept the default 'n'.
Build Perl for multiplicity? [n]

Use which C compiler? [cc] gcc
gcc: error: unrecognized command line option ‘--whole-archive’; did you
mean ‘--whole-program’?

Hmm... Looks kind of like a BSD system, but we'll see...

.
.
.

I have never seen that before.

Perhaps there is some strange compiler test in the config script?


For the record this is NetBSD 9.3 on sparcv9 :

p$
p$ 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
p$



--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
Tony Cook
2024-04-17 03:40:08 UTC
Reply
Permalink
Post by Dennis Clarke via perl5-porters
I see a strange error when I attempt to configure perl on a NetBSD 9.3
.
.
.
If this doesn't make any sense to you, just accept the default 'n'.
Build a threading Perl? [n]
Your platform has some specific hints regarding threaded builds, using
them...
Perl can be built so that multiple Perl interpreters can coexist
within the same Perl executable.
If this doesn't make any sense to you, just accept the default 'n'.
Build Perl for multiplicity? [n]
Use which C compiler? [cc] gcc
gcc: error: unrecognized command line option ‘--whole-archive’; did you mean
‘--whole-program’?
Hmm... Looks kind of like a BSD system, but we'll see...
.
.
.
I have never seen that before.
Perhaps there is some strange compiler test in the config script?
p$
p$ uname -a
NetBSD pollux.bw.genunix.com 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0: Tue
Mar 12 12:45:42 UTC 2024
p$
There's a test done in the compiler callback unit to test where the
compiler supports that flag. It looks like it needs an extra
redirection to prevent the noise.

The "--whole-archive" option was needed in very old NetBSD, though
no-one involved (including myself, who added the CBU) added a ticket
reference.

Tony
Dennis Clarke via perl5-porters
2024-04-17 16:14:24 UTC
Reply
Permalink
Post by Tony Cook
Post by Dennis Clarke via perl5-porters
I see a strange error when I attempt to configure perl on a NetBSD 9.3
.
.
.
If this doesn't make any sense to you, just accept the default 'n'.
Build a threading Perl? [n]
Your platform has some specific hints regarding threaded builds, using
them...
Perl can be built so that multiple Perl interpreters can coexist
within the same Perl executable.
If this doesn't make any sense to you, just accept the default 'n'.
Build Perl for multiplicity? [n]
Use which C compiler? [cc] gcc
gcc: error: unrecognized command line option ‘--whole-archive’; did you mean
‘--whole-program’?
Hmm... Looks kind of like a BSD system, but we'll see...
.
.
.
I have never seen that before.
Perhaps there is some strange compiler test in the config script?
p$
p$ uname -a
NetBSD pollux.bw.genunix.com 9.3_STABLE NetBSD 9.3_STABLE (GENERIC) #0: Tue
Mar 12 12:45:42 UTC 2024
p$
There's a test done in the compiler callback unit to test where the
compiler supports that flag. It looks like it needs an extra
redirection to prevent the noise.
The "--whole-archive" option was needed in very old NetBSD, though
no-one involved (including myself, who added the CBU) added a ticket
reference.
Tony
Looks trivial to fix and I am working on it. The compile is running
now and I will report back when I have a clean testsuite.
--
--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
Dennis Clarke via perl5-porters
2024-04-17 18:04:15 UTC
Reply
Permalink
Post by Tony Cook
Post by Dennis Clarke via perl5-porters
I see a strange error when I attempt to configure perl on a NetBSD 9.3
...
Post by Tony Cook
The "--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

Loading...