0

I tried to use the defconfig of raspberrypi2 of buildroot then I run the command make.Until now all things are good,but when I added some target packages then I run make I got this error:

arm-buildroot-linux-uclibcgnueabihf-gcc: erreur: unrecognized command line option ‘-mno-tls-direct-seg-refs’

this link contain all the messages that I got on my console:http://pastebin.com/mgVthm8z

  • Please report this to BR's mailing list. Btw. have you tried external toolchain, i.e. Linaro or something else? – yegorich Sep 27 '15 at 08:34

2 Answers2

0

The -mno-tls-direct-seg-refs option is a x86 specific option, that libselinux is trying to use with an ARM toolchain. Which obviously cannot work. Seems like a bug in the libselinux package. As Yegor said, please report this to the Buildroot mailing list or bug tracker.

Thomas Petazzoni
  • 5,636
  • 17
  • 25
-1

I got this:

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

link: https://patchwork.ozlabs.org/patch/518324/

plant
  • 31
  • 2