public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process
@ 2015-02-10 23:35 Joel Sherrill
  2015-02-11  7:22 ` Arnaud Charlet
  0 siblings, 1 reply; 3+ messages in thread
From: Joel Sherrill @ 2015-02-10 23:35 UTC (permalink / raw)
  To: gcc-patches, Chris Johns

[-- Attachment #1: Type: text/plain, Size: 703 bytes --]

Hi

When building Ada for RTEMS, you need to pass in the CFLAGS_FOR_TARGET
to see OS specific .h files. This was already done for the RTS but needed to
be added to the process which extracts value settings from the .h files.

This patch is against 4.9.  OK to apply to 4.8, 4.9, and head assuming it
applies cleanly?

2015-02-10  Joel Sherrill <joel.sherrill@oarcorp.com>

    * gcc-interface/Makefile.in: Add CFLAGS_TO_TARGET to OSCONS_CPP
    and OSCONS_EXTRACT.

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


[-- Attachment #2: ada-add-cflags.diff --]
[-- Type: text/plain, Size: 1425 bytes --]

2015-02-10  Joel Sherrill <joel.sherrill@oarcorp.com>

	* gcc-interface/Makefile.in: Add CFLAGS_TO_TARGET to OSCONS_CPP
	and OSCONS_EXTRACT.

Index: gcc/ada/gcc-interface/Makefile.in
===================================================================
--- gcc/ada/gcc-interface/Makefile.in	(revision 220002)
+++ gcc/ada/gcc-interface/Makefile.in	(working copy)
@@ -115,7 +115,7 @@
 # Pretend that _Unwind_GetIPInfo is available for the target by default.  This
 # should be autodetected during the configuration of libada and passed down to
 # here, but we need something for --disable-libada and hope for the best.
-GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) \
+GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
 	-fexceptions -DIN_RTS -DHAVE_GETIPINFO
 ALL_ADAFLAGS = $(CFLAGS) $(ADA_CFLAGS) $(ADAFLAGS)
 THREAD_KIND = native
@@ -2748,9 +2748,9 @@
 # for running it from $(RTSDIR)
 OSCONS_CC=`echo "$(GCC_FOR_TARGET)" \
   | sed -e 's^\./xgcc^../../xgcc^' -e 's^-B./^-B../../^'`
-OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) -E -C \
+OSCONS_CPP=$(OSCONS_CC) $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) -E -C \
   -DTARGET=\"$(target)\" $(fsrcpfx)ada/s-oscons-tmplt.c > s-oscons-tmplt.i
-OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS) -S s-oscons-tmplt.i
+OSCONS_EXTRACT=$(OSCONS_CC) $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) -S s-oscons-tmplt.i
 endif
 
 ./bldtools/oscons/xoscons: xoscons.adb xutil.ads xutil.adb

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process
  2015-02-10 23:35 Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process Joel Sherrill
@ 2015-02-11  7:22 ` Arnaud Charlet
  2015-02-12  0:33   ` Joel Sherrill
  0 siblings, 1 reply; 3+ messages in thread
From: Arnaud Charlet @ 2015-02-11  7:22 UTC (permalink / raw)
  To: Joel Sherrill; +Cc: gcc-patches, Chris Johns

> When building Ada for RTEMS, you need to pass in the CFLAGS_FOR_TARGET
> to see OS specific .h files. This was already done for the RTS but needed to
> be added to the process which extracts value settings from the .h files.
> 
> This patch is against 4.9.  OK to apply to 4.8, 4.9, and head assuming it
> applies cleanly?

This patch won't apply cleanly for head I think, where I suspect at least
part of your patch is OBE.

It would be better to first have a patch for trunk (if still relevant)
and then backport it to the other branches, since changes on trunk have
already been done in a different way to address at least partly this issue
(e.g. use of GNATLIBCFLAGS_FOR_C in OSCONS_CPP, different computation of
OSCONS_CC).

Arno

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process
  2015-02-11  7:22 ` Arnaud Charlet
@ 2015-02-12  0:33   ` Joel Sherrill
  0 siblings, 0 replies; 3+ messages in thread
From: Joel Sherrill @ 2015-02-12  0:33 UTC (permalink / raw)
  To: Arnaud Charlet; +Cc: gcc-patches, Chris Johns


On 2/11/2015 1:22 AM, Arnaud Charlet wrote:
>> When building Ada for RTEMS, you need to pass in the CFLAGS_FOR_TARGET
>> to see OS specific .h files. This was already done for the RTS but needed to
>> be added to the process which extracts value settings from the .h files.
>>
>> This patch is against 4.9.  OK to apply to 4.8, 4.9, and head assuming it
>> applies cleanly?
> This patch won't apply cleanly for head I think, where I suspect at least
> part of your patch is OBE.
OK. Rebuilding on the head.
> It would be better to first have a patch for trunk (if still relevant)
> and then backport it to the other branches, since changes on trunk have
> already been done in a different way to address at least partly this issue
> (e.g. use of GNATLIBCFLAGS_FOR_C in OSCONS_CPP, different computation of
> OSCONS_CC).
I am happy to do and from your description it sounds like the it would
have built
if the code had my previous patch to add CFLAGS_FOR_TARGET to the
GNATLIBCFLAGS.

GNATLIBCFLAGS_FOR_C = -W -Wall $(GNATLIBCFLAGS) $(CFLAGS_FOR_TARGET) \
        -fexceptions -DIN_RTS -DHAVE_GETIPINFO

But the build didn't get far enough to know. It fails before that with:

gcc -c -g -O2  -gnatpg -gnata -W -Wall -nostdinc -I- -I. -Iada/generated
-Iada -I/users/joel/test-gcc/gcc/gcc/ada
-I/users/joel/test-gcc/gcc/gcc/ada/gcc-interface
/users/joel/test-gcc/gcc/gcc/ada/a-ioexce.ads -o ada/a-ioexce.o
a-ioexce.ads:21:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:22:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:23:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:24:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:25:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:26:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:27:19: violation of restriction "No_Elaboration_Code" at
system.ads:53
a-ioexce.ads:28:19: violation of restriction "No_Elaboration_Code" at
system.ads:53

Any ideas?

My native compiler is from the head back in August. I will rebuild it
overnight
and try again in the morning in case that's a factor.

> Arno

-- 
Joel Sherrill, Ph.D.             Director of Research & Development
joel.sherrill@OARcorp.com        On-Line Applications Research
Ask me about RTEMS: a free RTOS  Huntsville AL 35805
Support Available                (256) 722-9985


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-12  0:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-10 23:35 Add CFLAGS_FOR_TARGET to Ada OS Constant Extraction Process Joel Sherrill
2015-02-11  7:22 ` Arnaud Charlet
2015-02-12  0:33   ` Joel Sherrill

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).