* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
@ 2015-09-16 10:10 Vicente Olivert Riera
2015-09-16 10:39 ` Thomas Petazzoni
2015-09-16 20:19 ` Thomas Petazzoni
0 siblings, 2 replies; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-09-16 10:10 UTC (permalink / raw)
To: buildroot
The Makefile of libselinux performs the following check:
ARCH := $(patsubst i%86,i386,$(shell uname -m))
ifneq (,$(filter i386,$(ARCH)))
TLSFLAGS += -mno-tls-direct-seg-refs
endif
Which means that if the host machine is an x86, then TLSFLAGS will
contain -mno-tls-direct-seg-refs. That command line option causes
libselinux to fail when building it for target architectures where the
compiler doesn't support that option, i.e. MIPS:
mips-img-linux-gnu-gcc: error: unrecognized command line option
?-mno-tls-direct-seg-refs?
So to fix that problem we can set the ARCH variable to $(KERNEL_ARCH),
and then append it to the LIBSELINUX_MAKE_OPTS.
Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
---
package/libselinux/libselinux.mk | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/package/libselinux/libselinux.mk b/package/libselinux/libselinux.mk
index e6a7c6b..d4b96c4 100644
--- a/package/libselinux/libselinux.mk
+++ b/package/libselinux/libselinux.mk
@@ -15,7 +15,8 @@ LIBSELINUX_INSTALL_STAGING = YES
LIBSELINUX_MAKE_OPTS = \
$(TARGET_CONFIGURE_OPTS) \
- LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread"
+ LDFLAGS="$(TARGET_LDFLAGS) -lpcre -lpthread" \
+ ARCH=$(KERNEL_ARCH)
define LIBSELINUX_BUILD_CMDS
# DESTDIR is needed during the compile to compute library and
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
2015-09-16 10:10 [Buildroot] [PATCH] libselinux: use correct definition of ARCH Vicente Olivert Riera
@ 2015-09-16 10:39 ` Thomas Petazzoni
2015-09-16 10:46 ` Vicente Olivert Riera
2015-09-16 20:19 ` Thomas Petazzoni
1 sibling, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-09-16 10:39 UTC (permalink / raw)
To: buildroot
Dear Vicente Olivert Riera,
On Wed, 16 Sep 2015 11:10:03 +0100, Vicente Olivert Riera wrote:
> The Makefile of libselinux performs the following check:
>
> ARCH := $(patsubst i%86,i386,$(shell uname -m))
> ifneq (,$(filter i386,$(ARCH)))
> TLSFLAGS += -mno-tls-direct-seg-refs
> endif
>
> Which means that if the host machine is an x86, then TLSFLAGS will
> contain -mno-tls-direct-seg-refs. That command line option causes
> libselinux to fail when building it for target architectures where the
> compiler doesn't support that option, i.e. MIPS:
>
> mips-img-linux-gnu-gcc: error: unrecognized command line option
> ?-mno-tls-direct-seg-refs?
>
> So to fix that problem we can set the ARCH variable to $(KERNEL_ARCH),
> and then append it to the LIBSELINUX_MAKE_OPTS.
>
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
Looks good to me:
Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
I'm surprised we never caught this through the autobuilder testing, but
I guess all autobuilder machines are x86_64 based, which will not
exhibit the problem.
Thanks!
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
2015-09-16 10:39 ` Thomas Petazzoni
@ 2015-09-16 10:46 ` Vicente Olivert Riera
2015-09-16 11:41 ` Thomas Petazzoni
0 siblings, 1 reply; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-09-16 10:46 UTC (permalink / raw)
To: buildroot
Dear Thomas Petazzoni,
On 09/16/2015 11:39 AM, Thomas Petazzoni wrote:
> Dear Vicente Olivert Riera,
>
> On Wed, 16 Sep 2015 11:10:03 +0100, Vicente Olivert Riera wrote:
>> The Makefile of libselinux performs the following check:
>>
>> ARCH := $(patsubst i%86,i386,$(shell uname -m))
>> ifneq (,$(filter i386,$(ARCH)))
>> TLSFLAGS += -mno-tls-direct-seg-refs
>> endif
>>
>> Which means that if the host machine is an x86, then TLSFLAGS will
>> contain -mno-tls-direct-seg-refs. That command line option causes
>> libselinux to fail when building it for target architectures where the
>> compiler doesn't support that option, i.e. MIPS:
>>
>> mips-img-linux-gnu-gcc: error: unrecognized command line option
>> ?-mno-tls-direct-seg-refs?
>>
>> So to fix that problem we can set the ARCH variable to $(KERNEL_ARCH),
>> and then append it to the LIBSELINUX_MAKE_OPTS.
>>
>> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
>
> Looks good to me:
>
> Reviewed-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
>
> I'm surprised we never caught this through the autobuilder testing, but
> I guess all autobuilder machines are x86_64 based, which will not
> exhibit the problem.
Yeah, I set a new autobuilder to run only MIPS builds since currently
there aren't many autobuild failures to look at (I needed more!), and I
put it on a x86 virtual machine just to also catch possible issues due
to building on a 32-bit host machine, and because I already had another
autobuilder running on a x86_64 host. And look, I have already catch one! :D
Thanks for the review.
Regards,
Vincent.
> Thanks!
>
> Thomas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
2015-09-16 10:46 ` Vicente Olivert Riera
@ 2015-09-16 11:41 ` Thomas Petazzoni
2015-09-16 14:25 ` Vicente Olivert Riera
0 siblings, 1 reply; 6+ messages in thread
From: Thomas Petazzoni @ 2015-09-16 11:41 UTC (permalink / raw)
To: buildroot
Hello,
On Wed, 16 Sep 2015 11:46:41 +0100, Vicente Olivert Riera wrote:
> > I'm surprised we never caught this through the autobuilder testing, but
> > I guess all autobuilder machines are x86_64 based, which will not
> > exhibit the problem.
>
> Yeah, I set a new autobuilder to run only MIPS builds since currently
> there aren't many autobuild failures to look at (I needed more!), and I
> put it on a x86 virtual machine just to also catch possible issues due
> to building on a 32-bit host machine, and because I already had another
> autobuilder running on a x86_64 host. And look, I have already catch one! :D
Great! Do you want an account to submit your build results
automatically to autobuild.buildroot.org?
Best regards,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
2015-09-16 11:41 ` Thomas Petazzoni
@ 2015-09-16 14:25 ` Vicente Olivert Riera
0 siblings, 0 replies; 6+ messages in thread
From: Vicente Olivert Riera @ 2015-09-16 14:25 UTC (permalink / raw)
To: buildroot
Hi Thomas,
On 09/16/2015 12:41 PM, Thomas Petazzoni wrote:
> Hello,
>
> On Wed, 16 Sep 2015 11:46:41 +0100, Vicente Olivert Riera wrote:
>
>>> I'm surprised we never caught this through the autobuilder testing, but
>>> I guess all autobuilder machines are x86_64 based, which will not
>>> exhibit the problem.
>>
>> Yeah, I set a new autobuilder to run only MIPS builds since currently
>> there aren't many autobuild failures to look at (I needed more!), and I
>> put it on a x86 virtual machine just to also catch possible issues due
>> to building on a 32-bit host machine, and because I already had another
>> autobuilder running on a x86_64 host. And look, I have already catch one! :D
>
> Great! Do you want an account to submit your build results
> automatically to autobuild.buildroot.org?
yes, please.
Thanks,
Vincent.
> Best regards,
>
> Thomas
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Buildroot] [PATCH] libselinux: use correct definition of ARCH
2015-09-16 10:10 [Buildroot] [PATCH] libselinux: use correct definition of ARCH Vicente Olivert Riera
2015-09-16 10:39 ` Thomas Petazzoni
@ 2015-09-16 20:19 ` Thomas Petazzoni
1 sibling, 0 replies; 6+ messages in thread
From: Thomas Petazzoni @ 2015-09-16 20:19 UTC (permalink / raw)
To: buildroot
Dear Vicente Olivert Riera,
On Wed, 16 Sep 2015 11:10:03 +0100, Vicente Olivert Riera wrote:
> The Makefile of libselinux performs the following check:
>
> ARCH := $(patsubst i%86,i386,$(shell uname -m))
> ifneq (,$(filter i386,$(ARCH)))
> TLSFLAGS += -mno-tls-direct-seg-refs
> endif
>
> Which means that if the host machine is an x86, then TLSFLAGS will
> contain -mno-tls-direct-seg-refs. That command line option causes
> libselinux to fail when building it for target architectures where the
> compiler doesn't support that option, i.e. MIPS:
>
> mips-img-linux-gnu-gcc: error: unrecognized command line option
> ?-mno-tls-direct-seg-refs?
>
> So to fix that problem we can set the ARCH variable to $(KERNEL_ARCH),
> and then append it to the LIBSELINUX_MAKE_OPTS.
>
> Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com>
> ---
> package/libselinux/libselinux.mk | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks.
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2015-09-16 20:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-09-16 10:10 [Buildroot] [PATCH] libselinux: use correct definition of ARCH Vicente Olivert Riera
2015-09-16 10:39 ` Thomas Petazzoni
2015-09-16 10:46 ` Vicente Olivert Riera
2015-09-16 11:41 ` Thomas Petazzoni
2015-09-16 14:25 ` Vicente Olivert Riera
2015-09-16 20:19 ` Thomas Petazzoni
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox