lang/perl5*: alternative workaround for lld 15 and dtrace enabled

Modify the workaround committed in 4ae8ff941b by only adding
-Wl,--allow-multiple-definition to the two link command lines that
require it, instead of adding it to hints/freebsd.sh

Otherwise, that linker flag is emitted into perl's global configuration
(/usr/local/lib/perl5/5.xx/mach/Config_heavy.pl), and might be used by
other ports which link in libperl, such as www/mod_perl2, which cannot
correctly handle any unexpected linker flags, leading to errors.

PR:		265516
Reported by:	lev
Approved by:	maintainer timeout (1 month)
Fixes:		4ae8ff941b
MFH:		2022Q3
This commit is contained in:
Dimitry Andric 2022-09-21 22:24:33 +02:00
parent 8db22477ca
commit 8c69fc20e6
12 changed files with 84 additions and 56 deletions

View File

@ -4,7 +4,7 @@ PORTNAME= perl
DISTVERSIONPREFIX= v
DISTVERSION= ${GH_TAGNAME:C/^v//:C/-g[0-9a-f]*$//}
DISTVERSIONSUFFIX= ${GH_TAGNAME:C/.*-g/-g/}
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= lang devel perl5
# XXX Leave only CPAN.
MASTER_SITES= LOCAL/mat/perl \

View File

@ -1,8 +1,8 @@
Allow customisation of shrpldflags.
--- Makefile.SH.orig 2015-09-08 05:21:36 UTC
--- Makefile.SH.orig 2022-06-19 19:29:35 UTC
+++ Makefile.SH
@@ -40,7 +40,6 @@ esac
@@ -40,7 +40,6 @@ linklibperl_nonshr=''
pwd="`pwd`"
linklibperl='$(LIBPERL)'
linklibperl_nonshr=''
@ -10,3 +10,21 @@ Allow customisation of shrpldflags.
ldlibpth=''
DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
@@ -924,7 +923,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLE
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
rm -f $@
- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,--allow-multiple-definition $(perllib_objs) $(DYNALOADER) $(libs)
!NO!SUBS!
case "$osname" in
aix)
@@ -1015,7 +1014,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildc
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
-@rm -f miniperl.xok
- $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(CC) $(CLDFLAGS) -Wl,--allow-multiple-definition -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl

View File

@ -22,14 +22,3 @@ Remove libs that are not here on FreeBSD.
;;
esac
@@ -142,8 +148,8 @@ case "$osvers" in
*)
libpth="/usr/lib /usr/local/lib"
glibpth="/usr/lib /usr/local/lib"
- ldflags="-Wl,-E "
- lddlflags="-shared "
+ ldflags="-Wl,-E,--allow-multiple-definition"
+ lddlflags="-shared -Wl,--allow-multiple-definition"
cccdlflags='-DPIC -fPIC'
;;
esac

View File

@ -1,6 +1,6 @@
PORTNAME= perl
DISTVERSION= ${PERL_VERSION}
PORTREVISION= 2
PORTREVISION= 3
CATEGORIES= lang devel perl5
MASTER_SITES= CPAN/../../src/5.0
DIST_SUBDIR= perl

View File

@ -1,8 +1,8 @@
Allow customisation of shrpldflags.
--- Makefile.SH.orig 2015-09-08 05:21:36 UTC
--- Makefile.SH.orig 2020-12-18 12:43:54 UTC
+++ Makefile.SH
@@ -40,7 +40,6 @@ esac
@@ -40,7 +40,6 @@ linklibperl_nonshr=''
pwd="`pwd`"
linklibperl='$(LIBPERL)'
linklibperl_nonshr=''
@ -10,3 +10,21 @@ Allow customisation of shrpldflags.
ldlibpth=''
DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
@@ -932,7 +931,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLE
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
rm -f $@
- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,--allow-multiple-definition $(perllib_objs) $(DYNALOADER) $(libs)
!NO!SUBS!
case "$osname" in
aix)
@@ -1038,7 +1037,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildc
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
-@rm -f miniperl.xok
- $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(CC) $(CLDFLAGS) -Wl,--allow-multiple-definition -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl

View File

@ -22,14 +22,3 @@ Remove libs that are not here on FreeBSD.
;;
esac
@@ -142,8 +148,8 @@ case "$osvers" in
*)
libpth="/usr/lib /usr/local/lib"
glibpth="/usr/lib /usr/local/lib"
- ldflags="-Wl,-E "
- lddlflags="-shared "
+ ldflags="-Wl,-E,--allow-multiple-definition"
+ lddlflags="-shared -Wl,--allow-multiple-definition"
cccdlflags='-DPIC -fPIC'
;;
esac

View File

@ -1,6 +1,6 @@
PORTNAME= perl
DISTVERSION= ${PERL_VERSION}
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= lang devel perl5
MASTER_SITES= CPAN/../../src/5.0
DIST_SUBDIR= perl

View File

@ -1,8 +1,8 @@
Allow customisation of shrpldflags.
--- Makefile.SH.orig 2015-09-08 05:21:36 UTC
--- Makefile.SH.orig 2022-02-26 18:50:37 UTC
+++ Makefile.SH
@@ -40,7 +40,6 @@ esac
@@ -40,7 +40,6 @@ linklibperl_nonshr=''
pwd="`pwd`"
linklibperl='$(LIBPERL)'
linklibperl_nonshr=''
@ -10,3 +10,21 @@ Allow customisation of shrpldflags.
ldlibpth=''
DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
@@ -932,7 +931,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLE
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
rm -f $@
- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,--allow-multiple-definition $(perllib_objs) $(DYNALOADER) $(libs)
!NO!SUBS!
case "$osname" in
aix)
@@ -1038,7 +1037,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildc
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
-@rm -f miniperl.xok
- $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(CC) $(CLDFLAGS) -Wl,--allow-multiple-definition -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl

View File

@ -22,14 +22,3 @@ Remove libs that are not here on FreeBSD.
;;
esac
@@ -142,8 +148,8 @@ case "$osvers" in
*)
libpth="/usr/lib /usr/local/lib"
glibpth="/usr/lib /usr/local/lib"
- ldflags="-Wl,-E "
- lddlflags="-shared "
+ ldflags="-Wl,-E,--allow-multiple-definition"
+ lddlflags="-shared -Wl,--allow-multiple-definition"
cccdlflags='-DPIC -fPIC'
;;
esac

View File

@ -1,6 +1,6 @@
PORTNAME= perl
DISTVERSION= ${PERL_VERSION}
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= lang devel perl5
MASTER_SITES= CPAN/../../src/5.0
DIST_SUBDIR= perl

View File

@ -1,8 +1,8 @@
Allow customisation of shrpldflags.
--- Makefile.SH.orig 2015-09-08 05:21:36 UTC
--- Makefile.SH.orig 2022-05-21 21:27:09 UTC
+++ Makefile.SH
@@ -40,7 +40,6 @@ esac
@@ -40,7 +40,6 @@ linklibperl_nonshr=''
pwd="`pwd`"
linklibperl='$(LIBPERL)'
linklibperl_nonshr=''
@ -10,3 +10,21 @@ Allow customisation of shrpldflags.
ldlibpth=''
DPERL_EXTERNAL_GLOB='-DPERL_EXTERNAL_GLOB'
DPERL_IS_MINIPERL='-DPERL_IS_MINIPERL'
@@ -924,7 +923,7 @@ $(LIBPERL): $& $(perllib_dep) $(DYNALOADER) $(LIBPERLE
true)
$spitshell >>$Makefile <<'!NO!SUBS!'
rm -f $@
- $(LD) -o $@ $(SHRPLDFLAGS) $(perllib_objs) $(DYNALOADER) $(libs)
+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,--allow-multiple-definition $(perllib_objs) $(DYNALOADER) $(libs)
!NO!SUBS!
case "$osname" in
aix)
@@ -1015,7 +1014,7 @@ lib/buildcustomize.pl: $& $(miniperl_dep) write_buildc
$spitshell >>$Makefile <<'!NO!SUBS!'
lib/buildcustomize.pl: $& $(miniperl_dep) write_buildcustomize.pl
-@rm -f miniperl.xok
- $(CC) $(CLDFLAGS) -o $(MINIPERL_EXE) \
+ $(CC) $(CLDFLAGS) -Wl,--allow-multiple-definition -o $(MINIPERL_EXE) \
$(miniperl_objs) $(libs)
$(LDLIBPTH) ./miniperl$(HOST_EXE_EXT) -w -Ilib -Idist/Exporter/lib -MExporter -e '<?>' || sh -c 'echo >&2 Failed to build miniperl. Please run make minitest; exit 1'
$(MINIPERL) -f write_buildcustomize.pl

View File

@ -22,14 +22,3 @@ Remove libs that are not here on FreeBSD.
;;
esac
@@ -142,8 +148,8 @@ case "$osvers" in
*)
libpth="/usr/lib /usr/local/lib"
glibpth="/usr/lib /usr/local/lib"
- ldflags="-Wl,-E "
- lddlflags="-shared "
+ ldflags="-Wl,-E,--allow-multiple-definition"
+ lddlflags="-shared -Wl,--allow-multiple-definition"
cccdlflags='-DPIC -fPIC'
;;
esac