This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR ada/42254, avoid providing multiple copies of object files to link of GNAT tools


On 26 Jan 2010, at 21:30, Arnaud Charlet wrote:

>> The only part of this patch you may be uncomfortable with is the change 
>> to target common-tools, where I delete all the .o files in the RTS directory 
>> that are already in libgna*.a before the gnatmake -b step (the problem 
>> being that if gnatbind sees a .o file it includes it in the files to be linked, 
>> being unaware that the object is already in libgna*.a). The .o files that 
>> survive are g-trasym.o and (on powerpc-wrs-vxworks) memtrack.o - but 
>> the latter doesn't get installed.
> 
> Right, I'm indeed uncomfortable with this part indeed. Would be good
> to find a way to avoid this part, removing objects means always forcing
> recompilation of these files. Also, you shouldn't need to remove
> memtrack.o, it shouldn't conflict with any existing .o, so no need to.
> 
> The RM command lines generated by the Makefile may also exceed
> command line length limits on some systems (e.g. IRIX).

New strategy: in Darwin only, arrange that common-tools are built using 
-nostdlib and a new temporary ada/tools/libgnatc.a which contains only 
the C-derived objects from the RTS. This means that the binder will call 
in the required Ada-derived objects from the RTS and will fnd the C 
objects in the library; and that the RTS directory itself remains untouched.

There are 2 new variables NOSTDLIB and LIBGNATC and I only set them 
in the "ifeq ($(strip $(filter-out darwin%,$(osys))),)" section. You may  want 
the names to be more specific (TOOLS_NOSTDLIB) and/or to be set 
explicitly to empty (NOSTDLIB=) at the top?

Tested on x86_64-apple-darwin10, x86_64-unknown-linux-gnu [Debian 
5] and powerpc-wrs-vxworks hosted on i386-apple-darwin10.

>> 2010-01-26  Simon Wright  <simon@pushface.org>
>> 
>> 	PR ada/42554
>> 	* gcc-interface/Makefile.in (TOOLS_LIBS): remove LIB_GNAT.
>> 	* gcc-interface/Makefile.in (GNATLINK_OBJS): remove object files
>> 	that are present in the RTS.
>> 	* gcc-interface/Makefile.in (GNATMAKE_OBJS): likewise.
>> 	* gcc-interface/Makefile.in (common-tools): at the start, delete
>> 	all the .o files in the RTS directory that are also in libraries.
>> 	* gcc-interface/Makefile.in (../../gnatmake$(exeext)): add LIBGNAT.
>> 	* gcc-interface/Makefile.in (../../gnatlink$(exeext)):likewise.
> 
> This changelog is also not in the right format, there should be
> only one mention of the file name.
> 
> The other parts of the patch (removing run-time objects from the explicit
> list of gnatmake/gnatlink objects, removing the duplicated libgnat) look
> reasonable.

2010-01-27  Simon Wright  <simon@pushface.org>
	PR ada/42554
	* gcc-interface/Makefile.in (TOOLS_LIBS, GNATLINK_OBJS, 
	GNATMAKE_OBJS, common-tools, ../../gnatmake$(exeext), 
	../../gnatlink$(exeext)): on Darwin, ensure that the
	linker only sees each object file once.

Attachment: gcc-ada-gcc-interface-Makefile.in.diff
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]