Index: Mk/Scripts/qa.sh =================================================================== --- Mk/Scripts/qa.sh +++ Mk/Scripts/qa.sh @@ -206,7 +206,39 @@ fi } -checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool" +libperl() { + if [ -n ${SITE_ARCH_REL} ]; then + rc=0 + while read f; do + found=`readelf -d $f | awk "BEGIN {libperl=1; rpath=10; runpath=100} + /NEEDED.*${LIBPERL}/ { libperl = 0 } + /RPATH.*perl.*CORE/ { rpath = 0 } + /RUNPATH.*perl.*CORE/ { runpath = 0} + END {print libperl+rpath+runpath} + "` + if [ "$found" -ne "0" ]; then + case "$found" in + *1) + rc=1 + err "${f} is not linked with ${LIBPERL}, not respecting lddlflags ?" + ;; + *1?) + warn "${f} does not have the ${LIBPERL} rpath, not respecting lddlflags ?" + ;; + 1??) + warn "${f} does not have the ${LIBPERL} runpath, not respecting lddlflags ?" + ;; + esac + fi + done <<-EOT + $(find ${STAGEDIR}${PREFIX}/${SITE_ARCH_REL} -name '*.so') + EOT + + return ${rc} + fi +} + +checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo suidfiles libtool libperl" ret=0 cd ${STAGEDIR} Index: Mk/Uses/perl5.mk =================================================================== --- Mk/Uses/perl5.mk +++ Mk/Uses/perl5.mk @@ -106,6 +106,8 @@ PERL= ${LOCALBASE}/bin/perl CONFIGURE_ENV+= ac_cv_path_PERL=${PERL} ac_cv_path_PERL_PATH=${PERL} +QA_ENV+= SITE_ARCH_REL=${SITE_ARCH_REL} LIBPERL=libperl.so.${PERL_VER} + # Define the want perl first if defined .if ${USE_PERL5:M5*} want_perl_sign= ${USE_PERL5:M5*:C|^[0-9.]+||} Index: lang/perl5.14/Makefile =================================================================== --- lang/perl5.14/Makefile +++ lang/perl5.14/Makefile @@ -209,12 +209,18 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VER} ${WRKSRC}/libperl.so + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -230,8 +236,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.14/files/patch-Makefile.SH =================================================================== --- lang/perl5.14/files/patch-Makefile.SH +++ lang/perl5.14/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ -shared -L/usr/local/lib -fstack-protector -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.16/Makefile =================================================================== --- lang/perl5.16/Makefile +++ lang/perl5.16/Makefile @@ -209,12 +209,18 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VER} ${WRKSRC}/libperl.so + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -230,8 +236,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.16/files/patch-Makefile.SH =================================================================== --- lang/perl5.16/files/patch-Makefile.SH +++ lang/perl5.16/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ -shared -L/usr/local/lib -fstack-protector -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.18/Makefile =================================================================== --- lang/perl5.18/Makefile +++ lang/perl5.18/Makefile @@ -187,12 +187,18 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VER} ${WRKSRC}/libperl.so + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -208,8 +214,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${FIND} ${STAGEDIR} -name '*.bs' -size 0 -delete Index: lang/perl5.18/files/patch-Makefile.SH =================================================================== --- lang/perl5.18/files/patch-Makefile.SH +++ lang/perl5.18/files/patch-Makefile.SH @@ -1,11 +1,11 @@ --- Makefile.SH.orig 2014-10-01 15:23:34 UTC +++ Makefile.SH -@@ -805,7 +808,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI +@@ -805,7 +805,7 @@ $(LIBPERL): $& $(obj) $(DYNALOADER) $(LI true) $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ -shared -L/usr/local/lib -fstack-protector -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix) Index: lang/perl5.20/Makefile =================================================================== --- lang/perl5.20/Makefile +++ lang/perl5.20/Makefile @@ -184,12 +184,18 @@ BSDPAN_VERSION= 20111107 BSDPAN_WRKSRC= ${WRKDIR}/BSDPAN-${BSDPAN_VERSION} +# Put a symlink to the future libperl.so.x.yy so that -lperl works. +post-extract: + ${LN} -s libperl.so.${PERL_VER} ${WRKSRC}/libperl.so + post-patch: ${SED} -i '' -e 's|%%PERL_PKGNAME%%|${PKGNAME}|g; s|%%PERL_VER%%|${PERL_VER}|g;' \ -e 's!%%BSDPAN_VERSION%%!${BSDPAN_VERSION}!g;' \ ${BSDPAN_WRKSRC}/ExtUtils/*.pm ${REINPLACE_CMD} -e 's|/usr/local|${LOCALBASE}|g' \ ${WRKSRC}/Configure ${WRKSRC}/hints/freebsd.sh + ${REINPLACE_CMD} -e 's|lddlflags="-shared "|lddlflags="-shared -L${WRKSRC} -L${PREFIX}/${_ARCH_LIB}/CORE -Wl,-rpath=${PREFIX}/${_ARCH_LIB}/CORE -lperl "|' \ + ${WRKSRC}/hints/freebsd.sh .if ${PORT_OPTIONS:MPTHREAD} ${REINPLACE_CMD} -e 's|%%PTHREAD_LIBS%%|${PTHREAD_LIBS}|g;' \ -e 's|%%PTHREAD_CFLAGS%%|${PTHREAD_CFLAGS}|g;' \ @@ -205,8 +211,8 @@ ${MKDIR} ${STAGEDIR}${SITE_ARCH}/auto ${MKDIR} ${STAGEDIR}${SITE_PERL}/auto ${LN} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${STAGEDIR}${PREFIX}/bin/perl5 - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so - ${LN} -s libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so + ${LN} -sf libperl.so.${PERL_VER} ${STAGEDIR}${PREFIX}/${_ARCH_LIB}/CORE/libperl.so.${PERL_VERSION} ${STRIP_CMD} ${STAGEDIR}${PREFIX}/bin/perl${PERL_VERSION} ${INSTALL_DATA} ${WRKDIR}/perl5_version ${STAGEDIR}${PREFIX}/etc ${MKDIR} ${STAGEDIR}${SITE_ARCH}/machine Index: lang/perl5.20/files/patch-Makefile.SH =================================================================== --- lang/perl5.20/files/patch-Makefile.SH +++ lang/perl5.20/files/patch-Makefile.SH @@ -5,7 +5,7 @@ $spitshell >>$Makefile <<'!NO!SUBS!' rm -f $@ - $(LD) -o $@ $(SHRPLDFLAGS) $(obj) $(DYNALOADER) $(libs) -+ $(LD) -o $@ $(SHRPLDFLAGS) -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) ++ $(LD) -o $@ -shared -L/usr/local/lib -fstack-protector -Wl,-soname,$(LIBPERL) $(obj) $(DYNALOADER) $(libs) !NO!SUBS! case "$osname" in aix)