From patchwork Thu Feb 17 18:35:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 83466 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 8C7A1B7126 for ; Fri, 18 Feb 2011 05:36:10 +1100 (EST) Received: (qmail 12914 invoked by alias); 17 Feb 2011 18:36:08 -0000 Received: (qmail 12702 invoked by uid 22791); 17 Feb 2011 18:36:07 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 17 Feb 2011 18:36:02 +0000 Received: (qmail 4921 invoked from network); 17 Feb 2011 18:36:00 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 17 Feb 2011 18:36:00 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1Pq8hr-0000Oe-Bl for gcc-patches@gcc.gnu.org; Thu, 17 Feb 2011 18:35:59 +0000 Date: Thu, 17 Feb 2011 18:35:59 +0000 (UTC) From: "Joseph S. Myers" To: gcc-patches@gcc.gnu.org Subject: -export-dynamic backwards compatibility (PR 47390) Message-ID: MIME-Version: 1.0 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org PR 47390 deals with a backwards-compatibility issue where "gcc -export-dynamic" would previously have passed -export-dynamic to the linker whereas now it's interpreted as a -e option and passed as "-e xport-dynamic". This patch implements backwards compatibility for this option. (No compatibility is added for use of the "--" form, since as discussed in PR46410 such options were actually ignored when linking so users need to decide whether they actually want to make the previously ignored option effective with -Wl, or remove it; quietly passing it down would not be backwards compatible.) Bootstrapped with no regressions on x86_64-unknown-linux-gnu and committed. 2011-02-17 Joseph Myers PR driver/47390 * common.opt (export-dynamic): New Driver option. * gcc.c (LINK_COMMAND_SPEC): Add comment about %{e*}. Index: gcc/gcc.c =================================================================== --- gcc/gcc.c (revision 170247) +++ gcc/gcc.c (working copy) @@ -644,6 +644,7 @@ proper position among the other output f directories. */ /* We pass any -flto flags on to the linker, which is expected to understand them. In practice, this means it had better be collect2. */ +/* %{e*} includes -export-dynamic; see comment in common.opt. */ #ifndef LINK_COMMAND_SPEC #define LINK_COMMAND_SPEC "\ %{!fsyntax-only:%{!c:%{!M:%{!MM:%{!E:%{!S:\ Index: gcc/common.opt =================================================================== --- gcc/common.opt (revision 170247) +++ gcc/common.opt (working copy) @@ -712,6 +712,13 @@ Driver e Driver Joined Separate +; This option has historically been passed down to the linker by an +; accident of a %{e*} spec, so ensure it continues to be passed down +; as a single option. The supported option for this purpose is +; -rdynamic. See PR 47390. +export-dynamic +Driver Undocumented + ; The version of the C++ ABI in use. The following values are allowed: ; ; 0: The version of the ABI believed most conformant with the C++ ABI