commit:     e46b5ca5b49028528245dec068bee7e9b8a22878
Author:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
AuthorDate: Mon Mar 13 16:54:29 2017 +0000
Commit:     Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
CommitDate: Mon Mar 13 17:11:05 2017 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e46b5ca5

ELT-patches/aixrtl: fix exclude_expsyms for C++ exceptions

On AIX, GNU g++ generates _GLOBAL__* symbols as, amongst others, landing
pads for C++ exceptions.  These symbols must not be exported from shared
libraries, or exception handling may break for applications with runtime
linking enabled.

 eclass/ELT-patches/aixrtl/1.5.0-expsym-c   |  4 +++-
 eclass/ELT-patches/aixrtl/1.5.0-expsym-cxx |  4 +++-
 eclass/ELT-patches/aixrtl/2.2.0-expsym-c   |  4 +++-
 eclass/ELT-patches/aixrtl/2.2.0-expsym-cxx |  4 +++-
 eclass/ELT-patches/aixrtl/2.4.0-expsym-c   |  4 +++-
 eclass/ELT-patches/aixrtl/2.4.0-expsym-cxx |  4 +++-
 eclass/ELT-patches/aixrtl/2.4.4-expsym-c   | 21 +++++++++++++++++++++
 eclass/ELT-patches/aixrtl/2.4.4-expsym-cxx | 21 +++++++++++++++++++++
 8 files changed, 60 insertions(+), 6 deletions(-)

diff --git a/eclass/ELT-patches/aixrtl/1.5.0-expsym-c 
b/eclass/ELT-patches/aixrtl/1.5.0-expsym-c
index 2b54887d8fc..13419b205da 100644
--- a/eclass/ELT-patches/aixrtl/1.5.0-expsym-c
+++ b/eclass/ELT-patches/aixrtl/1.5.0-expsym-c
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -7113,9 +7113,9 @@
+@@ -7113,9 +7113,11 @@
        # If we're using GNU nm, then we don't want the "-C" option.
        # -C means demangle to AIX nm, but means don't demangle with GNU nm
        if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 -        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { 
print \$3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        else
 -        export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { 
print \$3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        fi
        aix_use_runtimelinking=no
  

diff --git a/eclass/ELT-patches/aixrtl/1.5.0-expsym-cxx 
b/eclass/ELT-patches/aixrtl/1.5.0-expsym-cxx
index 9b6bdc2f952..561bc54d76c 100644
--- a/eclass/ELT-patches/aixrtl/1.5.0-expsym-cxx
+++ b/eclass/ELT-patches/aixrtl/1.5.0-expsym-cxx
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -11217,9 +11217,9 @@
+@@ -11217,9 +11217,11 @@
      # If we're using GNU nm, then we don't want the "-C" option.
      # -C means demangle to AIX nm, but means don't demangle with GNU nm
      if $NM -V 2>&1 | grep 'GNU' > /dev/null; then
 -      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { 
print \$3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      else
 -      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$2 == "T") || (\$2 == "D") || (\$2 == "B")) && (substr(\$3,1,1) != ".")) { 
print \$3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      fi
      ;;
    pw32*)

diff --git a/eclass/ELT-patches/aixrtl/2.2.0-expsym-c 
b/eclass/ELT-patches/aixrtl/2.2.0-expsym-c
index 196a5a36e60..c74cee20c12 100644
--- a/eclass/ELT-patches/aixrtl/2.2.0-expsym-c
+++ b/eclass/ELT-patches/aixrtl/2.2.0-expsym-c
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -8475,9 +8475,9 @@
+@@ -8475,9 +8475,11 @@
        # If we're using GNU nm, then we don't want the "-C" option.
        # -C means demangle to AIX nm, but means don't demangle with GNU nm
        if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
 -        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        else
 -        export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        fi
        aix_use_runtimelinking=no
  

diff --git a/eclass/ELT-patches/aixrtl/2.2.0-expsym-cxx 
b/eclass/ELT-patches/aixrtl/2.2.0-expsym-cxx
index ee4d163989d..1b7e9b8ee0a 100644
--- a/eclass/ELT-patches/aixrtl/2.2.0-expsym-cxx
+++ b/eclass/ELT-patches/aixrtl/2.2.0-expsym-cxx
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -15506,9 +15506,9 @@
+@@ -15506,9 +15506,11 @@
      # If we're using GNU nm, then we don't want the "-C" option.
      # -C means demangle to AIX nm, but means don't demangle with GNU nm
      if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
 -      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      else
 -      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      fi
      ;;
    pw32*)

diff --git a/eclass/ELT-patches/aixrtl/2.4.0-expsym-c 
b/eclass/ELT-patches/aixrtl/2.4.0-expsym-c
index 6860317739a..1538a6225dc 100644
--- a/eclass/ELT-patches/aixrtl/2.4.0-expsym-c
+++ b/eclass/ELT-patches/aixrtl/2.4.0-expsym-c
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -9660,9 +9660,9 @@
+@@ -9660,9 +9660,11 @@
        # Also, AIX nm treats weak defined symbols like other global
        # defined symbols, whereas GNU nm marks them as "W".
        if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
 -        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        else
 -        export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +        export_symbols_cmds='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++        exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
        fi
        aix_use_runtimelinking=no
  

diff --git a/eclass/ELT-patches/aixrtl/2.4.0-expsym-cxx 
b/eclass/ELT-patches/aixrtl/2.4.0-expsym-cxx
index ca9fd97be52..1fba0b9405e 100644
--- a/eclass/ELT-patches/aixrtl/2.4.0-expsym-cxx
+++ b/eclass/ELT-patches/aixrtl/2.4.0-expsym-cxx
@@ -1,14 +1,16 @@
 --- configure
 +++ configure
-@@ -15711,9 +15711,9 @@
+@@ -15711,9 +15711,11 @@
      # Also, AIX nm treats weak defined symbols like other global defined
      # symbols, whereas GNU nm marks them as "W".
      if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
 -      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='$NM -Bpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && 
(substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { 
print \$ 3 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      else
 -      export_symbols_cmds_CXX='$NM -BCpg $libobjs $convenience | awk '\''{ if 
(((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != 
".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
 +      export_symbols_cmds_CXX='`echo $NM | sed -e '\''s/B\([^B]*\)$/P\1/'\''` 
-PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || 
(\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 
1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print 
\$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
++      exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
      fi
      ;;
    pw32*)

diff --git a/eclass/ELT-patches/aixrtl/2.4.4-expsym-c 
b/eclass/ELT-patches/aixrtl/2.4.4-expsym-c
new file mode 100644
index 00000000000..f79c0f6b7ce
--- /dev/null
+++ b/eclass/ELT-patches/aixrtl/2.4.4-expsym-c
@@ -0,0 +1,21 @@
+commit 2dfd834840a9de8ce3866af1cf8f3aff9b1a15e8
+Author: Michael Haubenwallner <michael.haubenwall...@ssi-schaefer.com>
+Date:   Wed Mar 2 15:06:48 2016 +0100
+
+    AIX: Stop exporting any _GLOBAL__ symbol.
+    
+    * m4/libtool.m4 (_LT_LINKER_SHLIBS): On AIX, GNU g++ generates
+    _GLOBAL__* symbols as, amongst others, landing pads for C++ exceptions.
+    These symbols must not be exported from shared libraries, or exception
+    handling may break for applications with runtime linking enabled.
+
+--- configure
++++ configure
+@@ -5446,6 +5447,7 @@ _LT_EOF
+       # symbols only, and the '-p' flag disables sorting to improve
+       # performance.  For the weak symbol handling see the CXX tag.
+       export_symbols_cmds='$NM -gp $libobjs $convenience | 
$global_symbol_pipe | $EGREP -v " ($exclude_expsyms)$" | awk '\''{ kw = "" } 
/^([[CVWZ]]|[[BDLT]]\*) / { kw = " weak" } { print $ 3 kw }'\'' | sort -u > 
$export_symbols'
++      exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
+       aix_use_runtimelinking=no
+ 
+       # Test if we are trying to use run time linking or normal

diff --git a/eclass/ELT-patches/aixrtl/2.4.4-expsym-cxx 
b/eclass/ELT-patches/aixrtl/2.4.4-expsym-cxx
new file mode 100644
index 00000000000..abb41e6d25b
--- /dev/null
+++ b/eclass/ELT-patches/aixrtl/2.4.4-expsym-cxx
@@ -0,0 +1,21 @@
+commit 2dfd834840a9de8ce3866af1cf8f3aff9b1a15e8
+Author: Michael Haubenwallner <michael.haubenwall...@ssi-schaefer.com>
+Date:   Wed Mar 2 15:06:48 2016 +0100
+
+    AIX: Stop exporting any _GLOBAL__ symbol.
+    
+    * m4/libtool.m4 (_LT_LINKER_SHLIBS): On AIX, GNU g++ generates
+    _GLOBAL__* symbols as, amongst others, landing pads for C++ exceptions.
+    These symbols must not be exported from shared libraries, or exception
+    handling may break for applications with runtime linking enabled.
+
+--- configure
++++ configure
+@@ -5000,6 +5000,7 @@ m4_if([$1], [CXX], [
+     # '[[BDLT]]*' with AIX nm in default mode (POSIX like)
+     # '[[CVW]]'   with GNU nm in either BSD or POSIX mode
+     export_symbols_cmds_CXX='$NM -gp $libobjs $convenience | 
$global_symbol_pipe | $EGREP -v " ($exclude_expsyms)$" | awk '\''{ kw = "" } 
/^([[CVWZ]]|[[BDLT]]\*) / { kw = " weak" } { print $ 3 kw }'\'' | sort -u > 
$export_symbols'
++    exclude_expsyms_CXX='_GLOBAL_OFFSET_TABLE_|_GLOBAL__.*'
+     ;;
+   pw32*)
+     export_symbols_cmds_CXX=$ltdll_cmds

Reply via email to