From patchwork Thu Feb 18 17:23:42 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vicente Olivert Riera X-Patchwork-Id: 584831 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id 02864140BA7 for ; Fri, 19 Feb 2016 04:23:53 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0C75795B89; Thu, 18 Feb 2016 17:23:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id X0ASmmy2+l2i; Thu, 18 Feb 2016 17:23:52 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 743BF95B73; Thu, 18 Feb 2016 17:23:52 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 222AB1C0786 for ; Thu, 18 Feb 2016 17:23:51 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 1D70F95B5B for ; Thu, 18 Feb 2016 17:23:51 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id aztNl9lJe6dZ for ; Thu, 18 Feb 2016 17:23:50 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mailapp01.imgtec.com (mailapp01.imgtec.com [195.59.15.196]) by hemlock.osuosl.org (Postfix) with ESMTP id 6D4E095B82 for ; Thu, 18 Feb 2016 17:23:50 +0000 (UTC) Received: from hhmail02.hh.imgtec.org (unknown [10.100.10.20]) by Websense Email Security Gateway with ESMTPS id 04E96EB3A9258 for ; Thu, 18 Feb 2016 17:23:45 +0000 (GMT) Received: from LEMAIL01.le.imgtec.org (192.168.152.62) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 18 Feb 2016 17:23:48 +0000 Received: from vriera-linux.le.imgtec.org (192.168.154.36) by LEMAIL01.le.imgtec.org (192.168.152.62) with Microsoft SMTP Server (TLS) id 14.3.266.1; Thu, 18 Feb 2016 17:23:47 +0000 From: Vicente Olivert Riera To: Date: Thu, 18 Feb 2016 17:23:42 +0000 Message-ID: <1455816222-43031-1-git-send-email-Vincent.Riera@imgtec.com> X-Mailer: git-send-email 2.4.10 MIME-Version: 1.0 X-Originating-IP: [192.168.154.36] Subject: [Buildroot] [PATCH] perf: append endianness argument to ld when building for MIPS X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 Signed-off-by: Vicente Olivert Riera --- linux/linux-tool-perf.mk | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/linux/linux-tool-perf.mk b/linux/linux-tool-perf.mk index 07c3514..7ad6629 100644 --- a/linux/linux-tool-perf.mk +++ b/linux/linux-tool-perf.mk @@ -27,6 +27,21 @@ PERF_MAKE_FLAGS = \ WERROR=0 \ ASCIIDOC= +# 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_mipsel)$(BR2_mips64)$(BR2_mips64el),y) +ifeq ($(BR2_ENDIAN),"BIG") +PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EB" +else +PERF_MAKE_FLAGS += LD="$(TARGET_LD) -EL" +endif +endif + # The call to backtrace() function fails for ARC, because for some # reason the unwinder from libgcc returns early. Thus the usage of # backtrace() should be disabled in perf explicitly: at build time