Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp698881pxa; Wed, 19 Aug 2020 12:20:41 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwZct7QeLtPYf0WKlmh54e3ghTCVeGmIyFwD+vAUvJWVNDkCTDRQ4ez0vqmxAimr3z3ADaT X-Received: by 2002:a05:6402:b45:: with SMTP id bx5mr26522081edb.214.1597864841225; Wed, 19 Aug 2020 12:20:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597864841; cv=none; d=google.com; s=arc-20160816; b=LbKDEuT2gqeqlnnwUb0LCDS2wJCVqgEs8AxDRY1iHdeAamuEME7CKwwAvQHiE0GVrY ZARnHULs48O47zgEwUT0SCvMqsAEzkPdkBF1NycSttQurzAl5wIC2iT0FWL8/AisLmdT TuUdrltmxKFtkujA4C2ZvKkBU5hl9+1hsbwnSm4UWsOF4/eCGCLs6mECSGfE7YbQtSD8 DEAIfPJQ4lRRnHMDnf479RBkqD0tr81DPmjIdP/7Mj60Mxxmw9SvlGakB6xi9flFY0by 8YfH3oW0w7dlfmz0kD73dJpCwG38xz9KYKI4Dfd+sAG0njtqCmT0pXeLP76IJ5/9Ms7Z CLtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:from:subject:references :mime-version:message-id:in-reply-to:date:dkim-signature; bh=G8ovRmWPY2eQRm47H6TIcE569Ii4rdR2xUKKDLx0xDw=; b=UJkVXZu3lVigF5BH3SOMp214KxdBdidKDlZjTEMSh9GQp/6KW9c5WyRkCYcwV7pXnw uRTObthteSHK7bpwtDTz97RPQFHpnEoB/5xgjT/KhhObJdxVv/u0JF/AbB45RNK1ejuw mElzAXKsqG1MaZZhHxFIV3z6ii4bRbUNOw13V9yUV2BbQje1HBj3tm+jZp7VJV+gwUMn lshYaLCmE9l9zG7guM2dltuQjhf/lB2+zrtVPbpQl/9WTVnucKexl2s8codoY8QSAOMf mG+M+/5Upl39YzNvd/E7nwlVsaxTwHKeDAV8FzbzdK6JBYNJu6ZmmkcuU17gAoltrNb1 ArMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f+1Ydzdb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b23si16299188ejv.299.2020.08.19.12.20.17; Wed, 19 Aug 2020 12:20:41 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=f+1Ydzdb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727041AbgHSTRi (ORCPT + 99 others); Wed, 19 Aug 2020 15:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726874AbgHSTRQ (ORCPT ); Wed, 19 Aug 2020 15:17:16 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D4980C061383 for ; Wed, 19 Aug 2020 12:17:15 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id r1so27192210ybg.4 for ; Wed, 19 Aug 2020 12:17:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:in-reply-to:message-id:mime-version:references:subject:from:to :cc; bh=G8ovRmWPY2eQRm47H6TIcE569Ii4rdR2xUKKDLx0xDw=; b=f+1YdzdbnkY01Pd/XYpVHaD7EAlrtO9o1mqgVX3oLPHx/Z792m3feItpAM1uCZKM5Z 3OHZXnaEfnVJasRQIYFL47vXV28lja2DfwwSkfM1PeelFbEGLA8m5KNjWGbiK8gx43xs A7OyFY/vF+3FIkW8hJ1M5iw/Cw9gJzmt6lbZioPhP5xoRqa3E/0VCeIA0Gx9xnq3h53F 63mraLAdmwu/r42O86ItTteBSJ6AsNhCADk/PUC2wzLpRFvqFC+Yt1u85x6Zp4WcWMWN 9oeDse8CDkhlS2eDIt1rkFdG9oBT3asrqJaAY42oHIat6X6YD2LDWxbBc7yFsAvA+d08 n7CA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:in-reply-to:message-id:mime-version :references:subject:from:to:cc; bh=G8ovRmWPY2eQRm47H6TIcE569Ii4rdR2xUKKDLx0xDw=; b=fsaHaBspC3KWZ89iQ3HbgeQCyjwQSkA6LPALhSuD3zNmUhCXt/5DNtvKrDHA52eYfU MHvA47pSqJeG1JxoiZ2bNxDdXYxzWgFGhf7bDELR7nBWB3kqZo8Vcx2Ps2tqhadOClAS JT2m1/IzP4IJEhGQpKiufjIXFyQ42KWCXQ6+NlSV65ZddZejvKwu/+5mwKKC7CfcNytM dryu95RYRC78UWHbWnrfcQO/GPRLihJXvK3UL+He1U6f4Q9R7xnrAt5hYTvdWKxUrceL Fp0pymKeegT9O4Wv2mcpUSOofDRDAD5MPl3ThrY44GJV+qoyXn7ehP9xTW8FCrnUMTUD +72w== X-Gm-Message-State: AOAM533t+BdKNtCWBY6YmVYawZd8xLGAXhZdA0RlxpasvQkJCJSKyFW0 VHWERQE4+e8NpOUvB3tZWJeMXCcExwYCp/15pnY= X-Received: by 2002:a25:502:: with SMTP id 2mr34973593ybf.6.1597864635052; Wed, 19 Aug 2020 12:17:15 -0700 (PDT) Date: Wed, 19 Aug 2020 12:16:51 -0700 In-Reply-To: <20200819191654.1130563-1-ndesaulniers@google.com> Message-Id: <20200819191654.1130563-3-ndesaulniers@google.com> Mime-Version: 1.0 References: <20200819191654.1130563-1-ndesaulniers@google.com> X-Mailer: git-send-email 2.28.0.297.g1956fa8f8d-goog Subject: [PATCH v2 2/5] Makefile: add -fno-builtin-bcmp From: Nick Desaulniers To: Masahiro Yamada , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov Cc: Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org, Kees Cook , Tony Luck , Dmitry Vyukov , Michael Ellerman , Joe Perches , Joel Fernandes , Daniel Axtens , Arvind Sankar , Andy Shevchenko , Alexandru Ardelean , Yury Norov , x86@kernel.org, "H . Peter Anvin" , Ard Biesheuvel , "Paul E . McKenney" , Daniel Kiper , Bruce Ashfield , Marco Elver , Vamshi K Sthambamkadi , Andi Kleen , Linus Torvalds , "=?UTF-8?q?D=C3=A1vid=20Bolvansk=C3=BD?=" , Eli Friedman , Nick Desaulniers , Nathan Chancellor Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The issue with using `-fno-builtin-*` flags was that they were not retained during an LTO link with LLVM. This was fixed in clang-11 by https://reviews.llvm.org/D71193 (0508c994f0b14144041f2cfd3ba9f9a80f03de08), which is also the minimum supported version of clang for LTO. Use `-fno-builtin-bcmp` instead. With this applid, we can cleanly revert commit 5f074f3e192f ("lib/string.c: implement a basic bcmp") Reviewed-by: Kees Cook Suggested-by: Nathan Chancellor Signed-off-by: Nick Desaulniers --- Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/Makefile b/Makefile index e523dc8d30e0..def590b743a9 100644 --- a/Makefile +++ b/Makefile @@ -579,6 +579,7 @@ CLANG_FLAGS += -no-integrated-as endif CLANG_FLAGS += -Werror=unknown-warning-option CLANG_FLAGS += -fno-builtin-stpcpy +CLANG_FLAGS += -fno-builtin-bcmp KBUILD_CFLAGS += $(CLANG_FLAGS) KBUILD_AFLAGS += $(CLANG_FLAGS) export CLANG_FLAGS -- 2.28.0.297.g1956fa8f8d-goog