Patchwork -export-dynamic backwards compatibility (PR 47390)

login
register
mail settings
Submitter Joseph S. Myers
Date Feb. 17, 2011, 6:35 p.m.
Message ID <Pine.LNX.4.64.1102171835380.31965@digraph.polyomino.org.uk>
Download mbox | patch
Permalink /patch/83466/
State New
Headers show

Comments

Joseph S. Myers - Feb. 17, 2011, 6:35 p.m.
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  <joseph@codesourcery.com>

	PR driver/47390
	* common.opt (export-dynamic): New Driver option.
	* gcc.c (LINK_COMMAND_SPEC): Add comment about %{e*}.

Patch

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