[Buildroot] [PATCH] Remove -fPIC on x86_64

Thomas Petazzoni thomas.petazzoni at free-electrons.com
Fri Dec 2 09:36:53 UTC 2011


Le Fri,  2 Dec 2011 09:56:09 +0100,
"Arnout Vandecappelle (Essensium/Mind)" <arnout at mind.be> a écrit :

> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout at mind.be>
> 
> The -fPIC breaks the purgatory of kexec (= the code that passes command-line
> arguments to the kernel): kexec doesn't know how to handle the GOT and PLT
> relocation entries.
> 
> There is also no reason at all to pass -fPIC.  Shared libraries that require
> it will add it to their local Makefiles, and normal executables have no
> business with -fPIC (plus it adds overhead...).
> 
> The -fPIC was added by Bernhard Reutner-Fischer <rep.dot.nop at gmail.com>
> in commit 8027784c.  That commit adds sysroot parameters to CFLAGS.
> There is no explanation why -fPIC is also added for x86_64.
> 
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout at mind.be>

This needs some testing, but on the principle, I agree that Buildroot
shouldn't have to add this flag globally to TARGET_CFLAGS.

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com



More information about the buildroot mailing list