public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Iain Sandoe <developer@sandoe-acoustics.co.uk>
To: GCC Patches <gcc-patches@gcc.gnu.org>
Cc: Arnaud Charlet <charlet@adacore.com>, Mike Stump <mrs@gcc.gnu.org>
Subject: [Patch, Ada, Darwin] Remove use of "flat_namespace" linker flag.
Date: Wed, 07 Sep 2011 08:13:00 -0000	[thread overview]
Message-ID: <F37ADD6C-CFB3-4A3D-98E6-8E390F65AB90@sandoe-acoustics.co.uk> (raw)

[-- Attachment #1: Type: text/plain, Size: 1385 bytes --]

The "-flat_namespace" linker flag defeats one of Darwin's nicer  
features (two-level library namespaces).

AFAIU, it was habitually applied to unix projects in the early  
versions of darwin to cater for assumptions about library ordering  
made in such projects.

However, it is rarely needed these days (perhaps in the case of  
imported unix projects using plugins sometimes).

It also upsets our careful use of an extension library to provide  
current GCC facilities to Darwin 8...11 (which relies on the two-level  
namespace to use both the system and GCC versions of libgcc_s) ...  
and, in particular, this can cause subtle and difficult to diagnose  
differences of behavior between darwin 9 and later systems.

---

Perhaps I'm missing something (please enlighten me if so), but I can't  
presently see any reason why this needs to be applied to the Ada  
_build_ ...
... and IMHO it's likely to cause end user issues defaulting to it for  
shared library Ada make projects.
(better that the User should explicitly issue the flag where it is  
required)

So is the following OK for trunk?
(no Ada regressions on *-darwin9, x86_64-darwin10).

cheers
Iain

ada:

	* gcc-interface/Makefile.in (darwin): Do not issue the
	'-flat_namespace'  linker flag during Ada build.
	 * mlib-tgt-specific-darwin.adb: Remove 'flat_namespace' flag from
	the default shared library options.


[-- Attachment #2: 178615-ada-flat-namespace-diff.txt --]
[-- Type: text/plain, Size: 1377 bytes --]

Index: gcc/ada/mlib-tgt-specific-darwin.adb
===================================================================
--- gcc/ada/mlib-tgt-specific-darwin.adb	(revision 178615)
+++ gcc/ada/mlib-tgt-specific-darwin.adb	(working copy)
@@ -57,15 +57,10 @@ package body MLib.Tgt.Specific is
 
    --  Local objects
 
-   Flat_Namespace : aliased String := "-Wl,-flat_namespace";
-   --  Instruct the linker to build the shared library as a flat
-   --  namespace image. The default is a two-level namespace image.
-
    Shared_Libgcc  : aliased String := "-shared-libgcc";
 
    Shared_Options : constant Argument_List :=
-                      (1 => Flat_Namespace'Access,
-                       2 => Shared_Libgcc'Access);
+                      (1 => Shared_Libgcc'Access);
 
    -----------------------------
    -- Archive_Indexer_Options --
Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 178615)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -2164,7 +2164,7 @@ ifeq ($(strip $(filter-out %x86_64 linux%,$(arch)
 endif
 
 ifeq ($(strip $(filter-out darwin%,$(osys))),)
-  SO_OPTS = -Wl,-flat_namespace -shared-libgcc
+  SO_OPTS = -shared-libgcc
   ifeq ($(strip $(filter-out %86,$(arch))),)
     LIBGNAT_TARGET_PAIRS = \
     a-intnam.ads<a-intnam-darwin.ads \

[-- Attachment #3: Type: text/plain, Size: 3 bytes --]





             reply	other threads:[~2011-09-07  8:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-07  8:13 Iain Sandoe [this message]
2011-09-07 17:05 ` Mike Stump
2011-09-07 18:01   ` Arnaud Charlet
2011-09-14  8:51 ` Arnaud Charlet

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F37ADD6C-CFB3-4A3D-98E6-8E390F65AB90@sandoe-acoustics.co.uk \
    --to=developer@sandoe-acoustics.co.uk \
    --cc=charlet@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mrs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).