libselinux: use correct definition of ARCH
PATCH 1/1 libselinux: use correct definition of ARCH
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.
--- package/libselinux/libselinux.mk | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
package/libselinux/libselinux.mk +2 -1
@@ -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
Signature · 1 line
1.7.1
PATCH 1/1 libselinux: use correct definition of ARCH
Dear Vicente Olivert Riera,
Quoted 12 lines · Vicente Olivert Riera
The
Makefileof libselinux performs the following check:ARCH := $(patsubst i%86,i386,$(shell uname -m))
ifneq (,$(filter i386,$(ARCH)))
TLSFLAGS += -mno-tls-direct-seg-refs
endifWhich 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:
Quoted 7 lines
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 <[email protected]>
Looks good to me:
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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 libselinux: use correct definition of ARCH
Dear Thomas Petazzoni,
Quoted 23 lines · Thomas Petazzoni
Dear Vicente Olivert Riera,
Quoted 12 lines · Vicente Olivert Riera
The
Makefileof libselinux performs the following check:ARCH := $(patsubst i%86,i386,$(shell uname -m))
ifneq (,$(filter i386,$(ARCH)))
TLSFLAGS += -mno-tls-direct-seg-refs
endifWhich 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:
Quoted 7 lines
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 <[email protected]>
Quoted 7 lines
Looks good to me:
Reviewed-by Thomas Petazzoni <[email protected]>I'm surprised we never caught this through the autobuilder testing, but I guess all autobuilder machines are
x86_64based, 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.
Quoted 4 lines
Thanks!
Thomas
PATCH 1/1 libselinux: use correct definition of ARCH
Hello,
Quoted 9 lines · Vicente Olivert Riera
Quoted 3 lines
I'm surprised we never caught this through the autobuilder testing, but I guess all autobuilder machines are
x86_64based, 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_64host. 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
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com
PATCH 1/1 libselinux: use correct definition of ARCH
Hi Thomas,
Quoted 8 lines · Thomas Petazzoni
Hello,
Quoted 4 lines · Vicente Olivert Riera
Quoted 3 lines
I'm surprised we never caught this through the autobuilder testing, but I guess all autobuilder machines are
x86_64based, which will not exhibit the problem.
Quoted 8 lines
Quoted 5 lines
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_64host. And look, I have already catch one! :DGreat! Do you want an account to submit your build results automatically to autobuild.buildroot.org?
yes, please.
Thanks,
Vincent.
Quoted 4 lines
Best regards,
Thomas
Thomas Petazzoni
AppliedPATCH 1/1 libselinux: use correct definition of ARCH
In reply to Vicente Olivert RieraDear Vicente Olivert Riera,
Quoted 15 lines · Vicente Olivert Riera
The
Makefileof libselinux performs the following check:ARCH := $(patsubst i%86,i386,$(shell uname -m))
ifneq (,$(filter i386,$(ARCH)))
TLSFLAGS += -mno-tls-direct-seg-refs
endifWhich 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?
Quoted 7 lines
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 <[email protected]>--- package/libselinux/libselinux.mk | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Applied, thanks.
Thomas
Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons Embedded Linux, Kernel and Android engineering http://free-electrons.com