From patchwork Tue Apr 3 19:05:02 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Baruch Siach X-Patchwork-Id: 894735 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=tkos.co.il Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Fz8H1rqlz9ryG for ; Wed, 4 Apr 2018 05:06:06 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id EC70C8A3C8; Tue, 3 Apr 2018 19:06:01 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IKNqDfLYg06r; Tue, 3 Apr 2018 19:05:59 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 7C0978A3C3; Tue, 3 Apr 2018 19:05:59 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 037881C039A for ; Tue, 3 Apr 2018 19:05:58 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 004488A3C3 for ; Tue, 3 Apr 2018 19:05:58 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id hLFc72qqf0E4 for ; Tue, 3 Apr 2018 19:05:56 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mx.tkos.co.il (guitar.tcltek.co.il [192.115.133.116]) by whitealder.osuosl.org (Postfix) with ESMTPS id C52098A3C0 for ; Tue, 3 Apr 2018 19:05:55 +0000 (UTC) Received: from tarshish.tkos.co.il (unknown [10.0.8.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx.tkos.co.il (Postfix) with ESMTPSA id 34AD144047B; Tue, 3 Apr 2018 22:05:22 +0300 (IDT) From: Baruch Siach To: buildroot@busybox.net Date: Tue, 3 Apr 2018 22:05:02 +0300 Message-Id: <399872a6c84372d78d1ed93e337d2e858456610b.1522782302.git.baruch@tkos.co.il> X-Mailer: git-send-email 2.16.3 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] libbsd: fix build for openrisc with uClibc X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Yann E . MORIN" Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Commit d879be30495 (package/libbsd: enable for non-glibc toolchains) enabled libbsd for openrisc. Unfortunately uClibc does not define the EM_OPENRISC macro that libbsd expects for ELF e_machine ID. Add patch making libbsd fallback to the equivalent EM_OR1K macro that uClibc does provide. Fixes: http://autobuild.buildroot.net/results/2f5/2f51eebe5964e8f1be3ecd2032e7d7837bf98b84/ Cc: Waldemar Brodkorb Cc: Yann E. MORIN Cc: Jörg Krause Signed-off-by: Baruch Siach --- .../0002-Fix-build-for-openrisc-with-uClibc.patch | 48 ++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch diff --git a/package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch b/package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch new file mode 100644 index 000000000000..1b28df5a8beb --- /dev/null +++ b/package/libbsd/0002-Fix-build-for-openrisc-with-uClibc.patch @@ -0,0 +1,48 @@ +From aa902671bf1e0e808fd994bd6b403d70af7ab6dd Mon Sep 17 00:00:00 2001 +From: Baruch Siach +Date: Tue, 3 Apr 2018 20:02:14 +0300 +Subject: [PATCH] Fix build for openrisc with uClibc +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +uClibc defines EM_OR1K instead of EM_OPENRISC for the OpenRISC ELF +e_machine ID. Use EM_OR1K when EM_OPENRISC is not defined. + +This fixes the following build failure: + +In file included from nlist.c:44:0: +nlist.c: In function ‘__elf_is_okay__’: +local-elf.h:224:23: error: ‘EM_OPENRISC’ undeclared (first use in this function) + #define ELF_TARG_MACH EM_OPENRISC + ^ +nlist.c:77:26: note: in expansion of macro ‘ELF_TARG_MACH’ + if (ehdr->e_machine == ELF_TARG_MACH && + ^ + +Signed-off-by: Baruch Siach +--- +Upstream status: sent to libbsd@lists.freedesktop.org + + src/local-elf.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/local-elf.h b/src/local-elf.h +index 1faf182f87d7..79f7d026f6c9 100644 +--- a/src/local-elf.h ++++ b/src/local-elf.h +@@ -221,7 +221,11 @@ + + #elif defined(__or1k__) + ++#if defined(EM_OPENRISC) + #define ELF_TARG_MACH EM_OPENRISC ++#else ++#define ELF_TARG_MACH EM_OR1K ++#endif + #define ELF_TARG_CLASS ELFCLASS32 + #define ELF_TARG_DATA ELFDATA2MSB + +-- +2.16.3 +