Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] jimtcl: fix sparc64 compile
@ 2015-11-23 16:48 Waldemar Brodkorb
  2015-11-23 17:29 ` Thomas Petazzoni
  2015-11-26 21:34 ` Peter Korsgaard
  0 siblings, 2 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2015-11-23 16:48 UTC (permalink / raw)
  To: buildroot

It is general safe to use -fPIC for all architectures.
-fpic breaks sparc64 compile.

Generally gcc just optimize position independent code
for m68k, powerpc and sparc with -fpic.
The size differences are minimal, f.e. for powerpc:
   text    data     bss     dec     hex filename
 235983    5336     684  242003   3b153 output/target/usr/lib/libjim.0.75
 236255    8456     684  245395   3be93 output/target/usr/lib/libjim.so.0.75

So instead of keeping special settings for sparc64 it would be better
to always use -fPIC in general.

Runtime tested on Qemu ARM, MIPS, PPC and SPARC64.
Fixes:
http://autobuild.buildroot.net/results/98f391ad13f22828c022f185c0166daabdb4c1ad/

Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
 package/jimtcl/jimtcl.mk |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/jimtcl/jimtcl.mk b/package/jimtcl/jimtcl.mk
index 4afb217..50078e7 100644
--- a/package/jimtcl/jimtcl.mk
+++ b/package/jimtcl/jimtcl.mk
@@ -46,7 +46,10 @@ define JIMTCL_CONFIGURE_CMDS
 	)
 endef
 
+# -fPIC works for any architecture
 define JIMTCL_BUILD_CMDS
+	SH_CFLAGS="-fPIC" \
+	SHOBJ_CFLAGS="-fPIC" \
 	$(MAKE) -C $(@D)
 endef
 
-- 
1.7.10.4

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

* [Buildroot] [PATCH] jimtcl: fix sparc64 compile
  2015-11-23 16:48 [Buildroot] [PATCH] jimtcl: fix sparc64 compile Waldemar Brodkorb
@ 2015-11-23 17:29 ` Thomas Petazzoni
  2015-11-23 17:40   ` Waldemar Brodkorb
  2015-11-26 21:34 ` Peter Korsgaard
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2015-11-23 17:29 UTC (permalink / raw)
  To: buildroot

Waldemar,

On Mon, 23 Nov 2015 17:48:53 +0100, Waldemar Brodkorb wrote:
> It is general safe to use -fPIC for all architectures.
> -fpic breaks sparc64 compile.
> 
> Generally gcc just optimize position independent code
> for m68k, powerpc and sparc with -fpic.
> The size differences are minimal, f.e. for powerpc:
>    text    data     bss     dec     hex filename
>  235983    5336     684  242003   3b153 output/target/usr/lib/libjim.0.75
>  236255    8456     684  245395   3be93 output/target/usr/lib/libjim.so.0.75
> 
> So instead of keeping special settings for sparc64 it would be better
> to always use -fPIC in general.

So in other words, you're saying that in other packages that add -fPIC
only for sparc/sparc64, we should add it unconditionally?

> +# -fPIC works for any architecture

I think this comment is a bit useless. It should rather be:

# -fPIC is mandatory to build shared libraries on certain architectures
# (e.g. SPARC) and causes no harm or drawbacks on other architectures

>  define JIMTCL_BUILD_CMDS
> +	SH_CFLAGS="-fPIC" \
> +	SHOBJ_CFLAGS="-fPIC" \
>  	$(MAKE) -C $(@D)
>  endef
>  

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

* [Buildroot] [PATCH] jimtcl: fix sparc64 compile
  2015-11-23 17:29 ` Thomas Petazzoni
@ 2015-11-23 17:40   ` Waldemar Brodkorb
  0 siblings, 0 replies; 4+ messages in thread
From: Waldemar Brodkorb @ 2015-11-23 17:40 UTC (permalink / raw)
  To: buildroot

Hi Thomas,
Thomas Petazzoni wrote,

> Waldemar,
> 
> On Mon, 23 Nov 2015 17:48:53 +0100, Waldemar Brodkorb wrote:
> > It is general safe to use -fPIC for all architectures.
> > -fpic breaks sparc64 compile.
> > 
> > Generally gcc just optimize position independent code
> > for m68k, powerpc and sparc with -fpic.
> > The size differences are minimal, f.e. for powerpc:
> >    text    data     bss     dec     hex filename
> >  235983    5336     684  242003   3b153 output/target/usr/lib/libjim.0.75
> >  236255    8456     684  245395   3be93 output/target/usr/lib/libjim.so.0.75
> > 
> > So instead of keeping special settings for sparc64 it would be better
> > to always use -fPIC in general.
> 
> So in other words, you're saying that in other packages that add -fPIC
> only for sparc/sparc64, we should add it unconditionally?

Yes. I think we should get those patches upstream. I hope they don't
come up with any reasons for -fpic. I can't see any in our use case.
 
> > +# -fPIC works for any architecture
> 
> I think this comment is a bit useless. It should rather be:
> 
> # -fPIC is mandatory to build shared libraries on certain architectures
> # (e.g. SPARC) and causes no harm or drawbacks on other architectures

Can you fix it before commit? :=)

best regards
 Waldemar

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

* [Buildroot] [PATCH] jimtcl: fix sparc64 compile
  2015-11-23 16:48 [Buildroot] [PATCH] jimtcl: fix sparc64 compile Waldemar Brodkorb
  2015-11-23 17:29 ` Thomas Petazzoni
@ 2015-11-26 21:34 ` Peter Korsgaard
  1 sibling, 0 replies; 4+ messages in thread
From: Peter Korsgaard @ 2015-11-26 21:34 UTC (permalink / raw)
  To: buildroot

>>>>> "Waldemar" == Waldemar Brodkorb <wbx@openadk.org> writes:

 > It is general safe to use -fPIC for all architectures.
 > -fpic breaks sparc64 compile.

 > Generally gcc just optimize position independent code
 > for m68k, powerpc and sparc with -fpic.
 > The size differences are minimal, f.e. for powerpc:
 >    text    data     bss     dec     hex filename
 >  235983    5336     684  242003   3b153 output/target/usr/lib/libjim.0.75
 >  236255    8456     684  245395   3be93 output/target/usr/lib/libjim.so.0.75

 > So instead of keeping special settings for sparc64 it would be better
 > to always use -fPIC in general.

 > Runtime tested on Qemu ARM, MIPS, PPC and SPARC64.
 > Fixes:
 > http://autobuild.buildroot.net/results/98f391ad13f22828c022f185c0166daabdb4c1ad/

 > Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>

Committed after changing the comment as suggested by Thomas, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2015-11-26 21:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-11-23 16:48 [Buildroot] [PATCH] jimtcl: fix sparc64 compile Waldemar Brodkorb
2015-11-23 17:29 ` Thomas Petazzoni
2015-11-23 17:40   ` Waldemar Brodkorb
2015-11-26 21:34 ` Peter Korsgaard

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