From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62AAFC433DF for ; Sun, 16 Aug 2020 15:03:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3DE3420674 for ; Sun, 16 Aug 2020 15:03:14 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="NITocUg8" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728737AbgHPPDL (ORCPT ); Sun, 16 Aug 2020 11:03:11 -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-Google-Smtp-Source: ABdhPJyi1Ths8h43k7ohyjY5Iuz56G1sd5h6PQeosLI12oHRimut945jhqVOnG1fAI+JG7INAhAAsQ== 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.