public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Gcc drive and -T option
@ 2002-08-27 22:41 7400
  0 siblings, 0 replies; only message in thread
From: 7400 @ 2002-08-27 22:41 UTC (permalink / raw)
  To: gcc-help; +Cc: gcc-bugs


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/

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-08-28  5:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-27 22:41 Gcc drive and -T option 7400

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).