aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/gnatlink.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 11:42:53 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-20 11:42:53 +0200
commit40417de8ab869572f58b96b987ad4fca4f0cd783 (patch)
treef4993289c7ca70623107b4a58f83baac6c5e986d /gcc/ada/gnatlink.adb
parentb8a1821614cbf7e5c117bf0a7a215e3c3a81f8c3 (diff)
downloadgcc-40417de8ab869572f58b96b987ad4fca4f0cd783.zip
gcc-40417de8ab869572f58b96b987ad4fca4f0cd783.tar.gz
gcc-40417de8ab869572f58b96b987ad4fca4f0cd783.tar.bz2
[multiple changes]
2015-10-20 Vincent Celier <celier@adacore.com> * prj-attr.adb: Add package Codepeer and its attributes. 2015-10-20 Thomas Quinot <quinot@adacore.com> * sem_ch3.adb, sem_ch13.adb: Minor reformatting. 2015-10-20 Eric Botcazou <ebotcazou@adacore.com> * gnatlink.adb (Gnatlink): Do not translate --RTS switch for the linker and instead pass the switches that were reinstated by the compiler. 2015-10-20 Bob Duff <duff@adacore.com> * a-contai.ads, a-convec.ads: Move Count_Type_Last from a-convec.ads to a-contai.ads, so other containers can refer to it. From-SVN: r229027
Diffstat (limited to 'gcc/ada/gnatlink.adb')
-rw-r--r--gcc/ada/gnatlink.adb49
1 files changed, 26 insertions, 23 deletions
diff --git a/gcc/ada/gnatlink.adb b/gcc/ada/gnatlink.adb
index e94cae9..f50c946 100644
--- a/gcc/ada/gnatlink.adb
+++ b/gcc/ada/gnatlink.adb
@@ -1539,8 +1539,7 @@ begin
loop
-- Do not compile with the front end switches. However, --RTS
-- is to be dealt with specially because it needs to be passed
- -- if the binder-generated file is in Ada and may also be used
- -- to drive the linker.
+ -- to compile the file generated by the binder.
declare
Arg : String_Ptr renames Args.Table (Index);
@@ -1550,6 +1549,31 @@ begin
Binder_Options_From_ALI.Table
(Binder_Options_From_ALI.Last) := String_Access (Arg);
+ -- GNAT doesn't support GCC's multilib mechanism when it
+ -- is configured with --disable-libada. This means that,
+ -- when a multilib switch is used to request a particular
+ -- compilation mode, the corresponding --RTS switch must
+ -- also be specified. It is convenient to eliminate the
+ -- redundancy by keying the compilation mode on a single
+ -- switch, namely --RTS, and have the compiler reinstate
+ -- the multilib switch (see gcc-interface/lang-specs.h).
+ -- This switch must be passed to the driver at link time.
+
+ if Arg'Length = 5
+ and then Arg (Arg'First + 1 .. Arg'First + 4) = "mrtp"
+ then
+ Linker_Options.Increment_Last;
+ Linker_Options.Table
+ (Linker_Options.Last) := String_Access (Arg);
+
+ elsif Arg'Length = 6
+ and then Arg (Arg'First + 1 .. Arg'First + 5) = "fsjlj"
+ then
+ Linker_Options.Increment_Last;
+ Linker_Options.Table
+ (Linker_Options.Last) := String_Access (Arg);
+ end if;
+
elsif Arg'Length > 5
and then Arg (Arg'First + 2 .. Arg'First + 5) = "RTS="
then
@@ -1568,27 +1592,6 @@ begin
Opt.RTS_Lib_Path_Name :=
Get_RTS_Search_Dir
(Arg (Arg'First + 6 .. Arg'Last), Objects);
-
- -- GNAT doesn't support the GCC multilib mechanism.
- -- This means that, when a multilib switch is used
- -- to request a particular compilation mode, the
- -- corresponding runtime switch (--RTS) must also be
- -- specified. The long-term goal is to fully support the
- -- multilib mechanism; however, in the meantime, it is
- -- convenient to eliminate the redundancy by keying the
- -- compilation mode on a single switch, namely --RTS.
-
- -- Pass -mrtp to the linker if --RTS=rtp was passed
-
- if Arg'Length > 8
- and then
- (Arg (Arg'First + 6 .. Arg'First + 8) = "rtp"
- or else Arg (Arg'Last - 2 .. Arg'Last) = "rtp")
- then
- Linker_Options.Increment_Last;
- Linker_Options.Table (Linker_Options.Last) :=
- new String'("-mrtp");
- end if;
end if;
end;
end loop;