[Buildroot] [PATCH] libselinux: use correct definition of ARCH
Thomas Petazzoni
thomas.petazzoni at free-electrons.com
Wed Sep 16 10:39:43 UTC 2015
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 at imgtec.com>
Looks good to me:
Reviewed-by: Thomas Petazzoni <thomas.petazzoni at 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
More information about the buildroot
mailing list