Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp598107img; Fri, 22 Mar 2019 04:53:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwSx68UhpRJkD6h945yhXUlDl4QYqZ26lqT4QVDlwqDLbQnlMMtRiW5eh8Q9zJUKWegC8w8 X-Received: by 2002:a63:4542:: with SMTP id u2mr8355944pgk.291.1553255584138; Fri, 22 Mar 2019 04:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553255584; cv=none; d=google.com; s=arc-20160816; b=Th1v0xl6kDfa+WRgyMsSbPAgXnbAdzxX3Do9f4/XkzUFf2gjXTvd3+mOLR7JD85wQ5 qaWm5oFUOMoKLuXJPA1PcbjRbl5P9iX/c69MXT4Vj7VfTMon+kj+XXUOJSWRh65aYfnd 5JRg8NumDHbTxkHKDQFzu36tcQ7q1V2/OYq7UP6d5AhCtaWSUg34Y9tlntzmVrQFcUWS 3Xi8u2XIv/QEJB4P2TaSEhyynFJtiq/bhf3INVh6q26+8w/mxUtYH3IhKY9fWDNQH/ew r7+ilureh+370ebme361RXVgcQByoWveCKLqP61CjDUjeqM+vxbkwyH2KOZuZl8tnFHl Tp5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=B+mdcxIWFnBvS/n2K45qtKEf8DL9jI2wNy5kY/QJI9I=; b=MgkXVn/dg/Y82m7z5OOj1dDOrXSaucBXLm/ZRgMjNqXIKkK8wDWKmZ8NofyLx8XW5S vSBvkC/0EQiAogODE6ZFZ6U4Z0zNrZinTaBzyW/IlJMFqjuHSDM/XJMc399VqCpdK95q J2g7r4c6zNu6gc2vpcx2t4Y7MUF6Dh6ClcfXHun2nAEYVKtA3z3XajxwoJNXYPSapfjx gJe+Vc4XpgNwi1Hjqdtw9sbvxMsZCjyzet3wdtHTgyx5eCTAkx//lxf1JkYcQxoNjeDg i5JcAGs9GOwoPjxs+gxUXfPgtoFoDyGKRBlMPlOeBuyKMGMaiIZpXSawOf4m4s35HsuG J6rg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2NB6gtNg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b2si6330494pgw.161.2019.03.22.04.52.46; Fri, 22 Mar 2019 04:53:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=2NB6gtNg; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732644AbfCVLwH (ORCPT + 99 others); Fri, 22 Mar 2019 07:52:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:55934 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732850AbfCVLwC (ORCPT ); Fri, 22 Mar 2019 07:52:02 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id B465720850; Fri, 22 Mar 2019 11:52:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553255522; bh=CQHnGyDky5rtd71wjfeKVVIgLGCi2zgdd2iznhZfxXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2NB6gtNgppqhJkvY+Oz74vOg3QE3iG5l/QRCvlFPBcspmoN9x7Yb4HHNCcM8gPkrM AD4aBo1rS1WpSgc6TvDdzXKqgC0SK8+NEbT7TGqd/k3QOUioG1VCx4s6rqEFlC45Ug PSv5YN6I4VINmvQieYnMGmQeRjq8xayHZ4bnYOZo= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Finn Thain , Geert Uytterhoeven Subject: [PATCH 4.14 101/183] m68k: Add -ffreestanding to CFLAGS Date: Fri, 22 Mar 2019 12:15:29 +0100 Message-Id: <20190322111249.013350591@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111241.819468003@linuxfoundation.org> References: <20190322111241.819468003@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review X-Patchwork-Hint: ignore MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Finn Thain commit 28713169d879b67be2ef2f84dcf54905de238294 upstream. This patch fixes a build failure when using GCC 8.1: /usr/bin/ld: block/partitions/ldm.o: in function `ldm_parse_tocblock': block/partitions/ldm.c:153: undefined reference to `strcmp' This is caused by a new optimization which effectively replaces a strncmp() call with a strcmp() call. This affects a number of strncmp() call sites in the kernel. The entire class of optimizations is avoided with -fno-builtin, which gets enabled by -ffreestanding. This may avoid possible future build failures in case new optimizations appear in future compilers. I haven't done any performance measurements with this patch but I did count the function calls in a defconfig build. For example, there are now 23 more sprintf() calls and 39 fewer strcpy() calls. The effect on the other libc functions is smaller. If this harms performance we can tackle that regression by optimizing the call sites, ideally using semantic patches. That way, clang and ICC builds might benfit too. Cc: stable@vger.kernel.org Reference: https://marc.info/?l=linux-m68k&m=154514816222244&w=2 Signed-off-by: Finn Thain Signed-off-by: Geert Uytterhoeven Signed-off-by: Greg Kroah-Hartman --- arch/m68k/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) --- a/arch/m68k/Makefile +++ b/arch/m68k/Makefile @@ -58,7 +58,10 @@ cpuflags-$(CONFIG_M5206e) := $(call cc-o cpuflags-$(CONFIG_M5206) := $(call cc-option,-mcpu=5206,-m5200) KBUILD_AFLAGS += $(cpuflags-y) -KBUILD_CFLAGS += $(cpuflags-y) -pipe +KBUILD_CFLAGS += $(cpuflags-y) + +KBUILD_CFLAGS += -pipe -ffreestanding + ifdef CONFIG_MMU # without -fno-strength-reduce the 53c7xx.c driver fails ;-( KBUILD_CFLAGS += -fno-strength-reduce -ffixed-a2