Patchwork -export-dynamic backwards compatibility (PR 47390)

mail settings
Submitter Joseph S. Myers
Date Feb. 17, 2011, 6:35 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/83466/
State New
Headers show


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

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

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.  */
Index: gcc/common.opt
--- gcc/common.opt	(revision 170247)
+++ gcc/common.opt	(working copy)
@@ -712,6 +712,13 @@  Driver
 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.
+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