From patchwork Sun Nov 17 18:41:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 1196430 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) 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=mind.be Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=mind-be.20150623.gappssmtp.com header.i=@mind-be.20150623.gappssmtp.com header.b="fDAKM9UW"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 47GLX51Qc6z9s4Y for ; Mon, 18 Nov 2019 05:41:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 58C038643F; Sun, 17 Nov 2019 18:41:22 +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 xcwfD9dO2q-r; Sun, 17 Nov 2019 18:41:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id A68BC86406; Sun, 17 Nov 2019 18:41:21 +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 7FD721BF2EB for ; Sun, 17 Nov 2019 18:41:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 74CF986406 for ; Sun, 17 Nov 2019 18:41:20 +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 0cqOjyg0JmmE for ; Sun, 17 Nov 2019 18:41:19 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by whitealder.osuosl.org (Postfix) with ESMTPS id A7D8484266 for ; Sun, 17 Nov 2019 18:41:18 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id j18so14216220wmk.1 for ; Sun, 17 Nov 2019 10:41:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mind-be.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2MxXgBJkbTPYDuQBQosz6DZxvSVexfGyIDa4/mhnCKg=; b=fDAKM9UWAA63SI714Wl2MxZFUoMsOz6EicxF0tzPUiTCvFZu3+wXdpSVp0xmQnv0B/ qZ734eleC8hMK8Px4yqjjJD1jkyTU6lUeEyvh7DPahInrZS1hJzzmrJrWdg9HSwLH08v 6wf5p178SQORFG/FNr+K7KRCiKnTH39LUF8W4WBbhKem0XDeMi0xIJb+I5SHf2SHyaAY 9mIkh50hXoObmaVkKaCjJdYY+o5ghL9ABM76+LrlZXxyQUYl/X9P7IUl6p8VWaQnwKHb 3N+JGF+FkIOe46mdE/nDIHOmRM9ZZVjHHb7+qtJzZvYYvWiJBlH6uCH2HH60lg+zKO4W LnGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=2MxXgBJkbTPYDuQBQosz6DZxvSVexfGyIDa4/mhnCKg=; b=r82Qvo0FhvG9u8omoP4Nud++VSUlmmb6Vv9TO0xbLVXETmRjhbs9ZgaIJhwFtPwkiI Z2I4Vkymn6WJ3KIu6SJ17WmDsXK8rZwiuP7dkvsLkUldMVMTzm1lpU5ZGXixSScawayi l1jtr1gkA3snf7YF4Is5IfXVeUyFhoSghnK3CZoLRhqoZis7AEzL0mhFpOL05LP1EYE7 P4pY9IefcGmzCO3oHYExnj5JXw3c9w7c9b0A/x8sTpLNerOYzoJVxgRmsZSRW6RT9NAU MpUSTUxRo+ldyxY31s48OTICcskiqk9hZsjJ6kiH5eS2onTCJaXF9ciUNXkbz89creO0 /aQw== X-Gm-Message-State: APjAAAXFLY8RgnVZw2Y8IT5LEs1T29hCOzymdYo6ZPpoycyboq7YW4m+ Z9ZXo4NPuwmHYPbg68Cq1sqKtla3kPl8ww== X-Google-Smtp-Source: APXvYqwNGRTJzGIoWsUlu8IfgZV8xOzvDXDO49fRKcSK+83ATmIAvMaDMS+IzWC0W9/ke5zwrJh0Mw== X-Received: by 2002:a1c:7e0e:: with SMTP id z14mr27274473wmc.52.1574016076512; Sun, 17 Nov 2019 10:41:16 -0800 (PST) Received: from localhost.localdomain (94-225-144-99.access.telenet.be. [94.225.144.99]) by smtp.gmail.com with ESMTPSA id y189sm17631082wmb.13.2019.11.17.10.41.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Nov 2019 10:41:15 -0800 (PST) From: "Arnout Vandecappelle (Essensium/Mind)" To: buildroot@buildroot.org Date: Sun, 17 Nov 2019 19:41:14 +0100 Message-Id: <20191117184114.1917-1-arnout@mind.be> X-Mailer: git-send-email 2.21.0 MIME-Version: 1.0 Subject: [Buildroot] [PATCH] package/kvm-unit-tests: really fix build on Arch Linux x86_64 X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Fabrice Fontaine Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" On x86_64, we use the host compiler instead of the target compiler to build kvm-unit-tests, because it is built with -m32 and our target compiler doesn't support that. However, the compiler on Arch Linux is broken: it *always* builds with -fstack-protector, even when -ffreestanding is passed. However, when -fnostdlib is passed at link time (which is normally the case when building with -ffreestanding), it is not linked with the stack-protector library. This leads to a link time error: /usr/bin/ld: x86/realmode.o: in function `print_serial_u32': .../x86/realmode.c:104: undefined reference to `__stack_chk_fail' Since the entire package is built with -ffreestanding, it doesn't support stack-protector at all. Therefore, simply pass -fno-stack-protector explicitly on x86_64 to work around the bug in Arch Linux. Commit c0ffd16e4 tried to do this, but got the condition wrong: -fno-stack-protector was passed in all cases *except* for x86_64. This commit fixes that, by inverting the condition and moving the --cross-prefix part to the else branch. Fixes: (no new autobuild failures yet) Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Cc: Fabrice Fontaine Cc: Matthew Weber Reviewed-by: Matthew Weber Tested-by: Matthew Weber --- package/kvm-unit-tests/kvm-unit-tests.mk | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/package/kvm-unit-tests/kvm-unit-tests.mk b/package/kvm-unit-tests/kvm-unit-tests.mk index bb08c0603d..2637066701 100644 --- a/package/kvm-unit-tests/kvm-unit-tests.mk +++ b/package/kvm-unit-tests/kvm-unit-tests.mk @@ -35,13 +35,14 @@ KVM_UNIT_TESTS_CONF_OPTS =\ # compiler. However, for x86-64, we use the host compiler, as # kvm-unit-tests builds 32 bit code, which Buildroot toolchains for # x86-64 cannot do. -ifneq ($(BR2_x86_64),y) -KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)" +ifeq ($(BR2_x86_64),y) # Arch Linux adds -fstack-protector even when building with -ffreestanding, but # it doesn't link with the stack-protector library when -nostdlib is passed, # which leads to a link error. Therefore, disable it explicitly to work around # this bug in Arch Linux. https://bugs.archlinux.org/task/64270 KVM_UNIT_TESTS_MAKE_OPTS += EXTRA_CFLAGS=-fno-stack-protector +else +KVM_UNIT_TESTS_CONF_OPTS += --cross-prefix="$(TARGET_CROSS)" endif define KVM_UNIT_TESTS_CONFIGURE_CMDS