File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ procedure GCC_Wrapper is
65
65
-- is a Clang instance that we expect to be on the PATH, like GNAT-LLVM C.
66
66
67
67
GCC : constant String := Command_Name;
68
- Args : Argument_List (1 .. Argument_Count + 1 );
68
+ Args : Argument_List (1 .. Argument_Count + 2 );
69
69
Arg_Count : Natural := 0 ;
70
70
Status : Boolean;
71
71
Last : Natural;
@@ -314,7 +314,7 @@ begin
314
314
null ;
315
315
316
316
elsif Arg = " -x" then
317
- if J < Args'Last then
317
+ if J < Argument_Count then
318
318
319
319
-- While we can use our embedded Clang ("llvm-helper") to
320
320
-- compile assembly code, we need to forward C and C++ code to
@@ -438,6 +438,14 @@ begin
438
438
return ;
439
439
end if ;
440
440
441
+ -- Tell Clang which target to compile or link for
442
+
443
+ if Compiler /= Ada_Frontend or else not Compile then
444
+ Args (Arg_Count + 1 ) := new String'(" -target" );
445
+ Args (Arg_Count + 2 ) := new String'(Default_Target_Triple);
446
+ Arg_Count := Arg_Count + 2 ;
447
+ end if ;
448
+
441
449
-- Compile c/c++ files with clang
442
450
443
451
if Compiler = Bundled_Clang or else Compiler = External_Clang then
You can’t perform that action at this time.
0 commit comments