From patchwork Sat Jun 2 14:34:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Romain Naour X-Patchwork-Id: 924520 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=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.b="b0fmVkl3"; dkim-atps=neutral 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 40ykH60Dfyz9s02 for ; Sun, 3 Jun 2018 00:34:25 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7D43184FCC; Sat, 2 Jun 2018 14:34: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 zM+WSZp7KPad; Sat, 2 Jun 2018 14:34:20 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 9BAC0836B1; Sat, 2 Jun 2018 14:34:20 +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 0AB701C159A for ; Sat, 2 Jun 2018 14:34:20 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E40CB81279 for ; Sat, 2 Jun 2018 14:34:17 +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 IQqDCsPEDiVO for ; Sat, 2 Jun 2018 14:34:17 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f66.google.com (mail-wm0-f66.google.com [74.125.82.66]) by whitealder.osuosl.org (Postfix) with ESMTPS id 106888180D for ; Sat, 2 Jun 2018 14:34:17 +0000 (UTC) Received: by mail-wm0-f66.google.com with SMTP id o13-v6so7827096wmf.4 for ; Sat, 02 Jun 2018 07:34:16 -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; bh=4OznDa+oMw+LQaFpjPVj/71XR0JuY349cDMAZo5hglU=; b=b0fmVkl3CJ+55BGCyMKn8gFfjsMjmzVdDHDDR/2EdRnMbhm4mU+TYU8nx7UUgv9sth ru6zHTSM1vNzUaC4FckiBSG2/Gfw81Ic9uC+DR561wa6fCArzfqzovKVi6fT0oHxB14Y Dh34eVTGtpcke5Kyg+j6fgsTEGPdsTx7cNGy2g4K+5cbRCnkHknWPoyTctg9u0zYK46p Wsyjzv901OwbBp6C0QLDHL0AiZYc3VpcQnKbWOAb0VTRPZpUw7F12LEsB/DLONU+NevH DON0/biRXBsXydPQ6j5G+AKOMXRrWcDSBvnydpqPhvfQkPDOpaFBq5+s/8YfG7/mPGcH r0Gg== 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; bh=4OznDa+oMw+LQaFpjPVj/71XR0JuY349cDMAZo5hglU=; b=WlcPltKNuLEpPrR+c3RW+YR29Sf6C7iw9G6H5uYbPeYkrxIl6YC87NWjI90s8HxMcU tWfOZFn167hq8XdT1NgCUqvsVXkopMVizyaBwKttFBy75Jy6B78LnWpkIM7EDkj3gAqq RXKBAVAKdefotc7NU0WaiBejrfD4DdyA1OEIvsDYQrqXefqaeiXIGCcCTVLhNjwt2nDB L+ZSgbwXHBEkk6zVv3GFZmdwf/LLM8pJeiyfqf/zFUkcHyS12PMwIuYozOQGB1sUWxsZ cuFFHZAjWZ/gRRcLFeCIPpa8ygWf3t3AF9P3auLqjKjWjfyEqzKxILW3Zbz/qnigm58p Ld+A== X-Gm-Message-State: APt69E1P3/9xvW3VINuY9Fd8WP8EomwBnW4IMj83tHdhUjSDLAz/ANua Bdqett+tn8Sx6dzMVHjH4ksFO9hl X-Google-Smtp-Source: ADUXVKJUmh9jD9/ejmMijAnptA1ICURR6WHBgI/dhrpoeYc6hCAPeSSVMc4hFuNDEo8XfIaB+UyjgQ== X-Received: by 2002:a1c:6545:: with SMTP id z66-v6mr4769340wmb.86.1527950055258; Sat, 02 Jun 2018 07:34:15 -0700 (PDT) Received: from adeos.home (2a01cb00054978001a46adb371a118d7.ipv6.abo.wanadoo.fr. [2a01:cb00:549:7800:1a46:adb3:71a1:18d7]) by smtp.gmail.com with ESMTPSA id k3-v6sm42213045wri.28.2018.06.02.07.34.14 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 02 Jun 2018 07:34:14 -0700 (PDT) From: Romain Naour To: buildroot@buildroot.org Date: Sat, 2 Jun 2018 16:34:07 +0200 Message-Id: <20180602143407.20985-1-romain.naour@gmail.com> X-Mailer: git-send-email 2.14.3 Subject: [Buildroot] [PATCH v2] linux: disable attribute alias with gcc >= 8.1 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: Romain Naour , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" gcc-8 started warning about function aliases that have a non-matching prototype. This seems rather useful in general, but it causes tons of warnings in the Linux kernel, where we rely on abusing those aliases for system call entry points, in order to sanitze the arguments passed from user space in registers. See https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82435 Disable the attribute-alias warning introduced by gcc-8 by adding -Wno-attribute-alias to KCFLAGS. Signed-off-by: Romain Naour Cc: Thomas Petazzoni --- v2: use KCFLAGS instead of KBUILD_CFLAGS (ThomasP) Fixes most of build errors reported by toolchains-builder on Gitlab. https://gitlab.com/free-electrons/toolchains-builder/pipelines/22921464 --- linux/linux.mk | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/linux/linux.mk b/linux/linux.mk index 6b5f5344ed..f6cf005196 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -121,6 +121,15 @@ LINUX_MAKE_ENV += \ KBUILD_BUILD_TIMESTAMP="$(shell LC_ALL=C date -d @$(SOURCE_DATE_EPOCH))" endif +# gcc-8 started warning about function aliases that have a non-matching prototype. +# This seems rather useful in general, but it causes tons of warnings in the Linux kernel, +# where we rely on abusing those aliases for system call entry points, in order to sanitze +# the arguments passed from user space in registers. +# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82435 +ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y) +LINUX_MAKE_ENV += KCFLAGS=-Wno-attribute-alias +endif + # Get the real Linux version, which tells us where kernel modules are # going to be installed in the target filesystem. LINUX_VERSION_PROBED = `$(MAKE) $(LINUX_MAKE_FLAGS) -C $(LINUX_DIR) --no-print-directory -s kernelrelease 2>/dev/null`