From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 39762 invoked by alias); 27 Mar 2017 09:10:20 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 39736 invoked by uid 89); 27 Mar 2017 09:10:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.5 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=H*r:4.80.1, amongst, H*r:UNKNOWN, sk:michael X-HELO: smtp.salomon.at Received: from smtp.salomon.at (HELO smtp.salomon.at) (193.186.16.13) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 27 Mar 2017 09:10:16 +0000 Received: from samail03.wamas.com ([172.28.33.235] helo=mailhost.salomon.at) by smtp.salomon.at with esmtps (UNKNOWN:DHE-RSA-AES256-SHA:256) (Exim 4.80.1) (envelope-from ) id 1csQfF-00037j-4K for gcc-patches@gcc.gnu.org; Mon, 27 Mar 2017 11:10:13 +0200 Received: from [172.28.41.101] by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1csQfE-0004q1-Vg for gcc-patches@gcc.gnu.org; Mon, 27 Mar 2017 11:10:13 +0200 X-Mozilla-News-Host: news://news.gmane.org:119 To: GCC Patches From: Michael Haubenwallner Subject: [PATCH] Real fix for AIX exception handling Message-ID: <95a50354-a6bd-6c69-ef2b-1bcd91cd9a59@ssi-schaefer.com> Date: Mon, 27 Mar 2017 10:49:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------C6C1BCF575AF597B41A309BF" X-SW-Source: 2017-03/txt/msg01377.txt.bz2 This is a multi-part message in MIME format. --------------C6C1BCF575AF597B41A309BF Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 652 Hi, as far as I have discovered, the real problem with AIX exception handling is that the exception landing pads are symbols that must not (but still are) exported from shared libraries - even libstdc++. I'm wondering if attached libtool(!)-patch would fix even that GDB problem once applied to each(!) shared library creation procedure. However, each workaround still applies as long as there's a single shared library involved that has not stopped exporting these symbols yet. Thoughts? Maybe gcc's collect2 should apply this additional symbol filter itself when calling (AIX) ld, rather than leaving this to each build system? Thanks! /haubi/ --------------C6C1BCF575AF597B41A309BF Content-Type: text/x-patch; name="0001-AIX-Stop-exporting-more-_GLOBAL__-symbols.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="0001-AIX-Stop-exporting-more-_GLOBAL__-symbols.patch" Content-length: 2018 >From 32ca0e6f7bf8d096cc653ac455d66c270b75fdf0 Mon Sep 17 00:00:00 2001 From: Michael Haubenwallner Date: Wed, 2 Mar 2016 15:06:48 +0100 Subject: [PATCH 1/4] AIX: Stop exporting more _GLOBAL__ symbols. * 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. --- m4/libtool.m4 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/m4/libtool.m4 b/m4/libtool.m4 index ee292af..c2e996c 100644 --- a/m4/libtool.m4 +++ b/m4/libtool.m4 @@ -4943,6 +4943,7 @@ m4_if([$1], [CXX], [ else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 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' fi + _LT_TAGVAR(exclude_expsyms, $1)='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*|_GLOBAL__[FID]_.*' ;; pw32*) _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds @@ -5398,6 +5399,7 @@ _LT_EOF else _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "L") || (\$ 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' fi + _LT_TAGVAR(exclude_expsyms, $1)='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*|_GLOBAL__[FID]_.*' aix_use_runtimelinking=no # Test if we are trying to use run time linking or normal -- 2.10.2 --------------C6C1BCF575AF597B41A309BF--