This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: patch attached this time for *-rtems Ada on 3.2 branch
- From: Joel Sherrill <joel dot sherrill at OARcorp dot com>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org, guerby at acm dot org, Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Date: Tue, 04 Feb 2003 08:06:04 -0600
- Subject: Re: patch attached this time for *-rtems Ada on 3.2 branch
- Organization: OAR Corporation
- References: <3E380AA4.78200F71@OARcorp.com> <20030204060755.E4197@devserv.devel.redhat.com>
Jakub Jelinek wrote:
>
> On Wed, Jan 29, 2003 at 11:08:52AM -0600, Joel Sherrill wrote:
> > Sorry for all the bad messages. I mistyped gcc-patches the first
> > time and forgot the attachment the 2nd. :(
> >
> > Hi All,
> >
> >
> > I have a patch against the 3.2 branch which incorporates all RTEMS
> > Ada patches. PR8344 is also required for *-rtems.
> >
> > This patch does not apply cleanly to the 3.3 branch or head. I
> > will have to look into that.
> >
> > Is this OK to apply to the 3.2 branch? Thanks.
>
> This patch seems to break Ada build on 3.2 branch e.g. for
> x86-64 but I guess a lot of other targets.
> The ChangeLog does not mention the TARGET_LIBGCC2_CFLAGS -> LIBGCC2_CFLAGS
> changes, so I wonder whether they have been intentional and why have they
> been done.
> The problem is that in ada/Makefile LIBGCC2_CFLAGS is not defined at all,
> thus TARGET_LIBGCC2_CFLAGS is not used in CFLAGS at all (which ought to
> contain -fPIC on e.g. Hammer, so the shared libraries don't build,
> as linking non-pic objects into shared libs is forbidden on that
> parchitecture).
> ada/Make-lang.in passes only TARGET_LIBGCC2_CFLAGS down:
Feel free to regress it. It appears that this section of the Makefile
has been reworked totally in 3.3 anyway so may be fixed already or
broken
in a new and interesting way.
The problem this is trying to address is that this ends up ignoring the
LIBGCC2_INCLUDES setting from the t-* files. In particular, this breaks
*-rtems because config/t-rtems sets
LIBCGCC2_INCLUDES = -I$(srcdir)/../newlib/libc/sys/rtems/include
Do you have an alternate fix that lets t-* LIBGCC2* settings be honored
without breaking the other case?
> # use target-gcc
> gnatlib: force
> $(MAKE) -C ada $(FLAGS_TO_PASS) \
> CC="../xgcc -B../" ADAC="../xgcc -B../" STAGE_PREFIX=../ \
> GNATLIBFLAGS="$(GNATLIBFLAGS)" \
> GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
> TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
> THREAD_KIND="$(THREAD_KIND)" \
> gnatlib
>
> # use target-gcc
> gnatlib-shared: force
> $(MAKE) -C ada $(FLAGS_TO_PASS) \
> CC="../xgcc -B../" ADAC="../xgcc -B../" STAGE_PREFIX=../ \
> GNATLIBFLAGS="$(GNATLIBFLAGS)" \
> GNATLIBCFLAGS="$(GNATLIBCFLAGS)" \
> GNATLIBLDFLAGS="$(GNATLIBLDFLAGS)" \
> TARGET_LIBGCC2_CFLAGS="$(TARGET_LIBGCC2_CFLAGS)" \
> THREAD_KIND="$(THREAD_KIND)" \
> gnatlib-shared
>
> >
> > 2003-01-29 Joel Sherrill <joel@OARcorp.com>
> >
> > * 5rosinte.ads: Add SIGXCPU.
> > * 5rtpopsp.adb: New file.
> > * Make-lang.in: Do not build gnatpsta and gnatpsys when cross.
> > * Makefile.in: Recognize more RTEMS targets and add the RTEMS
> > specific file 5rtpopsp.adb.
> > * adaint.h: Add include of <stdio.h> when target is RTEMS. This
> > is likely needed for all newlib targets.
> > * init.c: Add RTEMS specific version of __gnat_initialize().
> >
> > diff -uNr /usr1/rtems/work-tools/original/gcc-3.2.1/gcc/ada/Makefile.in gcc-3.2.1/gcc/ada/Makefile.in
> > --- /usr1/rtems/work-tools/original/gcc-3.2.1/gcc/ada/Makefile.in Thu May 2 12:32:36 2002
> > +++ gcc-3.2.1/gcc/ada/Makefile.in Fri Nov 29 15:17:35 2002
> > @@ -2181,7 +2183,7 @@
> > # ../xgcc -B../ -dD -E ../tconfig.h $(INCLUDES) > rts/tconfig.h
> > $(MAKE) -C rts CC="../../xgcc -B../../" \
> > INCLUDES="$(INCLUDES_FOR_SUBDIR) -I./../.." \
> > - CFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS) -DIN_RTS" \
> > + CFLAGS="$(GNATLIBCFLAGS) $(LIBGCC2_CFLAGS) -DIN_RTS" \
> > ADA_CFLAGS="$(GNATLIBCFLAGS)" \
> > srcdir=$(fsrcdir) \
> > -f ../Makefile $(LIBGNAT_OBJS)
> > @@ -2279,14 +2281,14 @@
> > gnatlib-shared-default:
> > $(MAKE) $(FLAGS_TO_PASS) \
> > GNATLIBFLAGS="$(GNATLIBFLAGS)" \
> > - GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(TARGET_LIBGCC2_CFLAGS)" \
> > + GNATLIBCFLAGS="$(GNATLIBCFLAGS) $(LIBGCC2_CFLAGS)" \
> > THREAD_KIND="$(THREAD_KIND)" \
> > gnatlib
> > $(RM) rts/libgnat$(soext) rts/libgnarl$(soext)
> > - cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
> > + cd rts; ../../xgcc -B../../ -shared $(LIBGCC2_CFLAGS) \
> > -o libgnat-$(LIBRARY_VERSION)$(soext) $(SO_OPTS)libgnat-$(LIBRARY_VERSION)$(soext) \
> > $(GNATRTL_NONTASKING_OBJS) $(LIBGNAT_OBJS) $(MISCLIB) -lm
> > - cd rts; ../../xgcc -B../../ -shared $(TARGET_LIBGCC2_CFLAGS) \
> > + cd rts; ../../xgcc -B../../ -shared $(LIBGCC2_CFLAGS) \
> > -o libgnarl-$(LIBRARY_VERSION)$(soext) $(SO_OPTS)libgnarl-$(LIBRARY_VERSION)$(soext) \
> > $(GNATRTL_TASKING_OBJS) $(THREADSLIB)
> > cd rts; $(LN) libgnat-$(LIBRARY_VERSION)$(soext) libgnat$(soext)
>
> Jakub
--
Joel Sherrill, Ph.D. Director of Research & Development
joel@OARcorp.com On-Line Applications Research
Ask me about RTEMS: a free RTOS Huntsville AL 35805
Support Available (256) 722-9985