Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp580059img; Fri, 22 Mar 2019 04:28:04 -0700 (PDT) X-Google-Smtp-Source: APXvYqwpggKe9ubwt9DCykZOBjCPNXhWkc6MLFu+S7GrKiPh7h0lXBNbn9divFmtwkS0ui2Uw/OD X-Received: by 2002:a62:a515:: with SMTP id v21mr977373pfm.41.1553254084281; Fri, 22 Mar 2019 04:28:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553254084; cv=none; d=google.com; s=arc-20160816; b=PaCprLXsZdF6HkaQ3ama/7OTkDFFKkbOTXffzf+mAJYf9HzYM/L+skygTAUHxdgX+s rYW/U1DGpnvLvOFhUp4HH2Uwc58djaLtML9YkwMsLxjUU5iMGFW/LCdmF3IvmyLZ4JcN 5TiQ/P+tAWUpOWx9iAFlQkp4kanwi0GM/N7SXFJuaswQv0lKLCIoVU2kDbepaSWt/0QJ jouVKVOeCtBQlVQTvzXIhPUsPL5Aog5k9IT0Falwgkw14sCPdxjzReSjdoS5SsVU/dkX KfpJdIWheu1ELZl/6J0A4dAW2Rka7M53YJx3Fikps2nbd8AxCFQ++7GRLxyODlhUM2Az vJhg== 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=EWabi46Wm9EPya2sJ0XPQ02rIeiTcijkUJyFADxV9eo=; b=ydIcUF4IJHTz3K3tqRCvoy1zPa3plElg18EFdz3udany+YX0+0yB7G591yCsOTKLCr WKQKTvxF/cCRIaJNWiCupP21S7CcwaFdSgTrGGwb3TGfSZVa47YeDuA5anmw34yX1p6q NpQtDZxTk01MSf1WwGyI2B1iyVUaz5ZrMSYEO2KKw7rB43zkNBoPdUlMRa+EZHXLSBpc Ra0+JUKZI8yP+WX2Qd/LdXEgN1Mlg7NgPMqRmAVWYhK/PM+2dZNuTnuEf5sRJPrMLSRq o6vg9etVD8lgX50kJuPIqdSzlVgE5p5W7O58orDSmLzElKVy9LGZXpnuqAr241bQhBcR QXYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="vOPa3c/z"; 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 b17si6609672pls.181.2019.03.22.04.27.49; Fri, 22 Mar 2019 04:28: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="vOPa3c/z"; 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 S1729407AbfCVL0W (ORCPT + 99 others); Fri, 22 Mar 2019 07:26:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:54050 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727786AbfCVL0S (ORCPT ); Fri, 22 Mar 2019 07:26:18 -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 224B7218B0; Fri, 22 Mar 2019 11:26:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1553253977; bh=MYz0L0wmgRpSxXtb2xl6yWYJ3X3t0i0A92e92+9knFI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vOPa3c/zmwA3L/8R1Wi4rmmZNOjyeNrZ73yl3+u0qGJFr9VKmV0uHniRZBvYZFUwt Nffju1N01mY/eRMyQzDb4DgbkL133wDMtwh1xf2+GfmT5CPEHv9vB9FpX72u8CnsjL vmx51B+meBOp2S2lk3vKyA8TSn+D7s09fnK49kXU= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Finn Thain , Geert Uytterhoeven Subject: [PATCH 3.18 114/134] m68k: Add -ffreestanding to CFLAGS Date: Fri, 22 Mar 2019 12:15:27 +0100 Message-Id: <20190322111218.567488238@linuxfoundation.org> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190322111210.465931067@linuxfoundation.org> References: <20190322111210.465931067@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 3.18-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 @@ -59,7 +59,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