From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19360 invoked by alias); 7 Nov 2014 19:52:07 -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 19350 invoked by uid 89); 7 Nov 2014 19:52:06 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-vc0-f173.google.com Received: from mail-vc0-f173.google.com (HELO mail-vc0-f173.google.com) (209.85.220.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 07 Nov 2014 19:52:05 +0000 Received: by mail-vc0-f173.google.com with SMTP id le20so2183547vcb.18 for ; Fri, 07 Nov 2014 11:52:03 -0800 (PST) MIME-Version: 1.0 X-Received: by 10.220.30.10 with SMTP id s10mr1831038vcc.54.1415389923195; Fri, 07 Nov 2014 11:52:03 -0800 (PST) Received: by 10.220.73.193 with HTTP; Fri, 7 Nov 2014 11:52:03 -0800 (PST) Date: Fri, 07 Nov 2014 19:52:00 -0000 Message-ID: Subject: Re: [PATCH] AIX: Filename-based shared library versioning for libgcc_s From: David Edelsohn To: Michael Haubenwallner Cc: GCC Patches Content-Type: text/plain; charset=ISO-8859-1 X-SW-Source: 2014-11/txt/msg00668.txt.bz2 First, please explicitly copy me on AIX or PowerPC patches sent to gcc-patches. I don't have a fundamental objection to including this option, but note that Richi, Honza and I have discovered that using AIX runtime linking option interacts badly with some GCC optimizations and can result in applications that hang in a loop. All code on AIX is position independent (PIC) by default. Executables and shared libraries essentially are PIE. Because of this, AIX does not provide separate "static" libraries and one can link statically with a shared library. Creating a library enabled for runtime linking with -G (-brtl), causes a lot of problems, including a newly recognized failure mode. Without careful control over AIX symbol export, all global calls with use glink code (equivalent to ELF PLTs). This also creates a TOC entry for every global call, possibly overflowing the TOC. But the main problem is GCC uses aliases and functions declared as weak to support some C++ features. Functions declared weak interact badly with shared libraries compiled for AIX runtime linking and linked statically. This can result in the static binary binding with the glink code that loads its own address from the TOC instead of the target function, causing endless looping. Honza made some changes to GCC code generation for AIX, but there still are problems and I have disabled building libstdc++ enabled for runtime linking. libgcc always explicitly creates a static library and uses it for static linking. All shared libraries for AIX that use this scheme (through libtool) would have to follow the same convention to create both shared and static libraries. This new option only makes sense if it fully emulates SVR4/ELF behavior and always creates both shared .so and static .a libraries. Thanks, David