[RFC][AArch64] Support in-tree building with libgloss and linker scripts (specs files)

Richard Earnshaw rearnsha@arm.com
Mon Feb 3 10:32:00 GMT 2014


On 29/01/14 17:12, Jeff Johnston wrote:
> I'm ok with it since there is a work-around if needed and it is in an
> architecture-specific directory.  So, go ahead.
> 
> -- Jeff J.
> 
> ----- Original Message -----
> From: "Corinna Vinschen" <vinschen@redhat.com>
> To: newlib@sourceware.org
> Sent: Wednesday, January 29, 2014 8:30:55 AM
> Subject: Re: [RFC][AArch64] Support in-tree building with libgloss and linker scripts (specs files)
> 
> On Jan 29 13:09, Marcus Shawcroft wrote:
>> On 24 January 2014 14:46, Richard Earnshaw <rearnsha@arm.com> wrote:
>>> When using libgloss and linker scripts unified source tree builds
>>> (gcc+newlib+binutils) fail when building the libraries because the
>>> linker scripts have not been installed at that time.
>>>
>>> A suitable solution to this is to make copies of the scripts in the
>>> build area, which the compiler is configured to search during the build.
>>>  Then using LDFLAGS_FOR_TARGET=-specs=<spec-file> flag will correctly
>>> pick up the appropriate libgloss specs file.
>>>
>>> I've marked this as an RFC as I'm not sure if the pattern-based rule is
>>> GNUmake specific, and if it is, whether this is not appropriate for
>>> newlib -- it could be written out long-hand, but this rule makes the
>>> construct trivial to port to other libgloss targets.
>>>
>>> This was the only patch I needed to make an aarch64-elf unified tree
>>> build and run the gcc testsuite.
>>>
>>> Thoughts please?
>>
>> Installing the scripts in the build area makes sense to me, but I
>> think we need an ack from Jeff or Corinna w.r.t the use of GNU make
>> extensions.
> 
> Personally I don't care.  If it's ok with Jeff, it's ok with me.
> 
> 
> Corinna
> 

Thanks, done.

This is what I finally committed -- the only change is to extend the
"clean" rule to remove the copies.

R.

2014-02-03  Richard Earnshaw  <rearnsha@arm.com>

	* aarch64/Makefile.in (RDIMON_SCRIPTS): Rule to build in-tree copies
	of scripts.
	(all): Build the in-tree copies of the scripts.
	(clean): Also delete the in-tree copies of the scripts.
-------------- next part --------------
Index: Makefile.in
===================================================================
RCS file: /cvs/src/src/libgloss/aarch64/Makefile.in,v
retrieving revision 1.4
diff -p -r1.4 Makefile.in
*** Makefile.in	18 Nov 2013 10:04:55 -0000	1.4
--- Makefile.in	3 Feb 2014 10:29:20 -0000
*************** CFLAGS		= -g
*** 93,99 ****
  # build a test program for each target board. Just trying to get
  # it to link is a good test, so we ignore all the errors for now.
  #
! all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP}
  	@rootpre=`pwd`/; export rootpre; \
  	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
  	for dir in .. ${SUBDIRS}; do \
--- 93,99 ----
  # build a test program for each target board. Just trying to get
  # it to link is a good test, so we ignore all the errors for now.
  #
! all: ${CRT0} ${RDIMON_CRT0} ${RDIMON_BSP} ${RDIMON_SCRIPTS}
  	@rootpre=`pwd`/; export rootpre; \
  	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
  	for dir in .. ${SUBDIRS}; do \
*************** $(RDIMON_BSP): $(RDIMON_OBJS)
*** 142,148 ****
  	${RANLIB} $@
  
  clean mostlyclean:
! 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP)
  	@rootpre=`pwd`/; export rootpre; \
  	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
  	for dir in .. ${SUBDIRS}; do \
--- 142,148 ----
  	${RANLIB} $@
  
  clean mostlyclean:
! 	rm -f a.out core *.i *.o *-test *.srec *.dis *.x $(SIM_BSP) ${RDIMON_SCRIPTS}
  	@rootpre=`pwd`/; export rootpre; \
  	srcrootpre=`cd $(srcdir); pwd`/; export srcrootpre; \
  	for dir in .. ${SUBDIRS}; do \
*************** install-rdimon:
*** 175,180 ****
--- 175,183 ----
  	set -e; for x in ${RDIMON_CRT0} ${RDIMON_BSP}; do ${INSTALL_DATA} $$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
  	set -e; for x in ${RDIMON_SCRIPTS}; do ${INSTALL_DATA} ${srcdir}/${objtype}$$x $(DESTDIR)${tooldir}/lib${MULTISUBDIR}/$$x; done
  
+ # Make copies of the scripts to facilitate in-tree bootstrapping.
+ ${RDIMON_SCRIPTS}: %: ${objtype}%
+ 	cp $< $@
  
  doc:
  info:


More information about the Newlib mailing list