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=-1.1 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_PASS 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 7710DC43381 for ; Wed, 13 Mar 2019 08:13:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 473C52177E for ; Wed, 13 Mar 2019 08:13:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=rasmusvillemoes.dk header.i=@rasmusvillemoes.dk header.b="OBPgaOmo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726974AbfCMINP (ORCPT ); Wed, 13 Mar 2019 04:13:15 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:33359 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726868AbfCMINP (ORCPT ); Wed, 13 Mar 2019 04:13:15 -0400 Received: by mail-lf1-f65.google.com with SMTP id v14so217948lfi.0 for ; Wed, 13 Mar 2019 01:13:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=OgaWnuLR8E36dS/DRH+8CFdnIpkBflC5UhM+d3H4xNw=; b=OBPgaOmofpeOhy9tbpvJleB1beNeOVqbvzcGOpdYvReRPJ+yq1QQc1TVPyg17MW2Ro fuLRYwN0ZiddHVPGT+vXQk93JBkfkZcS3w4VEp1nxBHrlDUQ8gOzy6muu+d82zLF+oYW 6FSw/ZsteSM+ExTJgRBPUXHxccPPh7rLv1lh8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=OgaWnuLR8E36dS/DRH+8CFdnIpkBflC5UhM+d3H4xNw=; b=m4k1cGOoroWm6wqCmYi4YIvcZMRLFP1aQx0qwW/2N+TVqhzWOPsl5j6sGMOXj/zj/q 8pdBKh1j+wg07jR6Z1P8vJ+W66NlkTntjYKLUqjAzLPtvsoGHh84QzO29SboM16Q7Lfs bUjVYKrffJPEq9hDatr7/G/PZ3GI2YRprxI/BSe4Uz3QBvmsZlgI+GGH4IHxpfPO7CO7 lJQYbkH8g7HGehNN7iuIb7+xODUvLVaTSgkhzKJG6J8SHkSpEocWSJ3WxZ3G2TrX9RSu TVKvb2gmCRuynSFrwFpGRMx0lfagphFxF/Rx6TFsmXo8ydsgWMakZBTxE0oqaI78W5Yf ASCA== X-Gm-Message-State: APjAAAWH+gmKESUgTcDvMAu9pXAkV1cYa1PWRqd7N2rw0hkr9EVOTmac 2FXGv1q/bOQG+u1JIi4jpx3GAbCySGH63WwL X-Google-Smtp-Source: APXvYqzS1KWnD+XMTf+dawSpOwHfH4rv04X0Pez35SydVHOqnb5Jy2dYfjExMZ8QeDCKQXfeme9n4g== X-Received: by 2002:ac2:54b6:: with SMTP id w22mr1565272lfk.132.1552464792857; Wed, 13 Mar 2019 01:13:12 -0700 (PDT) Received: from [172.16.11.26] ([81.216.59.226]) by smtp.gmail.com with ESMTPSA id f78sm1690475lji.96.2019.03.13.01.13.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 13 Mar 2019 01:13:12 -0700 (PDT) Subject: Re: [PATCH] Makefile: Add '-fno-builtin-bcmp' to CLANG_FLAGS To: Nathan Chancellor , Masahiro Yamada , Michal Marek , linux-kbuild@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nick Desaulniers , Arnd Bergmann , James Y Knight , clang-built-linux@googlegroups.com, stable@vger.kernel.org References: <20190312215203.27643-1-natechancellor@gmail.com> From: Rasmus Villemoes Message-ID: <80fb5b7f-42f9-4fd1-00cf-bfa7965ff8f7@rasmusvillemoes.dk> Date: Wed, 13 Mar 2019 09:13:11 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: <20190312215203.27643-1-natechancellor@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org On 12/03/2019 22.52, Nathan Chancellor wrote: > After LLVM revision r355672 [1], all known working kernel configurations > fail to link [2]: > > ld: init/do_mounts.o: in function `prepare_namespace': > do_mounts.c:(.init.text+0x5ca): undefined reference to `bcmp' > ld: do_mounts.c:(.init.text+0x5e6): undefined reference to `bcmp' > ld: init/initramfs.o: in function `do_header': > initramfs.c:(.init.text+0x6e0): undefined reference to `bcmp' > ld: initramfs.c:(.init.text+0x6f8): undefined reference to `bcmp' > ld: arch/x86/kernel/setup.o: in function `setup_arch': > setup.c:(.init.text+0x21d): undefined reference to `bcmp' > > Commit 6edfba1b33c7 ("[PATCH] x86_64: Don't define string functions to > builtin") removed '-ffreestanding' globally and the kernel doesn't > provide a bcmp definition so the linker cannot find a reference to it. > > Fix this by explicitly telling LLVM through Clang not to emit bcmp > references. This flag does not need to be behind 'cc-option' because all > working versions of Clang support this flag. Wouldn't it be better to just define bcmp as an alias for memcmp? They seem to have compatible prototypes, and then somebody might someday sit down and implement some word-at-a-time version of bcmp making use of the weaker guarantees about the return value to gain some performance. But I suppose that can also be done later. Rasmus