summaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorguerby <guerby@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-07 09:00:51 +0000
committerguerby <guerby@138bc75d-0d04-0410-961f-82ee72b054a4>2009-09-07 09:00:51 +0000
commitc8bc1b1e6547fdb332fb59e66b5dc399673dfd7a (patch)
treee5a8d6a2f5fb450b8f58fec44c5449fbd9b134cd /gcc/ada
parent5a374a69fa8dd8a53aa456149e75f0c55d02e0c0 (diff)
downloadgcc-c8bc1b1e6547fdb332fb59e66b5dc399673dfd7a.tar.gz
2009-09-07 Laurent GUERBY <laurent@guerby.net>
* make.adb: Add missing documentation for multilib handling. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151473 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog4
-rw-r--r--gcc/ada/make.adb23
2 files changed, 25 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9b92ce5f4df..14291ba2fd6 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,7 @@
+2009-09-07 Laurent GUERBY <laurent@guerby.net>
+
+ * make.adb: Add missing documentation for multilib handling.
+
2009-09-03 Diego Novillo <dnovillo@google.com>
* gcc-interface/misc.c (lang_hooks): Remove const qualifier.
diff --git a/gcc/ada/make.adb b/gcc/ada/make.adb
index 20fc989a015..b19aa22da71 100644
--- a/gcc/ada/make.adb
+++ b/gcc/ada/make.adb
@@ -7296,8 +7296,14 @@ package body Make is
begin
pragma Assert (N_M_Switch > 0 and RTS_Specified = null);
- -- This loop needs commenting ??? In fact this entire body is
- -- under-commented ??? And the spec is not much help :-(
+ -- In case we detected a multilib switch and the user has not
+ -- manually specified a specific RTS we emulate the following command:
+ -- gnatmake $FLAGS --RTS=$(gcc -print-multi-directory $FLAGS)
+
+ -- First select the flags which might have an impact on multilib
+ -- processing. Note that this is an heuristic selection and it
+ -- will need to be maintained over time. The condition has to
+ -- be kept synchronized with N_M_Switch counting in Scan_Make_Arg.
for Next_Arg in 1 .. Argument_Count loop
declare
@@ -7322,6 +7328,10 @@ package body Make is
Args (Args'Last) := new String'("-print-multi-directory");
+ -- Call the GCC driver with the collected flags and save its
+ -- output. Alternate design would be to link in gnatmake the
+ -- relevant part of the GCC driver.
+
if Saved_Gcc /= null then
Multilib_Gcc := Saved_Gcc;
else
@@ -7344,6 +7354,8 @@ package body Make is
return;
end if;
+ -- Parse the GCC driver output which is a single line, removing CR/LF
+
Output_FD := Open_Read (Output_Name.all, Binary);
if Output_FD = Invalid_FD then
@@ -7362,10 +7374,14 @@ package body Make is
end if;
end loop;
+ -- In case the standard RTS is selected do nothing
+
if N_Read = 0 or else Line (1 .. N_Read) = "." then
return;
end if;
+ -- Otherwise add -margs --RTS=output
+
Scan_Make_Arg ("-margs", And_Save => True);
Scan_Make_Arg ("--RTS=" & Line (1 .. N_Read), And_Save => True);
end Process_Multilib;
@@ -7845,6 +7861,9 @@ package body Make is
Add_Switch (Argv, Compiler, And_Save => And_Save);
Add_Switch (Argv, Linker, And_Save => And_Save);
+ -- The following condition has to be kept synchronized with
+ -- the Process_Multilib one.
+
if Argv (2) = 'm'
and then Argv /= "-mieee"
then