diff mbox series

Ada: Fix s-oscons.ads generation

Message ID 20180307093456.1424-1-sebastian.huber@embedded-brains.de
State New
Headers show
Series Ada: Fix s-oscons.ads generation | expand

Commit Message

Sebastian Huber March 7, 2018, 9:34 a.m. UTC
The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).

We must call the C compiler with the right machine flags.  So, add
$(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a bi-arch
compiler supporting 32-bit and 64-bit instruction sets we pick otherwise
only one variant due to a missing -m32 or -m64 flag.

gcc/ada
	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
	$(GNATLIBCFLAGS).
	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
---
 gcc/ada/gcc-interface/Makefile.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Arnaud Charlet March 7, 2018, 10:33 a.m. UTC | #1
> The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).
> 
> We must call the C compiler with the right machine flags.  So, add
> $(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a bi-arch
> compiler supporting 32-bit and 64-bit instruction sets we pick otherwise
> only one variant due to a missing -m32 or -m64 flag.
> 
> gcc/ada
> 	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
> 	$(GNATLIBCFLAGS).
> 	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).

OK, thanks.

Arno
Sebastian Huber March 7, 2018, 12:12 p.m. UTC | #2
On 07/03/18 11:33, Arnaud Charlet wrote:
>> The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).
>>
>> We must call the C compiler with the right machine flags.  So, add
>> $(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a bi-arch
>> compiler supporting 32-bit and 64-bit instruction sets we pick otherwise
>> only one variant due to a missing -m32 or -m64 flag.
>>
>> gcc/ada
>> 	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
>> 	$(GNATLIBCFLAGS).
>> 	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
> OK, thanks.

Thanks for the quick review. I would like to back port this to GCC 7.
Arnaud Charlet March 7, 2018, 1:15 p.m. UTC | #3
> >>The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).
> >>
> >>We must call the C compiler with the right machine flags.  So, add
> >>$(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a
> >>bi-arch
> >>compiler supporting 32-bit and 64-bit instruction sets we pick
> >>otherwise
> >>only one variant due to a missing -m32 or -m64 flag.
> >>
> >>gcc/ada
> >>	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
> >>	$(GNATLIBCFLAGS).
> >>	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
> >OK, thanks.
> 
> Thanks for the quick review. I would like to back port this to GCC 7.

Seems fine to me if it doesn't cause troubles on trunk.

Arno
Sebastian Huber April 12, 2018, 11:10 a.m. UTC | #4
On 07/03/18 14:15, Arnaud Charlet wrote:
>>>> The $(GNATLIBCFLAGS) are already included in $(GNATLIBCFLAGS_FOR_C).
>>>>
>>>> We must call the C compiler with the right machine flags.  So, add
>>>> $(GNATLIBCFLAGS_FOR_C) to $(OSCONS_EXTRACT).  For example, on a
>>>> bi-arch
>>>> compiler supporting 32-bit and 64-bit instruction sets we pick
>>>> otherwise
>>>> only one variant due to a missing -m32 or -m64 flag.
>>>>
>>>> gcc/ada
>>>> 	* gcc-interface/Makefile.in (OSCONS_CPP): Remove redundant
>>>> 	$(GNATLIBCFLAGS).
>>>> 	(OSCONS_EXTRACT): Add $(GNATLIBCFLAGS_FOR_C).
>>> OK, thanks.
>> Thanks for the quick review. I would like to back port this to GCC 7.
> Seems fine to me if it doesn't cause troubles on trunk.

I back ported this to GCC 7 today.
diff mbox series

Patch

diff --git a/gcc/ada/gcc-interface/Makefile.in b/gcc/ada/gcc-interface/Makefile.in
index 50213c7520e..ebb955ebce5 100644
--- a/gcc/ada/gcc-interface/Makefile.in
+++ b/gcc/ada/gcc-interface/Makefile.in
@@ -2381,9 +2381,9 @@  OSCONS_CC=$(subst ./xgcc,../../xgcc,$(subst -B./, -B../../,$(GCC_FOR_TARGET)))
 # ada/types.h does not conflict with a same-named system header (VxWorks
 # has a <types.h> header).
 
-OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) $(GNATLIBCFLAGS_FOR_C) -E -C \
+OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -E -C \
   -DTARGET=\"$(target)\" -iquote $(fsrcpfx)ada $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
-OSCONS_EXTRACT=$(OSCONS_CC) -S s-oscons-tmplt.i
+OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS_FOR_C) -S s-oscons-tmplt.i
 
 # Note: if you need to build with a non-GNU compiler, you could adapt the
 # following definitions (written for VMS DEC-C)