This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Passing options down to assembler and linker
- From: Nathan Froyd <froydnj at codesourcery dot com>
- To: Jean Christophe Beyler <jean dot christophe dot beyler at gmail dot com>
- Cc: gcc at gcc dot gnu dot org
- Date: Fri, 23 Apr 2010 11:09:04 -0700
- Subject: Re: Passing options down to assembler and linker
- References: <l2mc568a2601004231055n656a0a54s40af0509d960ae60@mail.gmail.com>
On Fri, Apr 23, 2010 at 01:55:48PM -0400, Jean Christophe Beyler wrote:
> I know we can pass -Wl,option, -Wa,option from gcc down to as and ld
> however if I have to write :
>
> gcc -mArch2 -Wl,--arch2 -Wa,--arch2 hello.c
>
> it gets a bit redundant, I must be blind because I can't seem to find
> how to do it internally.
You want to get comfortable with specs:
http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gcc/Spec-Files.html#Spec-Files
and building in what specs should be handled by default:
http://gcc.gnu.org/onlinedocs/gccint/Driver.html#Driver
The ones you're interested in are ASM_SPEC and LINK_SPEC.
-Nathan