From patchwork Mon Oct 26 21:15:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Krause?= X-Patchwork-Id: 536255 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 9F835141347 for ; Tue, 27 Oct 2015 08:16:19 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=embedded.rocks header.i=@embedded.rocks header.b=ZHCfCz0W; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 70B5530E98; Mon, 26 Oct 2015 21:16:18 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Dphtbk7MIEm4; Mon, 26 Oct 2015 21:16:16 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 307E031BBF; Mon, 26 Oct 2015 21:16:16 +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 C2BF31C2111 for ; Mon, 26 Oct 2015 21:16:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id B9F7F88C13 for ; Mon, 26 Oct 2015 21:16:14 +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 Et6Co+P57gHo for ; Mon, 26 Oct 2015 21:16:13 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id 88D9C88C11 for ; Mon, 26 Oct 2015 21:16:13 +0000 (UTC) Received: from dovecot03.posteo.de (dovecot03.posteo.de [172.16.0.13]) by mout01.posteo.de (Postfix) with ESMTPS id BFF7B20476 for ; Mon, 26 Oct 2015 22:16:10 +0100 (CET) Received: from mail.posteo.de (localhost [127.0.0.1]) by dovecot03.posteo.de (Postfix) with ESMTPSA id 3nl8961GYXz5vNB; Mon, 26 Oct 2015 22:16:09 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by mail.embedded.rocks (Postfix) with ESMTP id 32E53EE0081; Mon, 26 Oct 2015 22:16:09 +0100 (CET) Authentication-Results: mail.embedded.rocks (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=embedded.rocks DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embedded.rocks; h=content-transfer-encoding:content-type:content-type :mime-version:x-mailer:message-id:date:date:subject:subject:from :from:received:received; s=default; t=1445894156; x=1446498957; bh=dl8cB6q54h2aXj1capstHIBIGxSbHoBCnw2J6KGXjM4=; b=ZHCfCz0WKoYL 7nBMWkGx79COxogMAcuzx7mmuCB67pgoKrdqE9Xn9nUJ5ak9Z2OfvewKiU6Uvanx R9DVRG16ZiF8zVeNNvMjiro+7h4Vx3PouI0DUPCdHjGmsDFztB97ekBI2IqgRGyf 7DG5iTQHrarQsBb5v4yTczSlG1OXj/OR9A+c4qppeW5i4Sk14IDreA1CVAsf2X8m oQRTno/b+iYHi/0rDc8S7LKb4PXxO6Hj4/p4dGFKNbFlbJTxMiAocPRQKbaNDzDm e+09jcCIHVvvYQ4ghhPgthtsdriH+6xuUnWhqfLQsAqpba72t35TM1088pPyjSDP djhamqKfLQ== X-Virus-Scanned: Debian amavisd-new at mail.embedded.rocks Received: from mail.embedded.rocks ([127.0.0.1]) by localhost (mail.embedded.rocks [127.0.0.1]) (amavisd-new, port 10025) with ESMTP id 7XRCx2IecQ3K; Mon, 26 Oct 2015 22:15:56 +0100 (CET) Received: from nzxt.fritz.box (xd9ba43a1.dyn.telefonica.de [217.186.67.161]) (Authenticated sender: joerg.krause@embedded.rocks) by mail.embedded.rocks (Postfix) with ESMTPSA; Mon, 26 Oct 2015 22:15:56 +0100 (CET) From: =?UTF-8?q?J=C3=B6rg=20Krause?= To: buildroot@buildroot.org Date: Mon, 26 Oct 2015 22:15:51 +0100 Message-Id: <1445894151-27841-1-git-send-email-joerg.krause@embedded.rocks> X-Mailer: git-send-email 2.6.2 MIME-Version: 1.0 Cc: Thomas Petazzoni , =?UTF-8?q?Bj=C3=B8rn=20Forsman?= , "Yann E . MORIN" Subject: [Buildroot] [PATCH 1/1] package/swupdate: fix build issue with some toolchains 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" A previously attempt to fix the build issue caused a regression that prevents any plugin handlers from being registered (runtime issue). A revert of this patch has already been submitted [2]. The revert patch must be applied before this one. The fix is based on a patch from Thomas Petazzoni done for the package pv [3]. Using 'ld' directly for the 'builtin-target' (declared in Makefile.build) to compile a set of object files into one object file does not work for some toolchains (x86_64 and mips64) leading to different kind of relocation errors: * /usr/bin/i686-pc-linux-gnu-ld: Relocatable linking with relocations from format elf64-x86-64 (core/swupdate.o) to format elf32-i386 (core/built-in.o) is not supported. * /usr/bin/mips-linux-gnu-ld: handlers/raw_handler.o: endianness incompatible with that of the selected emulation * /usr/bin/mips64el-linux-ld: core/swupdate.o: ABI is incompatible with that of the selected By passing the values for 'LD' and 'ldflags-y' we ensure that 'gcc' is used to compile the 'builtin-target' target. Build config for x86_64: BR2_x86_64=y BR2_x86_corei7=y BR2_TOOLCHAIN_EXTERNAL=y BR2_TOOLCHAIN_EXTERNAL_CODESOURCERY_X86_201209=y Runtime test: $ output/build/swupdate-2015.07/swupdate -v Swupdate v2015.07.0 Licensed under GPLv2. See source distribution for detailed copyright notices. Registered handlers: rawfile raw Note that the plugin handlers are successfully registered now. Fixes: http://autobuild.buildroot.net/results/de9/de920298075d32f3de83a0cfb7417846eb833425/ http://autobuild.buildroot.net/results/975/975915aa33005806e78260bae385cd4b3e359ca8/ http://autobuild.buildroot.net/results/c54/c54e7a2ea353d95d41a1e966de0dffa7b6ac432e/ http://autobuild.buildroot.net/results/019/0198596ebfed05ab86552b628da2274d55bf42ae/ [1] https://patchwork.ozlabs.org/patch/532542/ [2] https://patchwork.ozlabs.org/patch/535408/ [3] http://git.buildroot.net/buildroot/commit/package/pv/pv.mk?id=1980bf056e16c604c1f33ce9771d725da096cfe7 Cc: Bjørn Forsman Cc: Thomas Petazzoni Cc: Yann E. MORIN Signed-off-by: Jörg Krause --- package/swupdate/swupdate.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/package/swupdate/swupdate.mk b/package/swupdate/swupdate.mk index bcdc764..0ba1e06 100644 --- a/package/swupdate/swupdate.mk +++ b/package/swupdate/swupdate.mk @@ -94,8 +94,14 @@ define SWUPDATE_KCONFIG_FIXUP_CMDS $(SWUPDATE_SET_BUILD_OPTIONS) endef +# Using 'ld' directly for the 'builtin-target' in Makefile.build to compile a +# set of object files into one object file does not work for some toolchains +# (x86_64 and mips64) leading to different kind of relocation errors. By +# passing the below values for 'LD' and 'ldflags-y', we ensure that 'gcc' is +# used to compile the 'builtin-target' target. define SWUPDATE_BUILD_CMDS - $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D) + $(TARGET_MAKE_ENV) $(SWUPDATE_MAKE_ENV) $(MAKE) -C $(@D) \ + LD="$(TARGET_CC)" ldflags-y="-Wl,-r -nostdlib" endef define SWUPDATE_INSTALL_TARGET_CMDS