This is the mail archive of the crossgcc@sourceware.org mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


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: doubt in Static Builds


On Wed, 16 Nov 2005, Pramod P K wrote:

I built toolchain  arm-softfloat-linux-gnu. By default
arm-softfloat-linux-gnu-gcc gives "dynamically linked (uses shared
libs)" ELF on
# arm-softfloat-linux-gnu-gcc  file.c
I want, by default,  "statically linked"

In crosstool-howto.html it is said:

Static Builds

If for some reason you want the resulting toolchain binaries to be
statically linked, set the following environment variables before
running crosstool.sh (or all.sh):
BINUTILS_EXTRA_CONFIG="LDFLAGS=-all-static"

Stop! You are confusing the target binaries you generate with crosstool with the binaries crosstool consists of, eg. the "arm-softfloat-linux-gnu-gcc" tool itself. The text you quote from crosstool-howto.html tells you how to built a static toolchain. This has nothing to do with the way your *target* binaries will be generated.


What are your reasons to want this be _default_? Can't you write your build scripts/Makefiles that they always throw "-static"? That would be all that's needed.

One way to archive such a default behaviour would be to manually tweak the cross compiler's spec file (type "arm-softfloat-linux-gnu-gcc -v" to see where it lives). You'd need to enforce -static be thrown by default. There may be more elegant ways to archieve this, though.

Regards,
Marius

--
Marius Groeger <mgroeger@sysgo.com>
SYSGO AG                      Embedded and Real-Time Software
Voice: +49 6136 9948 0                  FAX: +49 6136 9948 10
www.sysgo.com | www.elinos.com | www.osek.de | www.pikeos.com


------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sources.redhat.com


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