All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas De Schampheleire <patrickdepinguin@gmail.com>
To: buildroot@buildroot.org
Cc: romain.naour@gmail.com, "Yann E. MORIN" <yann.morin.1998@free.fr>,
	Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
Subject: [Buildroot] [PATCHv2 4/7] perf: fix compilation in case of i386 userspace with x86_64 kernel
Date: Sat, 15 Jan 2022 21:03:02 +0100	[thread overview]
Message-ID: <20220115200306.14037-5-patrickdepinguin@gmail.com> (raw)
In-Reply-To: <20220115200306.14037-1-patrickdepinguin@gmail.com>

From: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>

If a 64-bit kernel is combined with 32-bit userspace, and this is achieved
via a multilib toolchain that defaults to 64-bit with '-m32' in
BR2_TARGET_OPTIMIZATION, the '<cross>-ld' command will still default to
64-bit output.

In this case, packages that use 'ld' directly need to be instructed to use
the correct ABI via the '-m' parameter. 'perf' is one such package.

Signed-off-by: Thomas De Schampheleire <thomas.de_schampheleire@nokia.com>
---
 package/linux-tools/linux-tool-perf.mk.in | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/package/linux-tools/linux-tool-perf.mk.in b/package/linux-tools/linux-tool-perf.mk.in
index 4e28129f50..b84b5fd415 100644
--- a/package/linux-tools/linux-tool-perf.mk.in
+++ b/package/linux-tools/linux-tool-perf.mk.in
@@ -45,6 +45,9 @@ PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf32ltsmipn32"
 else
 PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf64ltsmip"
 endif
+# case for x86 toolchain that defaults to 64-bit output
+else ifeq ($(BR2_i386):$(call qstrip,$(BR2_KERNEL_ARCH_OVERRIDE)),y:x86_64)
+PERF_MAKE_FLAGS += LD="$(TARGET_LD) -m elf_i386"
 endif
 
 # The call to backtrace() function fails for ARC, because for some
-- 
2.32.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

  parent reply	other threads:[~2022-01-15 20:04 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-15 20:02 [Buildroot] [PATCHv2 0/7] Basic support for 64-bit kernel and 32-bit userland Thomas De Schampheleire
2022-01-15 20:02 ` [Buildroot] [PATCHv2 1/7] arch: move definition of KERNEL_ARCH to Config.in.<arch> files Thomas De Schampheleire
2022-02-08 20:25   ` Arnout Vandecappelle
2022-01-15 20:03 ` [Buildroot] [PATCHv2 2/7] core: introduce NORMALIZED_ARCH as non-kernel replacement for KERNEL_ARCH Thomas De Schampheleire
2022-02-08 20:26   ` Arnout Vandecappelle
2022-01-15 20:03 ` [Buildroot] [PATCHv2 3/7] core: introduce BR2_KERNEL_ARCH_OVERRIDE Thomas De Schampheleire
2022-01-15 20:03 ` Thomas De Schampheleire [this message]
2022-01-15 20:03 ` [Buildroot] [PATCHv2 5/7] package/qemu: add support for overridden KERNEL_ARCH=x86_64 Thomas De Schampheleire
2022-01-15 20:03 ` [Buildroot] [PATCHv2 6/7] configs: add new qemu defconfig 'x86_multilib' Thomas De Schampheleire
2022-01-18 11:19   ` Thomas De Schampheleire
2022-01-18 11:51     ` Romain Naour
2022-01-18 12:02       ` Thomas De Schampheleire
2022-01-19 20:54         ` Romain Naour
2022-01-15 20:03 ` [Buildroot] [PATCHv2 7/7] linux/linux.mk: correct LINUX_ARCH_PATH for sparc64 Thomas De Schampheleire
2022-02-08 20:28   ` Arnout Vandecappelle
2022-02-08 20:49 ` [Buildroot] [PATCHv2 0/7] Basic support for 64-bit kernel and 32-bit userland Arnout Vandecappelle
2022-02-09 11:55   ` Thomas De Schampheleire
2022-07-30 19:43 ` Yann E. MORIN

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220115200306.14037-5-patrickdepinguin@gmail.com \
    --to=patrickdepinguin@gmail.com \
    --cc=buildroot@buildroot.org \
    --cc=romain.naour@gmail.com \
    --cc=thomas.de_schampheleire@nokia.com \
    --cc=yann.morin.1998@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.