Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1712710pxa; Sun, 16 Aug 2020 08:25:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySRBoaLbiUtkPlSxaiwoEEtVjm7vZMAjT1unQPkecDnMfU5tirXpjRoAxoK/1IDTV4CLvV X-Received: by 2002:a05:6402:3128:: with SMTP id dd8mr10908459edb.97.1597591512344; Sun, 16 Aug 2020 08:25:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597591512; cv=none; d=google.com; s=arc-20160816; b=zCgTEN26tYhWqdlyGqAb5Xr94rypGC6EL48nnJGCVR40UHnCq/xmDLQ425qbd5grKZ xgBrE0It3lGPeWTVRxqk1QTBPjGniaf5IaXB3i8rGhLuUzX+vbOqegLfAUO0OuovubQg n7cS/vQf/3aVV0wfIVEvDXxgLvHVdR+ZK9MM0oy3Mmfgrzcb13sk4I0/toSiogiWjOnr 6YawYvfrjMZK4Rx5W+NlBXsm5GQKGRTEzqO7DNcntZvaBpMvgf2VE4pAwv/wm4KEJmwN Fqqs0AyRSmPVCtCn6K3WWZZEoOymhggrPbvilPOtE0J6KdQguOkiSmAN8fzRuqShTK5P Yy/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:date:from :dkim-signature; bh=yw1Hg3YiuW4Axw2+s5MR8uBtZOL99Paku5YKL39/E/o=; b=CMklopDtF/+XnItRcY+eWKnIgl3ppJcGNBh7a+CSfu/7ECGkrkTMP2lD+lgA14dnO3 9j3DDdtwmgxEOkSkF9xSS6FtPlpdMrUDlVE3M5BYlt5Htk8I+fYIgtMpsWoVwaJE9fJ9 FL9PJjcL1whsONHNmJleyUHHyupMYyN8cqMLOhLC5TJuav1bBIGHqeFw4yvC9JXSSIBc B5IoFXjyFoRn2O6Xd5/0vSMdI2CMfFWMabEZRw7zjAylbtShu3JHWzgK9rc4Ep/0cnpn LCD6jmSTiPp5WCybc6+Lbn6/mHJs7jz0fg288prAFl1cTuRRdYR3DVCbh6M9SmB31eZP duvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=NITocUg8; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id jo2si9153784ejb.633.2020.08.16.08.24.48; Sun, 16 Aug 2020 08:25:12 -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=fail header.i=@gmail.com header.s=20161025 header.b=NITocUg8; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728672AbgHPPCl (ORCPT + 99 others); Sun, 16 Aug 2020 11:02:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34056 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727057AbgHPPC0 (ORCPT ); Sun, 16 Aug 2020 11:02:26 -0400 Received: from mail-qt1-x844.google.com (mail-qt1-x844.google.com [IPv6:2607:f8b0:4864:20::844]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6D614C061786; Sun, 16 Aug 2020 08:02:24 -0700 (PDT) Received: by mail-qt1-x844.google.com with SMTP id s23so10585960qtq.12; Sun, 16 Aug 2020 08:02:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:date:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=yw1Hg3YiuW4Axw2+s5MR8uBtZOL99Paku5YKL39/E/o=; b=NITocUg8oj4ejdwrruQJ4mfW1DZ1QiFs/Yz+46KBlUt+O6tvhntiizyyB1n5OLAyHY t4DJS/Fae4SBnSkTvQu1Ysx0/H16JZ9XNVRrr4eWsBJclP/d4wvX5h0hOQkiEqDPShS7 Gq/HA4slswlSYEtZ0HdOn2ZxZLdoNQbaMwxiXM8UQWD0i9G1u7BtMECDFrY0hiMXQ55q vHWd7Ne3pBSM+bRiE0bbn5MKOGoJuGi4sXPqenIHwYknr8hNvWtmmLk20Ibiv+A48D7Z X2E7mWPFptqKiV7qlD2h7HMsyau/N9oHA3YwPeWI52aQV2f1mstqkLtdi3AJhS7cU/lx 0JUg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:date:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to; bh=yw1Hg3YiuW4Axw2+s5MR8uBtZOL99Paku5YKL39/E/o=; b=JWblACco42zDWNafe3Xb2Ix8FEI0TmBlFFnZjWZI+02STBDDr7Lc84WS8kcgZMZ/c6 3llMTsF5AT+vbTbruXq4h2X2cdTJ8LrjeAFDsPy0TM3aO0ca9l3VGpQ9LR1Q7D/VMiHS vYmKG/IB1/iftaSS0MO0OZg4jTbzky4TbjDB8rH56Dgk49ig0YUxYiTDj6tD9L5eZnvE jj6pmw6ofuwvrYmgWn8nI4M9FNLSsoYLN+MxRBT/rjPHZqb3Q2mr5rdFdGNPujozXowF 6p1v8XZo/zGi+OgRl7CF9hnnqRA/kwdcFgxzYNRc5P2jQe47LSmESuVIix2128eBn5D6 AR+Q== X-Gm-Message-State: AOAM531pL2kJcZw9ukCkHz/7B5QsSdYgDut2PdBNXSnKAPRNLHnugSRc eJYR2PowqH4uOYY+sr8/8eE= X-Received: by 2002:ac8:454b:: with SMTP id z11mr10193757qtn.350.1597590140648; Sun, 16 Aug 2020 08:02:20 -0700 (PDT) Received: from rani.riverdale.lan ([2001:470:1f07:5f3::b55f]) by smtp.gmail.com with ESMTPSA id g3sm15663502qtq.70.2020.08.16.08.02.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 16 Aug 2020 08:02:19 -0700 (PDT) From: Arvind Sankar X-Google-Original-From: Arvind Sankar Date: Sun, 16 Aug 2020 11:02:17 -0400 To: Sedat Dilek Cc: Fangrui Song , Nick Desaulniers , Joe Perches , Kees Cook , Andrew Morton , =?utf-8?B?RMOhdmlkIEJvbHZhbnNrw70=?= , Eli Friedman , "# 3.4.x" , Arvind Sankar , Sami Tolvanen , Vishal Verma , Dan Williams , Andy Shevchenko , "Joel Fernandes (Google)" , Daniel Axtens , Ingo Molnar , Yury Norov , Alexandru Ardelean , LKML , clang-built-linux , Rasmus Villemoes Subject: Re: [PATCH v2] lib/string.c: implement stpcpy Message-ID: <20200816150217.GA1306483@rani.riverdale.lan> References: <20200815014006.GB99152@rani.riverdale.lan> <20200815020946.1538085-1-ndesaulniers@google.com> <202008150921.B70721A359@keescook> <457a91183581509abfa00575d0392be543acbe07.camel@perches.com> <20200816001917.4krsnrik7hxxfqfm@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Aug 16, 2020 at 07:22:35AM +0200, Sedat Dilek wrote: > On Sun, Aug 16, 2020 at 2:19 AM 'Fangrui Song' via Clang Built Linux > wrote: > > > > Adding a definition without a declaration for stpcpy looks good. > > Clang LTO will work. > > > > (If the kernel does not want to provide these routines, > > is http://git.kernel.org/linus/6edfba1b33c701108717f4e036320fc39abe1912 > > probably wrong? (why remove -ffreestanding from the main Makefile) ) > > > > We had some many issues in arch/x86 where *FLAGS were removed or used > differently and had to re-add them :-(. > > So if -ffreestanding is used in arch/x86 and was! used in top-level > Makefile - it makes sense to re-add it back? > ( I cannot speak for archs other than x86. ) > > - Sedat - -ffreestanding disables _all_ builtins and libcall optimizations, which is probably not desirable. If we added it back, we'd need to also go back to #define various string functions to the __builtin versions. Though I don't understand the original issue, with -ffreestanding, sprintf shouldn't have been turned into strcpy in the first place. 32-bit still has -ffreestanding -- I wonder if that's actually necessary any more? Why does -fno-builtin-stpcpy not work with clang LTO? Isn't that a compiler bug? Thanks.