Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] Remove -fPIC on x86_64
@ 2011-12-02  8:56 Arnout Vandecappelle
  2011-12-02  9:36 ` Thomas Petazzoni
  2012-01-06  6:49 ` Arnout Vandecappelle
  0 siblings, 2 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2011-12-02  8:56 UTC (permalink / raw)
  To: buildroot

From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@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@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@mind.be>
---
 package/Makefile.in |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/package/Makefile.in b/package/Makefile.in
index c3af5d3..de077bb 100644
--- a/package/Makefile.in
+++ b/package/Makefile.in
@@ -62,12 +62,6 @@ endif
 
 TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
 
-ifneq ($(BR2_PREFER_STATIC_LIB),y)
-ifeq ($(BR2_x86_64),y)
-TARGET_CFLAGS+=-fPIC -DPIC
-endif # PIC for dynamic objects on x86_64
-endif
-
 ifeq ($(findstring yy,$(BR2_mips)$(BR2_MIPS_ABI64)),yy)
 TARGET_CFLAGS+=-fno-pic -mno-abicalls
 endif
-- 
1.7.7.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Remove -fPIC on x86_64
  2011-12-02  8:56 [Buildroot] [PATCH] Remove -fPIC on x86_64 Arnout Vandecappelle
@ 2011-12-02  9:36 ` Thomas Petazzoni
  2012-01-06  6:49 ` Arnout Vandecappelle
  1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni @ 2011-12-02  9:36 UTC (permalink / raw)
  To: buildroot

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

> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@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@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@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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Buildroot] [PATCH] Remove -fPIC on x86_64
  2011-12-02  8:56 [Buildroot] [PATCH] Remove -fPIC on x86_64 Arnout Vandecappelle
  2011-12-02  9:36 ` Thomas Petazzoni
@ 2012-01-06  6:49 ` Arnout Vandecappelle
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2012-01-06  6:49 UTC (permalink / raw)
  To: buildroot

 ping?

 I agree with Thomas that this requires some testing, but the best way to 
get that testing is to commit the patch :-)


 Regards,
 Arnout

On Friday 02 December 2011 09:56:09 Arnout Vandecappelle (Essensium/Mind) wrote:
> From: "Arnout Vandecappelle (Essensium/Mind)" <arnout@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@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@mind.be>
> ---
>  package/Makefile.in |    6 ------
>  1 files changed, 0 insertions(+), 6 deletions(-)
> 
> diff --git a/package/Makefile.in b/package/Makefile.in
> index c3af5d3..de077bb 100644
> --- a/package/Makefile.in
> +++ b/package/Makefile.in
> @@ -62,12 +62,6 @@ endif
>  
>  TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING)
>  
> -ifneq ($(BR2_PREFER_STATIC_LIB),y)
> -ifeq ($(BR2_x86_64),y)
> -TARGET_CFLAGS+=-fPIC -DPIC
> -endif # PIC for dynamic objects on x86_64
> -endif
> -
>  ifeq ($(findstring yy,$(BR2_mips)$(BR2_MIPS_ABI64)),yy)
>  TARGET_CFLAGS+=-fno-pic -mno-abicalls
>  endif
> 

-- 
Arnout Vandecappelle                               arnout at mind be
Senior Embedded Software Architect                 +32-16-286540
Essensium/Mind                                     http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium                BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-01-06  6:49 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-12-02  8:56 [Buildroot] [PATCH] Remove -fPIC on x86_64 Arnout Vandecappelle
2011-12-02  9:36 ` Thomas Petazzoni
2012-01-06  6:49 ` Arnout Vandecappelle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox