Mailing List Archive

Strange error message during configuration on NetBSD 9.3
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@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc64/compile/GENERIC sparc64
p$



--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken
Re: Strange error message during configuration on NetBSD 9.3 [ In reply to ]
On Tue, Apr 16, 2024 at 01:55:18PM -0400, Dennis Clarke via perl5-porters wrote:
>
> 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@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc64/compile/GENERIC sparc64
> 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
Re: Strange error message during configuration on NetBSD 9.3 [ In reply to ]
On 4/16/24 23:40, Tony Cook wrote:
> On Tue, Apr 16, 2024 at 01:55:18PM -0400, Dennis Clarke via perl5-porters wrote:
>>
>> 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@mkrepro.NetBSD.org:/usr/src/sys/arch/sparc64/compile/GENERIC sparc64
>> 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
Re: Strange error message during configuration on NetBSD 9.3 [ In reply to ]
On 4/16/24 23:40, Tony Cook wrote:
> On Tue, Apr 16, 2024 at 01:55:18PM -0400, Dennis Clarke via perl5-porters wrote:
>>
>> I see a strange error when I attempt to configure perl on a NetBSD 9.3
>> server :
>>
...
> 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@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
Re: Strange error message during configuration on NetBSD 9.3 [ In reply to ]
Just interesting, why did you touch "fremont.sh" and "bisect-runner.pl" (in
addition)?

See also: https://github.com/Perl/perl5/pull/22152/files

Thanks

On Wed, Apr 17, 2024 at 8:04?PM Dennis Clarke via perl5-porters <
perl5-porters@perl.org> wrote:

> On 4/16/24 23:40, Tony Cook wrote:
> > On Tue, Apr 16, 2024 at 01:55:18PM -0400, Dennis Clarke via
> perl5-porters wrote:
> >>
> >> I see a strange error when I attempt to configure perl on a NetBSD 9.3
> >> server :
> >>
> ...
> > 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@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
>
>
Re: Strange error message during configuration on NetBSD 9.3 [ In reply to ]
On 4/17/24 16:42, Elvin Aslanov wrote:
> Just interesting, why did you touch "fremont.sh" and "bisect-runner.pl" (in
> addition)?
>
> See also: https://github.com/Perl/perl5/pull/22152/files
I was trying to get perl to compile. That is why. I really do not care
where that "whole-archive" exists. I will nuke it from orbit to get a
clean compile. Which I did.

The testing process blows up real fast ... sadly :

/opt/bw/build/perl-5.38.2_netbsd_9.3_sparcv9.003/dist/threads/../../miniperl
"-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- threads.bs
../../lib/auto/threads/threads.bs 644
./miniperl -Ilib make_ext.pl lib/auto/threads/shared/shared.so
MAKE="make" LIBPERL_A=libperl.a LINKTYPE=dynamic
/opt/bw/build/perl-5.38.2_netbsd_9.3_sparcv9.003/dist/threads-shared/../../miniperl
"-I../../lib" -MExtUtils::Command::MM -e 'cp_nonempty' -- shared.bs
../../lib/auto/threads/shared/shared.bs 644
cd t && (rm -f perl; /bin/ln -s ../perl perl)
./runtests choose
*** Error code 1

Stop.
make: stopped in /opt/bw/build/perl-5.38.2_netbsd_9.3_sparcv9.003

No clue what is going on there.





--
Dennis Clarke
RISC-V/SPARC/PPC/ARM/CISC
UNIX and Linux spoken