From patchwork Mon Apr 24 20:30:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 9697185 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E0CEC603F2 for ; Mon, 24 Apr 2017 20:31:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D39941FF61 for ; Mon, 24 Apr 2017 20:31:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id C7FCD2026B; Mon, 24 Apr 2017 20:31:21 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 488191FF61 for ; Mon, 24 Apr 2017 20:31:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:To:Subject:Message-ID:Date:From: References:In-Reply-To:MIME-Version:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SdVOuXqJ7d0BGu6KNGTKnO5ishtMUVaFvoghxGacma8=; b=BlRLKq4qwPn18y rOJ0nSO8TNOT6yvoFdCNXMN5dLgndPtqJIC8A4xJ/5m/PVpLpZAx7z6HXZT/FzGcgIj4zm1tE6qrA gH8AdGiDian4NZd5ezzijSogqazfs2jmLtRbCY894CBymeLwGMTjopUBT1bnHiok3LBOHdLB+8z0g slMPq+3b0BHG67D1CfOaD+0rIxecOwGyCWmzhrkU0KfrLOIdnUmNNR0cY90BiG1/0cPHJmgqfY6Km i+SSy8ZSZYR4J8g+uvKQ9GiQxZM+/vC0+KQEKux2nt2yyUlFtt9u5a3O4p17UQewtw6B8sIyC3gR8 OGYpgYPQ9Ifrn7Y1Wv+g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1d2kdj-00068J-VF; Mon, 24 Apr 2017 20:31:19 +0000 Received: from mail-oi0-x242.google.com ([2607:f8b0:4003:c06::242]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1d2kdg-00066p-6B for linux-arm-kernel@lists.infradead.org; Mon, 24 Apr 2017 20:31:17 +0000 Received: by mail-oi0-x242.google.com with SMTP id w12so1727289oiw.0 for ; Mon, 24 Apr 2017 13:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=0ysBNz1HWxHwzKTOTkTqvWA34UgU6qnCf5IzGa1xqO4=; b=sFNsn+Y5rVdUbK0heJ/g7yHLmxy1yeDM0ezK+lSIz8QrbfWDYMUJ9hahGJJrgpmFP/ vOZfj5ran7Xz/hPD+TJpMCcK9jvCe+MkNfTHLqP1JFtO5DdAS29g/+YKMAMT9ne+tGBy mQ6awPhTqFyTDmkqroO4rT5cs7XocxCTcUoV2L5YQvFOuum4l6daefF2BoHcPdyH79ql yhCDnvTZDFnkJj8WjX8H8fmIBFyeu8/oSrC7k0CSWkpYMmbdBs+0Y3jmME0DwdM+ssVW kmiY6nBlEsA7Ojnu3ejSyj4LN6M9K2gbRVMpIySkGjCruQy8ZLKD+TyHFQWFjhRvMEhX 4I/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=0ysBNz1HWxHwzKTOTkTqvWA34UgU6qnCf5IzGa1xqO4=; b=YXmVnE84WqAlSGK9vP8ZjjdAPHJObYBR6H4M7112KJFmcrUSStPH8wgoqIG841GK6B 2WPq4Ll7EHSyWPfxYuO9OfNYcb5Ns86PGZFyqXLiuDWbe2BgLporxV1Fm9jVyNKrow/x vDoNlljOYfRxdPfk7IjkIccKjm2YJtmzBOi107kv3Zo+qlYda9kaEAGvJSYSgykXm/Pn 7nCE88i/nxHNRyyrF6rv2LcUldEKcBZEP6E0w+HanDXJPrx0W5iV/gl8JVD+fqf4wxNs TYbNP3oKxW96BxtqNpIqspyGJt3RH5EUCCYB2XAASbMQHRWNnHq+KBCd0aDx5sT4RxrK CSSA== X-Gm-Message-State: AN3rC/7HDZE+ZsHySbwl3/fogHAKA9TPcgUCqMFEc1PmP21gxfi6AsJj eQnbdfwNkU3qEDPz15kwt2XQjVJG4w== X-Received: by 10.157.60.176 with SMTP id z45mr11138984otc.253.1493065853619; Mon, 24 Apr 2017 13:30:53 -0700 (PDT) MIME-Version: 1.0 Received: by 10.157.20.240 with HTTP; Mon, 24 Apr 2017 13:30:52 -0700 (PDT) In-Reply-To: References: <20161216105634.235457-1-arnd@arndb.de> <3302470.IDcDrWa0u6@wuerfel> From: Arnd Bergmann Date: Mon, 24 Apr 2017 22:30:52 +0200 X-Google-Sender-Auth: nEOOdWI0APpOrfsvONMYlmbVaok Message-ID: Subject: Re: [RFC] minimum gcc version for kernel: raise to gcc-4.3 or 4.6? To: "Maciej W. Rozycki" X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170424_133116_297369_309D2396 X-CRM114-Status: GOOD ( 22.33 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch , Kees Cook , linux-kbuild , kernel-build-reports@lists.linaro.org, LKML , Russell King , Geert Uytterhoeven , Andrew Morton , kvmarm@lists.cs.columbia.edu, "linux-arm-kernel@lists.infradead.org" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP On Mon, Apr 24, 2017 at 8:30 PM, Maciej W. Rozycki wrote: > On Mon, 24 Apr 2017, Arnd Bergmann wrote: > >> >> So it still fails, but only because of one compiler error that I can avoid by >> disabling that driver, and you probably use a slightly patched compiler >> version that doesn't have this particular bug, or it was a regression between >> gcc-4.1.2 and 4.1.3. > > Umm, I didn't build modules, sorry, because I don't usually use them with > those systems. However I have completed this step now and it also worked > just fine: > > $ ls -la crypto/drbg.o > -rw-r--r-- 1 macro macro 14096 Apr 24 18:59 crypto/drbg.o > $ file crypto/drbg.o > crypto/drbg.o: ELF 32-bit LSB MIPS-I relocatable, MIPS, version 1 (SYSV), not stripped > $ > > so you are likely right that either I have a patch applied to my 4.1.2 > build that has somehow fixed the ICE or it is a 4.1.3 regression (or a bad > patch in your 4.1.3 build). Ok. > BTW I do see these `may be used uninitialized' warnings just as Geert > does and even have a local patch, which I have neglected to submit, for a > 64-bit configuration (`decstation_defconfig' is 32-bit) where in a single > place -Werror turns it into a build failure. I do not consider it a big > issue though, and might even wrap that patch up and submit sometime. I'd recommend dropping that -Werror from mips and the other few architectures that have it, or maybe wrapping it in a Kconfig symbol that is disabled by default. It would also take care of ==> build/mips/bmips_be_defconfig/log <== cc1: warnings being treated as errors /git/arm-soc/arch/mips/bmips/setup.c:37: error: integer constant is too large for 'long' type As mentioned, we can also turn off the warnings by default and let Geert turn them on again: # Tell gcc to never replace conditional load with a non-conditional one KBUILD_CFLAGS += $(call cc-option,--param=allow-store-data-races=0) I've built the remaining defconfigs in the meantime (linux-4.11-rc8, gcc-4.1.3, ARCH=mips) and got 38 builds with warnings and 20 failed builds. There are at least six different build failures and only one ICE among them (only in decstation_defconfig). With gcc-4.3 this is only slightly better: 18 failed build, 20 with warnings and 20 without warnings. With linux-4.3, I saw this failure on 32 defconfigs, and you fixed that in linux-4.7 with e49d38488515 ("MIPS: MSA: Fix a link error on `_init_msa_upper' with older GCC"): arch/mips/built-in.o: In function `enable_restore_fp_context': traps.c:(.text+0xbefc): undefined reference to `_init_msa_upper' traps.c:(.text+0xbfc0): undefined reference to `_init_msa_upper' With gcc-4.9, all mips defconfigs now build without warnings. For the other architectures in linux-4.11-rc8 can actually build with sparc-gcc-4.1, afaict this was a bug that impacted all compilers up to gcc-4.7 and a workaround was added recently. In turn, parisc-gcc-4.1 no longer works on linux-4.11, so we still have only three architectures that can build their 'defconfig' with the old compiler, plus the majority of the mips config files. So while overall I still think that gcc-4.1 is rather broken, it seems that you have it well under control on both mips and m68k. It's possible that some other people use patched gcc-4.1 or only build special configurations on further architectures that I found to be broken with vanilla toolchains and the regular defconfig. How about this approach then: - To keep it simple, we update the README.rst to say that a minimum gcc-4.3 is required, while recommending gcc-4.9 for all architectures - Support for gcc-4.0 and earlier gets removed from linux/compiler.h, and instead we add a summary of what I found, explaining that gcc-4.1 has active users on a few architectures. - We make the Makefile show a warning once during compilation for gcc earlier than 4.3. Arnd diff --git a/Makefile b/Makefile index 779302695453..2528f60fb9ab 100644 --- a/Makefile +++ b/Makefile @@ -647,8 +647,10 @@ KBUILD_CFLAGS += -O2 endif endif -KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0409, \ - $(call cc-disable-warning,maybe-uninitialized,)) +KBUILD_CFLAGS += $(call cc-ifversion, -lt, 0408, \ + $(call cc-disable-warning,uninitialized, \ + $(call cc-ifversion, -lt, 0409, \ + $(call cc-disable-warning,maybe-uninitialized,))))