aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorVincent Celier <celier@adacore.com>2005-03-18 12:53:34 +0100
committerArnaud Charlet <charlet@gcc.gnu.org>2005-03-18 12:53:34 +0100
commit3bc7ffd0c0e182a5b212b572a5804bacc1440b37 (patch)
tree60c9958423888b756fd045154772991955e8d9bf /gcc/ada
parentce65449a3562d260d3153d5345076bab06761df5 (diff)
downloadgcc-3bc7ffd0c0e182a5b212b572a5804bacc1440b37.zip
gcc-3bc7ffd0c0e182a5b212b572a5804bacc1440b37.tar.gz
gcc-3bc7ffd0c0e182a5b212b572a5804bacc1440b37.tar.bz2
mlib-tgt-darwin.adb (Build_Dynamic_Library): Remove the "-fini" switch, not supported by the linker on Darwin.
2005-03-17 Vincent Celier <celier@adacore.com> Nicolas Setton <setton@adacore.com> * mlib-tgt-darwin.adb (Build_Dynamic_Library): Remove the "-fini" switch, not supported by the linker on Darwin. Add '_' before <library>init, as this character is added unconditionally by the compiler. (Is_Archive_Ext): Replace the wrong library extension ".dyld" by the correct one ".dylib". This fixes detection of the archive files when building library projects. From-SVN: r96676
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/mlib-tgt-darwin.adb23
1 files changed, 12 insertions, 11 deletions
diff --git a/gcc/ada/mlib-tgt-darwin.adb b/gcc/ada/mlib-tgt-darwin.adb
index 1b168a9..0468fbd 100644
--- a/gcc/ada/mlib-tgt-darwin.adb
+++ b/gcc/ada/mlib-tgt-darwin.adb
@@ -7,7 +7,7 @@
-- --
-- B o d y --
-- --
--- Copyright (C) 2001-2004, Free Software Foundation, Inc. --
+-- Copyright (C) 2001-2005, Free Software Foundation, Inc. --
-- --
-- GNAT is free software; you can redistribute it and/or modify it under --
-- terms of the GNU General Public License as published by the Free Soft- --
@@ -48,15 +48,13 @@ package body MLib.Tgt is
Wl_Init_String : aliased String := "-Wl,-init";
Wl_Init : constant String_Access := Wl_Init_String'Access;
- Wl_Fini_String : aliased String := "-Wl,-fini";
- Wl_Fini : constant String_Access := Wl_Fini_String'Access;
Init_Fini_List : constant Argument_List_Access :=
new Argument_List'(1 => Wl_Init,
- 2 => null,
- 3 => Wl_Fini,
- 4 => null);
- -- Used to put switches for automatic elaboration/finalization
+ 2 => null);
+ -- Used to put switches for automatic elaboration. Note that there is no
+ -- linking option on Darwin for automatic finalization of a shared
+ -- library.
---------------------
-- Archive_Builder --
@@ -145,8 +143,7 @@ package body MLib.Tgt is
if Auto_Init then
Init_Fini := Init_Fini_List;
- Init_Fini (2) := new String'("-Wl," & Lib_Filename & "init");
- Init_Fini (4) := new String'("-Wl," & Lib_Filename & "final");
+ Init_Fini (2) := new String'("-Wl,_" & Lib_Filename & "init");
end if;
if Lib_Version = "" then
@@ -158,7 +155,11 @@ package body MLib.Tgt is
Options_2 => Options_2);
else
- Version_Arg := new String'("-Wl,-flat_namespace"); -- ???
+ -- Instruct the linker to build the shared library as a flat
+ -- namespace image, which is not the default. The default is a two
+ -- level namespace image.
+
+ Version_Arg := new String'("-Wl,-flat_namespace");
if Is_Absolute_Path (Lib_Version) then
Utl.Gcc
@@ -250,7 +251,7 @@ package body MLib.Tgt is
function Is_Archive_Ext (Ext : String) return Boolean is
begin
- return Ext = ".a" or else Ext = ".dyld";
+ return Ext = ".dylib" or else Ext = ".a";
end Is_Archive_Ext;
-------------