From patchwork Tue Oct 6 20:29:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 1377651 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.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=OGvJ8wQM; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4C5TbM0y28z9sTD for ; Wed, 7 Oct 2020 07:29:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 3A9E687129; Tue, 6 Oct 2020 20:29:33 +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 5T1ZE7BHejxP; Tue, 6 Oct 2020 20:29:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 9037A8712B; Tue, 6 Oct 2020 20:29:32 +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 D7C331BF28E for ; Tue, 6 Oct 2020 20:29:31 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id D139B87129 for ; Tue, 6 Oct 2020 20:29:31 +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 v0RM9+AGzNxG for ; Tue, 6 Oct 2020 20:29:30 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm1-f41.google.com (mail-wm1-f41.google.com [209.85.128.41]) by hemlock.osuosl.org (Postfix) with ESMTPS id 50C858712B for ; Tue, 6 Oct 2020 20:29:30 +0000 (UTC) Received: by mail-wm1-f41.google.com with SMTP id f21so156638wml.3 for ; Tue, 06 Oct 2020 13:29:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=u6IFB1cJyQA24ELPPFO3qXPqggGAQrOkEiFYp6a+cc0=; b=OGvJ8wQMD5XPQ5TPCbmmNipYfPXtioYWa6g+eyO1nP7iSkdVWSwIWZ9Xyh+/cgJXVT 21kRHFBI5b7X0tFJc3t9lYTnB7tbVJgblnglddby8GcB1DjMuSSCmyuFvEr1LQW/S/qv YQhijOuHbjcOfOqbhsFbflc8jfiI0p/+6m3HFZ3ZTdRtUxAYYm5k8ZcDfiDZDEXpgfn7 wUEPc/ek5xx94rjWSaxoGSlk5IP2WuIIg1eSXkYmZjlMlDPSAo3mxaR/O5AfufSruuvz 6BqKyXUKLChJ+6A43aiusL1INVc8iWbw0L6E6PhuU235goNSDcEn0bwhZz5V0yAQ48g/ X34Q== 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=u6IFB1cJyQA24ELPPFO3qXPqggGAQrOkEiFYp6a+cc0=; b=aEybZeNri6QgOBvaRkZZA2bJF+M/jdgiYxrHADIPXb793sJZ6ShJAvZYDAzDklPz3C mYo+QiCceYuKvEHE/PEdlktOW4Vt7LwEF/OGNeU73t/izTkdstT0oZxCsRc+t0H7CJFr XSAkdeMiHv/i6z0oQ65MMag0vj1tEiJg5SeB/6AzqsZ7PN/CCtfJ0MNNKtfgpHtRvI3B /4Icg06W72+qc4WHXr3mqy4eFVgjNGFXqvsgOLDaBJT5Zh4Np4A6lmWIQzPcJxvqDS3p alU+K78gh7UaBG685xbC4v5b5ono9yV0RaVubaOELDga7pHATULTIT2xbVS8M7jl0/I4 icEg== X-Gm-Message-State: AOAM531ahvCaMtmE8aFczHzYtoIGTLojMtAcqOrvIpwMsNBPDXyLIbAy 1OHZ5PeEKBohdEzyV8BlMw+pbSiGIQA= X-Google-Smtp-Source: ABdhPJyJIWZNTAkJoaLOjIufsBeeacKTVq2mdFx9fvs4BeTuZrAbNKMTAhDMC5Q3dMUQCaz0lVBvsg== X-Received: by 2002:a7b:c307:: with SMTP id k7mr6929995wmj.31.1602016168515; Tue, 06 Oct 2020 13:29:28 -0700 (PDT) Received: from localhost.localdomain (2a01cb058f8a18003dbee9eed79eb521.ipv6.abo.wanadoo.fr. [2a01:cb05:8f8a:1800:3dbe:e9ee:d79e:b521]) by smtp.gmail.com with ESMTPSA id j1sm4227498wrc.28.2020.10.06.13.29.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 06 Oct 2020 13:29:27 -0700 (PDT) From: Romain Naour To: buildroot@buildroot.org Date: Tue, 6 Oct 2020 22:29:20 +0200 Message-Id: <20201006202920.592493-1-romain.naour@gmail.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Subject: [Buildroot] [PATCHv2] toolchain-wrapper: Disable -ftree-loop-distribute-patterns when building for microblaze with gcc >= 10 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: Romain Naour , Thomas Petazzoni Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" GCC 10 now enable by default -ftree-loop-distribute-patterns at -O2 or -Os optimization level instead of -O3, see commit [1]. Due to this change, the microblaze kernel doesn't boot (as reported by toolchain-builder project). The gcc docs between version 9 and 10 has been updated accordingly [2] [3] but there no word about this change in the gcc 10 changelog [4]. Fixes microblazebe: https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359536 (glibc) https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359538 (musl) https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359540 (uClubc-ng) Fixes microblazeel: https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359542 (glibc) https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359544 (musl) https://gitlab.com/bootlin/toolchains-builder/-/jobs/729359546 (uClibc-ng) This has been reported upsteam [5]. [1] https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd [2] https://gcc.gnu.org/onlinedocs/gcc-9.3.0/gcc/Optimize-Options.html#Optimize-Options [3] https://gcc.gnu.org/onlinedocs/gcc-10.2.0/gcc/Optimize-Options.html#Optimize-Options [4] https://gcc.gnu.org/gcc-10/changes.html [5] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208 Signed-off-by: Romain Naour Cc: Thomas Petazzoni --- It's not clear if building the kernel with gcc 9 and -O3 trigger this issue. It has been noticed by the change from [1]. v2: move -fno-tree-loop-distribute-patterns to the toolchain-wrapper (Arnout). --- toolchain/toolchain-wrapper.mk | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/toolchain/toolchain-wrapper.mk b/toolchain/toolchain-wrapper.mk index f1312c5c7f..8b551e3a18 100644 --- a/toolchain/toolchain-wrapper.mk +++ b/toolchain/toolchain-wrapper.mk @@ -33,6 +33,14 @@ TOOLCHAIN_WRAPPER_OPTS += -DBR_NEED_SOURCE_DATE_EPOCH endif endif +# Disable -ftree-loop-distribute-patterns on microblaze to +# workaround a compiler bug with gcc 10 and -O2, -Os or -O3. +# https://gcc.gnu.org/git/?p=gcc.git;a=commitdiff;h=5879ab5fafedc8f6f9bfe95a4cf8501b0df90edd +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97208 +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_10)$(BR2_microblaze),yy) +TOOLCHAIN_WRAPPER_OPTS += -fno-tree-loop-distribute-patterns +endif + # We create a list like '"-mfoo", "-mbar", "-mbarfoo"' so that each flag is a # separate argument when used in execv() by the toolchain wrapper. TOOLCHAIN_WRAPPER_ARGS += \