summaryrefslogtreecommitdiffstats
path: root/package/linux-tools
diff options
context:
space:
mode:
authorVicente Olivert Riera <Vincent.Riera@imgtec.com>2017-02-17 10:59:05 +0000
committerArnout Vandecappelle (Essensium/Mind) <arnout@mind.be>2017-10-23 18:42:27 +0200
commitf574a8eba67a38d1e0e681ace57b44acff36310f (patch)
treed28e001409b2b464f649ffb6c1dfefc5b6e49942 /package/linux-tools
parent32caa954b032f9728231c85c8703fe5cad4567d4 (diff)
downloadbuildroot-f574a8eba67a38d1e0e681ace57b44acff36310f.tar.gz
buildroot-f574a8eba67a38d1e0e681ace57b44acff36310f.zip
linux-tools/perf: fix build for MIPS by using the right emulation on LD
Passing just the endianness flag to LD is not enough. We need to pass the right emulation flag which will set everything for us, not only the endianness. Signed-off-by: Vicente Olivert Riera <Vincent.Riera@imgtec.com> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
Diffstat (limited to 'package/linux-tools')
-rw-r--r--package/linux-tools/linux-tool-perf.mk.in30
1 files changed, 19 insertions, 11 deletions
diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index 16f3a58cc4..69492ba8da 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -28,17 +28,25 @@ PERF_MAKE_FLAGS = \
NO_LIBPYTHON=1 \
NO_LIBBIONIC=1
-# We need to pass an argument to ld for setting the endianness when
-# building it for MIPS architecture, otherwise the default one will
-# always be used (which is big endian) and the compilation for little
-# endian will always fail showing an error like this one:
-# LD foo.o
-# mips-linux-gnu-ld: foo.o: compiled for a little endian system and
-# target is big endian
-ifeq ($(BR2_mips)$(BR2_mips64),y)
-PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EB"
-else ifeq ($(BR2_mipsel)$(BR2_mips64el),y)
-PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EL"
+# We need to pass an argument to ld for setting the emulation when
+# building for MIPS architecture, otherwise the default one will always
+# be used and the compilation for most variants will fail.
+ifeq ($(BR2_mips),y)
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32btsmip"
+else ifeq ($(BR2_mipsel),y)
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmip"
+else ifeq ($(BR2_mips64),y)
+ifeq ($(BR2_MIPS_NABI32),y)
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32btsmipn32"
+else
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64btsmip"
+endif
+else ifeq ($(BR2_mips64el),y)
+ifeq ($(BR2_MIPS_NABI32),y)
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmipn32"
+else
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64ltsmip"
+endif
endif
# The call to backtrace() function fails for ARC, because for some
OpenPOWER on IntegriCloud