public inbox for openembedded-core@lists.openembedded.org
 help / color / mirror / Atom feed
From: Sujith H <sujith.h@gmail.com>
To: openembedded-core@lists.openembedded.org
Cc: Sujith Haridasan <Sujith_Haridasan@mentor.com>,
	Christopher Larson <chris_larson@mentor.com>
Subject: [PATCH] perf: Fix to obey LD failure on qemux86-64
Date: Thu,  8 Sep 2016 14:18:12 +0530	[thread overview]
Message-ID: <1473324492-13761-1-git-send-email-sujith.h@gmail.com> (raw)

From: Christopher Larson <chris_larson@mentor.com>

When built on an i686 host for qemux86-64 without the
fix to obey LD and it fails:

/scratch/dogwood/toolchains/x86_64/bin/i686-pc-linux-gnu-ld:
Relocatable linking with relocations from format elf64-x86-64
(/scratch/dogwood/perf-ld-test/build/tmp/work/qemux86_64-mel-linux/perf/1.0-r9/perf-1.0/fs/fs.o)
to format elf32-i386 (/scratch/dogwood/perf-ld-test/build/tmp/work/qemux86_64-mel-linux/perf/1.0-r9/perf-1.0/fs/libapi-in.o)
is not supported

This is because LD includes HOST_LD_ARCH, which contains TUNE_LDARGS,
which is -m elf32_x86_64 for x86_64. Without that, direct use of ld will fail.

Signed-off-by: Christopher Larson <chris_larson@mentor.com>
Signed-off-by: Sujith Haridasan <Sujith_Haridasan@mentor.com>
---
 meta/recipes-kernel/perf/perf.bb | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/meta/recipes-kernel/perf/perf.bb b/meta/recipes-kernel/perf/perf.bb
index 88e3a0a..85fe0ea 100644
--- a/meta/recipes-kernel/perf/perf.bb
+++ b/meta/recipes-kernel/perf/perf.bb
@@ -79,6 +79,7 @@ EXTRA_OEMAKE = '\
     ARCH=${ARCH} \
     CC="${CC}" \
     AR="${AR}" \
+    LD="${LD}" \
     EXTRA_CFLAGS="-ldw" \
     perfexecdir=${libexecdir} \
     NO_GTK2=1 ${TUI_DEFINES} NO_DWARF=1 ${LIBUNWIND_DEFINES} \
@@ -98,6 +99,14 @@ EXTRA_OEMAKE += "\
     'infodir=${@os.path.relpath(infodir, prefix)}' \
 "
 
+do_configure_prepend () {
+    for makefile in "${S}/tools/perf/Makefile.perf" \
+                    "${S}/tools/lib/api/Makefile"; do
+        if [ -e "$makefile" ]; then
+            sed -i 's,LD = $(CROSS_COMPILE)ld,#LD,' "$makefile"
+        fi
+    done
+}
 
 do_compile() {
 	# Linux kernel build system is expected to do the right thing
-- 
1.9.1



             reply	other threads:[~2016-09-08  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-08  8:48 Sujith H [this message]
  -- strict thread matches above, loose matches on Subject: below --
2016-09-21  5:17 [PATCH] perf: Fix to obey LD failure on qemux86-64 Sujith H
2016-09-26  6:10 ` sujith h
2016-09-26  9:32   ` sujith h

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=1473324492-13761-1-git-send-email-sujith.h@gmail.com \
    --to=sujith.h@gmail.com \
    --cc=Sujith_Haridasan@mentor.com \
    --cc=chris_larson@mentor.com \
    --cc=openembedded-core@lists.openembedded.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox