tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: libtool, -fstack-protector, -nostdlib, and while we're at it -Bdirect on SunOS



As requested by jperkin@, I'm posting here the attached patch to complete this libtool update.

Concerning manual-libtool.m4 and patch-ab, I had omitted removing '$predep_objects' and '$postdep_objects' in my initial patch removing '-nostdlib'...
these were there only for the '-nostdlib' case and cause the following :
ld: warning: file /usr/lib/crti.o: attempted multiple inclusion of file
ld: warning: file 
/opt/local/gcc47/lib/gcc/i386-sun-solaris2.11/4.7.3/crtbegin.o: attempted 
multiple inclusion of file
> ..
ld: warning: file /opt/local/gcc47/lib/gcc/i386-sun-solaris2.11/4.7.3/crtend.o: 
attempted multiple inclusion of file
ld: warning: file /usr/lib/crtn.o: attempted multiple inclusion of file

Thus updated, the g++ case becomes more or less the same as the gcc case as can be seen with the following command (gcc comes first):
richard@devzone:~/src/pkgsrc/devel/libtool$ ggrep -m2 -A2 '^archive_cmd' 
/opt/local/bin/libtool
archive_cmds="\$CC -shared \$pic_flag \${wl}-z \${wl}text \${wl}-h \${wl}\$soname -o 
\$lib \$libobjs \$deplibs \$compiler_flags"
archive_expsym_cmds="echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | \$SED -e 
\\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~echo \\\"local: *; };\\\" >> \$lib.exp~
          \$CC -shared \$pic_flag \${wl}-z \${wl}text \${wl}-M \${wl}\$lib.exp 
\${wl}-h \${wl}\$soname -o \$lib \$libobjs \$deplibs \$compiler_flags~\$RM 
\$lib.exp"
--
archive_cmds="\$CC -shared \$pic_flag \$libobjs \$deplibs \$compiler_flags \${wl}-h 
\$wl\$soname -o \$lib"
archive_expsym_cmds="echo \\\"{ global:\\\" > \$lib.exp~cat \$export_symbols | \$SED -e 
\\\"s/\\\\(.*\\\\)/\\\\1;/\\\" >> \$lib.exp~echo \\\"local: *; };\\\" >> \$lib.exp~
                \$CC -shared \$pic_flag \${wl}-M \$wl\$lib.exp \$wl-h \$wl\$soname 
-o \$lib \$libobjs \$deplibs \$compiler_flags~\$RM \$lib.exp"

Notice the only real difference is that for gcc '-z text' is added.

For what it is worth, I also tried that in my test cases, and so far there is no issue...but I'm not specifically recommending it at the moment (perhaps someone sees the need).

patch-ac is the same as before, and for the case of passing '-fstack-protector*' through to linking is the driver for this patchset in the beginning. The second case of fixing the problem on SunOS with '-Bdirect' is also thrown in as before (cf references in patch).

Observations as to why the attached patchset should not be committed?

For information, my test case is simply graphviz, with the following options: gd gtk guile lua pangocairo perl rsvg tcl x11
has had these issues building libgv_perl.la.
commit e30267c9ac104f9024d18c96409ae99452b02bf8
Author: Richard PALO <richard%NetBSD.org@localhost>
Date:   Fri Jun 27 02:06:59 2014 +0000

    refix libtool

diff --git a/devel/libtool-base/Makefile b/devel/libtool-base/Makefile
index 76b2bf2..e0a0d5f 100644
--- a/devel/libtool-base/Makefile
+++ b/devel/libtool-base/Makefile
@@ -26,7 +26,7 @@
 .include "../../devel/libtool/Makefile.common"
 
 PKGNAME=       ${DISTNAME:S/-/-base-/}
-PKGREVISION=   7
+PKGREVISION=   8
 SVR4_PKGNAME=  ltoob
 
 COMMENT=       Generic shared library support script (the script itself)
diff --git a/devel/libtool/distinfo b/devel/libtool/distinfo
index 6c713d6..2449eeb 100644
--- a/devel/libtool/distinfo
+++ b/devel/libtool/distinfo
@@ -4,6 +4,6 @@ SHA1 (libtool-2.4.2.tar.gz) = 
22b71a8b5ce3ad86e1094e7285981cae10e6ff88
 RMD160 (libtool-2.4.2.tar.gz) = b7153f3f1e1c50d8c04787cafccd4e19af62ec7d
 Size (libtool-2.4.2.tar.gz) = 2632347 bytes
 SHA1 (patch-aa) = 8fa167bebf27b7bc3008edd61408a0aede6bdf69
-SHA1 (patch-ab) = ccb33a6e3075908ab7ecf56836349baec8ac85ca
-SHA1 (patch-ac) = 108989e3f1ee199fa8e8a9dc7331d360c586a800
+SHA1 (patch-ab) = f12b9f19c1e1a8905e1b3f66b9c1f55d8eae2ca4
+SHA1 (patch-ac) = b41459989ea1fbd906e48ac0a9948661b4a466ca
 SHA1 (patch-ad) = 48c3832e9205777832ef2a6334033ff6099be8a4
diff --git a/devel/libtool/patches/manual-libtool.m4 
b/devel/libtool/patches/manual-libtool.m4
index a3d7cb1..bd2f8c1 100644
--- a/devel/libtool/patches/manual-libtool.m4
+++ b/devel/libtool/patches/manual-libtool.m4
@@ -447,9 +447,9 @@ $NetBSD: manual-libtool.m4,v 1.41 2014/06/15 14:42:05 joerg 
Exp $
 -              # linking a shared library.
 -              output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 -            fi
-+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag 
$predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h 
$wl$soname -o $lib'
++            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs 
$deplibs $compiler_flags ${wl}-h $wl$soname -o $lib'
 +            _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > 
$lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: 
*; };" >> $lib.exp~
-+              $CC -shared $pic_flag ${wl}-M $wl$lib.exp $wl-h $wl$soname -o 
$lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM 
$lib.exp'
++              $CC -shared $pic_flag ${wl}-M $wl$lib.exp $wl-h $wl$soname -o 
$lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 +
 +            # Commands to make compiler produce verbose output that lists
 +            # what "hidden" libraries, object files and flags are used when
diff --git a/devel/libtool/patches/patch-ab b/devel/libtool/patches/patch-ab
index f40e42d..e4d3bc1 100644
--- a/devel/libtool/patches/patch-ab
+++ b/devel/libtool/patches/patch-ab
@@ -451,9 +451,9 @@ $NetBSD: patch-ab,v 1.81 2014/06/15 14:42:05 joerg Exp $
 -              # linking a shared library.
 -              output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 
2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
 -            fi
-+            archive_cmds_CXX='$CC -shared $pic_flag $predep_objects $libobjs 
$deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
++            archive_cmds_CXX='$CC -shared $pic_flag $libobjs $deplibs 
$compiler_flags ${wl}-h $wl$soname -o $lib'
 +            archive_expsym_cmds_CXX='echo "{ global:" > $lib.exp~cat 
$export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> 
$lib.exp~
-+              $CC -shared $pic_flag ${wl}-M $wl$lib.exp $wl-h $wl$soname -o 
$lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM 
$lib.exp'
++              $CC -shared $pic_flag ${wl}-M $wl$lib.exp $wl-h $wl$soname -o 
$lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
 +
 +            # Commands to make compiler produce verbose output that lists
 +            # what "hidden" libraries, object files and flags are used when
diff --git a/devel/libtool/patches/patch-ac b/devel/libtool/patches/patch-ac
index 3950750..2111649 100644
--- a/devel/libtool/patches/patch-ac
+++ b/devel/libtool/patches/patch-ac
@@ -1,6 +1,12 @@
 $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
 
---- libltdl/config/ltmain.sh.orig      Mon Oct 17 10:19:11 2011
+Add passthrough support for -fstack-protector*
+http://permalink.gmane.org/gmane.comp.gnu.libtool.bugs/7341
+
+Disable the opt_duplicate_compiler_generated_deps optimisation
+for solaris2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+
+--- libltdl/config/ltmain.sh.orig      2011-10-17 10:19:35.000000000 +0000
 +++ libltdl/config/ltmain.sh
 @@ -133,8 +133,9 @@ $lt_unset CDPATH
  # function.
@@ -14,7 +20,34 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
  : ${CP="cp -f"}
  test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
  : ${MAKE="make"}
-@@ -7391,6 +7392,7 @@ func_mode_link ()
+@@ -1180,7 +1181,9 @@ func_enable_tag "$optarg"
+   test "$opt_debug" = : || func_append preserve_args " --debug"
+ 
+   case $host in
+-    *cygwin* | *mingw* | *pw32* | *cegcc*)
++    # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=1645
++    # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
++    *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2*)
+       # don't eliminate duplications in $postdeps and $predeps
+       opt_duplicate_compiler_generated_deps=:
+       ;;
+@@ -5847,13 +5850,14 @@ func_mode_link ()
+       # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+       # -F/path              path to uninstalled frameworks, gcc on darwin
+       # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
++      # -fstack-protector*   stack protector flags for GCC
+       # @file                GCC response files
+       # -tp=*                Portland pgcc target processor selection
+       # --sysroot=*          for sysroot support
+       # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+       -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+       
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+-      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
++      -O*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*)
+         func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+         func_append compile_command " $arg"
+@@ -7391,6 +7395,7 @@ func_mode_link ()
        # Calculate the version variables.
        major=
        versuffix=
@@ -22,7 +55,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
        verstring=
        case $version_type in
        none) ;;
-@@ -7451,6 +7453,7 @@ func_mode_link ()
+@@ -7451,6 +7456,7 @@ func_mode_link ()
          func_arith $current - $age
          major=.$func_arith_result
          versuffix="$major.$age.$revision"
@@ -30,7 +63,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
          ;;
  
        osf)
-@@ -7511,8 +7514,10 @@ func_mode_link ()
+@@ -7511,8 +7517,10 @@ func_mode_link ()
          esac
          if test "$need_version" = no; then
            versuffix=
@@ -41,7 +74,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
          fi
        fi
  
-@@ -7520,6 +7525,7 @@ func_mode_link ()
+@@ -7520,6 +7528,7 @@ func_mode_link ()
        if test "$avoid_version" = yes && test "$need_version" = no; then
          major=
          versuffix=
@@ -49,7 +82,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
          verstring=""
        fi
  
-@@ -7630,7 +7636,7 @@ func_mode_link ()
+@@ -7630,7 +7639,7 @@ func_mode_link ()
          *-*-netbsd*)
            # Don't link with libc until the a.out ld.so is fixed.
            ;;
@@ -58,7 +91,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
            # Do not include libc due to us having libc/libc_r.
            ;;
          *-*-sco3.2v5* | *-*-sco5v6*)
-@@ -7653,6 +7659,7 @@ func_mode_link ()
+@@ -7653,12 +7662,14 @@ func_mode_link ()
        libname_save=$libname
        release_save=$release
        versuffix_save=$versuffix
@@ -66,7 +99,6 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
        major_save=$major
        # I'm not sure if I'm treating the release correctly.  I think
        # release should show up in the -l (ie -lgmp5) so we don't want to
-@@ -7659,6 +7666,7 @@ func_mode_link ()
        # add it in twice.  Is that correct?
        release=""
        versuffix=""
@@ -74,7 +106,7 @@ $NetBSD: patch-ac,v 1.31 2014/05/10 15:32:08 joerg Exp $
        major=""
        newdeplibs=
        droppeddeps=no
-@@ -7935,6 +7943,7 @@ EOF
+@@ -7935,6 +7946,7 @@ EOF
          ;;
        esac
        versuffix=$versuffix_save


Home | Main Index | Thread Index | Old Index