This is the mail archive of the gcc-bugs@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]

Gcc driver and -T option


I would like to know the opinion about following situation related with gcc driver.

 - I have a directory under which there are 2 c files say  - 1.c and 2.c
 - I compile these file using gcc -o test.exe *.c -Tscript.ld
 - This script.ld uses 1.o and 2.o

 Since 1.o and 2.o are NOT created in the cwd the link fails
 I'm aware that driver chooses $TMPDIR to create temporary file and deletes them when linking
 is done
 Temporary files are never created in the current directory Also when temporary files are
 created their names are
 different than that of the .c files .    No doubt the linking will fail in the case the
 above as specified object files are not found in current directory  Since gcc
 drive is not aware of what obj files are  specified in the linker script ( and why it should
 be ? ) it will try to pass the object files in  $(TMPDIR)/temporary files with 
 generated names to linker (-v option shows the temporary files used )

 #1 Shouldn't gcc  create .o files in cwd when -T is used for compiling ?
 Can this be called as bug ? or new valid feature request ?

 Here are some other possible solutions to deal with above situation

 #2 or use --save-temps on command line
 #3 or use gcc -c *.c  and then link separately since -c will always tell assembler to
 generate the object file in  current directory with help of -o option

 Is there any other better way ?

 I would like to know the comments on the #1

 Thanks a in advance
 -U7400


__________________________________________________________________
Your favorite stores, helpful shopping tools and great gift ideas. Experience the convenience of buying online with Shop@Netscape! http://shopnow.netscape.com/

Get your own FREE, personal Netscape Mail account today at http://webmail.netscape.com/


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