Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp1777647ybg; Sat, 19 Oct 2019 02:17:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqzcLzOqCBOskgPdSrB5aUj6YWTm+hqj55FkwfOh/Cm6jYfGUe/Ogci1zB2e1FpTDe1GmrVL X-Received: by 2002:a17:906:4806:: with SMTP id w6mr13133379ejq.44.1571476671685; Sat, 19 Oct 2019 02:17:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1571476671; cv=none; d=google.com; s=arc-20160816; b=0e108oV/BKdWH80cWE9SOnSEEguVKYQ+wE+ybEr2+SMueFOGOrarbEHz5S6EqgTXGI 3n0dN9ZIAtLwuLDXb9XJqVm96kiYZf5Cb0UK5tDkM+vopu1qKL7TXxu4JbfgA1iU7zRN JNzmXbBq6MTM6TzDfS5gqRN7Ebl0NbpNxlEhbKInce1tTLd4l5isTf8n6/e0Tr4qDjlf vrt2r0UpSQ0s1y+6CvKzXyfKx/GURgG+Pf702rF2z8mQYhvokuA2fBS0esaBRPxXupYU nhOljl4LJEMfWrbVozWDRsuk45Y9z1j0DwT+iG8X+9mPBi8M0QdlhLNS3CxZIBf/mHQN OjNg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=bFsPKJGhCYHdyHTlvzsP2IpglamPGnCzr6dPQxIbnbM=; b=0g1gScskpiwfTUu0VHf5afuHHKuhA9fqmvveaFv1vqwqQQ6UavBA4UmdrTm02GJIno GjdJf/RBdp9T0xXzyCmRTLyGLSrOyb4jED9zF1vcLCzwop1r3AkrT80yigcdj/t67Spq FB4ZNtZXOjRQSvn+n3WuZqI8RadO32G2J5yY0JGDwGqf/EuC1qDDzORceJ0N3b0R4adq AD4TcwXACmYVvjT3iW9Epf0v4V7BJrz9cvsyScW5lCQT8FdqKJYU1OsDOd4dC6B9GdVs OT4zcFt13q/Jnca1eD3iYqpFRV7Ma5Bp5xYlCO6FEbv2T0qyMBY9CZScwM+1mJIW5bTI Z6lg== ARC-Authentication-Results: i=1; mx.google.com; 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 v3si5437686edc.404.2019.10.19.02.17.28; Sat, 19 Oct 2019 02:17:51 -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; 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 S2502488AbfJRVBx (ORCPT + 99 others); Fri, 18 Oct 2019 17:01:53 -0400 Received: from gate.crashing.org ([63.228.1.57]:40170 "EHLO gate.crashing.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728410AbfJRVBw (ORCPT ); Fri, 18 Oct 2019 17:01:52 -0400 Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id x9IK2BmA030151; Fri, 18 Oct 2019 15:02:11 -0500 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id x9IK2AiY030150; Fri, 18 Oct 2019 15:02:10 -0500 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Fri, 18 Oct 2019 15:02:10 -0500 From: Segher Boessenkool To: Nathan Chancellor Cc: Nick Desaulniers , Benjamin Herrenschmidt , Paul Mackerras , Michael Ellerman , clang-built-linux , linuxppc-dev , LKML Subject: Re: [PATCH v4 3/3] powerpc/prom_init: Use -ffreestanding to avoid a reference to bcmp Message-ID: <20191018200210.GR28442@gate.crashing.org> References: <20190911182049.77853-1-natechancellor@gmail.com> <20191014025101.18567-1-natechancellor@gmail.com> <20191014025101.18567-4-natechancellor@gmail.com> <20191014093501.GE28442@gate.crashing.org> <20191014191141.GK28442@gate.crashing.org> <20191018190022.GA1292@ubuntu-m2-xlarge-x86> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191018190022.GA1292@ubuntu-m2-xlarge-x86> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 18, 2019 at 12:00:22PM -0700, Nathan Chancellor wrote: > Just as an FYI, there was some more discussion around the availablity > and use of bcmp in this LLVM bug which spawned > commit 5f074f3e192f ("lib/string.c: implement a basic bcmp"). > > https://bugs.llvm.org/show_bug.cgi?id=41035#c13 > > I believe this is the proper solution but I am fine with whatever works, > I just want our CI to be green without any out of tree patches again... I think the proper solution is for the kernel to *do* use -ffreestanding, and then somehow tell the kernel that memcpy etc. are the standard functions. A freestanding GCC already requires memcpy, memmove, memset, memcmp, and sometimes abort to exist and do the standard thing; why cannot programs then also rely on it to be the standard functions. What exact functions are the reason the kernel does not use -ffreestanding? Is it just memcpy? Is more wanted? Segher