* [Buildroot] [PATCH] libtommath: add -fPIC
@ 2016-04-30 8:33 Francois Perrad
2016-04-30 12:55 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Francois Perrad @ 2016-04-30 8:33 UTC (permalink / raw)
To: buildroot
fix build with x86_64, see http://autobuild.buildroot.net/results/212/212469db5dc8399070390603c0fdf7f12b130cda/
Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
---
package/libtommath/libtommath.mk | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/libtommath/libtommath.mk b/package/libtommath/libtommath.mk
index 463ea7b..eb3b00e 100644
--- a/package/libtommath/libtommath.mk
+++ b/package/libtommath/libtommath.mk
@@ -13,7 +13,7 @@ LIBTOMMATH_INSTALL_STAGING = YES
LIBTOMMATH_INSTALL_TARGET = NO # only static library
define LIBTOMMATH_BUILD_CMDS
- $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./ $(TARGET_CFLAGS)"
+ $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="-I./ -fPIC $(TARGET_CFLAGS)"
endef
define LIBTOMMATH_INSTALL_STAGING_CMDS
--
2.5.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 8:33 [Buildroot] [PATCH] libtommath: add -fPIC Francois Perrad
@ 2016-04-30 12:55 ` Thomas Petazzoni
2016-04-30 18:43 ` Peter Korsgaard
0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-04-30 12:55 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 30 Apr 2016 10:33:07 +0200, Francois Perrad wrote:
> fix build with x86_64, see http://autobuild.buildroot.net/results/212/212469db5dc8399070390603c0fdf7f12b130cda/
>
> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> ---
> package/libtommath/libtommath.mk | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
Applied to master, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 12:55 ` Thomas Petazzoni
@ 2016-04-30 18:43 ` Peter Korsgaard
2016-04-30 19:13 ` Thomas Petazzoni
2016-05-01 6:49 ` François Perrad
0 siblings, 2 replies; 7+ messages in thread
From: Peter Korsgaard @ 2016-04-30 18:43 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
> Hello,
> On Sat, 30 Apr 2016 10:33:07 +0200, Francois Perrad wrote:
>> fix build with x86_64, see
>> http://autobuild.buildroot.net/results/212/212469db5dc8399070390603c0fdf7f12b130cda/
>>
>> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
>> ---
>> package/libtommath/libtommath.mk | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
> Applied to master, thanks.
Hmm, isn't it a bit odd to build a static library with -fPIC?
But OK, the error message seems to be from trying to link a shared
library with it.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 18:43 ` Peter Korsgaard
@ 2016-04-30 19:13 ` Thomas Petazzoni
2016-04-30 19:43 ` Peter Korsgaard
2016-05-01 6:49 ` François Perrad
1 sibling, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-04-30 19:13 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 30 Apr 2016 20:43:26 +0200, Peter Korsgaard wrote:
> > Applied to master, thanks.
>
> Hmm, isn't it a bit odd to build a static library with -fPIC?
>
> But OK, the error message seems to be from trying to link a shared
> library with it.
Well, as you've seen yourself, this static library is then used inside
a shared library, so it has to be built -fPIC.
If you want to build the static library without -fPIC, then the
libtommath package should also provide a shared version of its library,
so that it gets used instead of the static one when linked into a
shared library.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 19:13 ` Thomas Petazzoni
@ 2016-04-30 19:43 ` Peter Korsgaard
2016-05-01 7:35 ` Thomas Petazzoni
0 siblings, 1 reply; 7+ messages in thread
From: Peter Korsgaard @ 2016-04-30 19:43 UTC (permalink / raw)
To: buildroot
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>> Hmm, isn't it a bit odd to build a static library with -fPIC?
>>
>> But OK, the error message seems to be from trying to link a shared
>> library with it.
> Well, as you've seen yourself, this static library is then used inside
> a shared library, so it has to be built -fPIC.
> If you want to build the static library without -fPIC, then the
> libtommath package should also provide a shared version of its library,
> so that it gets used instead of the static one when linked into a
> shared library.
Hmm, should we do this for all static only libraries in case they would
ever get used by a shared library? E.G. ezxml is a similar package.
--
Venlig hilsen,
Peter Korsgaard
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 19:43 ` Peter Korsgaard
@ 2016-05-01 7:35 ` Thomas Petazzoni
0 siblings, 0 replies; 7+ messages in thread
From: Thomas Petazzoni @ 2016-05-01 7:35 UTC (permalink / raw)
To: buildroot
Hello,
On Sat, 30 Apr 2016 21:43:46 +0200, Peter Korsgaard wrote:
> > Well, as you've seen yourself, this static library is then used inside
> > a shared library, so it has to be built -fPIC.
>
> > If you want to build the static library without -fPIC, then the
> > libtommath package should also provide a shared version of its library,
> > so that it gets used instead of the static one when linked into a
> > shared library.
>
> Hmm, should we do this for all static only libraries in case they would
> ever get used by a shared library? E.G. ezxml is a similar package.
Well, as soon as some object code ends up being used in a shared
library (directly or via linking to a static library), then it must be
compiled with -fPIC, at least on some architectures (x86_64 and mips
are the one who clearly abort the build if that's not the case).
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] libtommath: add -fPIC
2016-04-30 18:43 ` Peter Korsgaard
2016-04-30 19:13 ` Thomas Petazzoni
@ 2016-05-01 6:49 ` François Perrad
1 sibling, 0 replies; 7+ messages in thread
From: François Perrad @ 2016-05-01 6:49 UTC (permalink / raw)
To: buildroot
2016-04-30 20:43 GMT+02:00 Peter Korsgaard <peter@korsgaard.com>:
>>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:
>
> > Hello,
> > On Sat, 30 Apr 2016 10:33:07 +0200, Francois Perrad wrote:
> >> fix build with x86_64, see
> >> http://autobuild.buildroot.net/results/212/212469db5dc8399070390603c0fdf7f12b130cda/
> >>
> >> Signed-off-by: Francois Perrad <francois.perrad@gadz.org>
> >> ---
> >> package/libtommath/libtommath.mk | 2 +-
> >> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> > Applied to master, thanks.
>
> Hmm, isn't it a bit odd to build a static library with -fPIC?
>
> But OK, the error message seems to be from trying to link a shared
> library with it.
>
libtommath have a support for shared library via a makefile.shared.
But it is currently broken for cross compilation (bad linking with libtool).
Fran?ois
> --
> Bye, Peter Korsgaard
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-05-01 7:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-30 8:33 [Buildroot] [PATCH] libtommath: add -fPIC Francois Perrad
2016-04-30 12:55 ` Thomas Petazzoni
2016-04-30 18:43 ` Peter Korsgaard
2016-04-30 19:13 ` Thomas Petazzoni
2016-04-30 19:43 ` Peter Korsgaard
2016-05-01 7:35 ` Thomas Petazzoni
2016-05-01 6:49 ` François Perrad
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox