Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1065965lqt; Fri, 7 Jun 2024 07:12:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVVTrBbMadqg9ThozszoQ1/I0hK723rw3wWL2AkrE8EFW6JpPHPtMf7pnMsoKSvziwevdMU36XO2G4/CLcmSbZwx3NBRbdV6RLfOEHfTA== X-Google-Smtp-Source: AGHT+IHIn/WABqA16MFUy3CsJl9syirw/MNjoIaWDUWljIaj7miZ2HHoLW5LYWlGNXK6HNzKC8/H X-Received: by 2002:a67:eb8b:0:b0:48b:ac09:e7d6 with SMTP id ada2fe7eead31-48c26feed34mr2853880137.0.1717769541833; Fri, 07 Jun 2024 07:12:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717769541; cv=pass; d=google.com; s=arc-20160816; b=hZQHes6GLYGfa5z5iSR1pQetOA+LfwTqC5Y90j5n+wCNjIspQsbDEjxrt/JE2Nhdfs /AWm3bFV/1lPS3sQnJCxoV7aLYNIRVkLLHr4OFRypxl/kW6+OmH4p52H5CLa2QEhdtMl Icnea8HplRBVZDHMruZLKNkif334CMoCbO5nkAvXXMK1ebP7kUxCYr34CwkjGJ+VEpXD WPKdFmVvv3BVvRfSN8DDd1NFT/hq4/76JWpmk78xZTGi5rJcBElrSMXgYPd/HtQFAbmq DLwcpN03vTJ5fM2WNbwH+GS2/Anqd0x/gOQ0WLR8fJZhsxZk0Yqd4d14WEJj/TTDSWx4 gMdQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=subject:cc:to:from:date:references:in-reply-to:message-id :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:feedback-id:dkim-signature:dkim-signature; bh=INQDVUt3zvkdBbSzkPvyjoHwhwcMzQA7bETzh/itaN8=; fh=hm6SpUcvxvSCjGHXxQ0CuY+y3bGuNIk/ZwearpPYL7k=; b=zWnWG9z5OfSkKit/esazmIv5rXK2+hldZlltlSMVx9j3D/g+6Dh5bgGgeJlRoKL230 O3q12nSlCDYMoEk9E3vBP8bFz7YVOmBZEvcOYcfLslzGM1s5XjD+MONrF1sDFzGH5IiM poCQKqX4hXBd4MhRdnfCjdYQbC3sTjjXSA0Z4Iy/0yF61TkdHPUsjAKszRtrTGET+B91 ZUkYS7KH0f5Xfzr1owgWRj9a2SjZZVih6MLsHztraafbH8zcNlQkiQgzraAmYzKoYBGf pA/e6hui5pxhBVMro8TdtfYEwS/7OpA7scRAOmEcgHN9rz+6kbLkIxIGO6B/tafPPSZL VFqA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=YyrtcjUX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=YRsTiXvq; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-206223-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id ada2fe7eead31-48c1a0f6399si1008964137.49.2024.06.07.07.12.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 07:12:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206223-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@arndb.de header.s=fm3 header.b=YyrtcjUX; dkim=pass header.i=@messagingengine.com header.s=fm1 header.b=YRsTiXvq; arc=pass (i=1 spf=pass spfdomain=arndb.de dkim=pass dkdomain=arndb.de dkim=pass dkdomain=messagingengine.com dmarc=pass fromdomain=arndb.de); spf=pass (google.com: domain of linux-kernel+bounces-206223-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206223-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=arndb.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 64BA31C217E4 for ; Fri, 7 Jun 2024 14:12:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E295A195F23; Fri, 7 Jun 2024 14:12:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b="YyrtcjUX"; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="YRsTiXvq" Received: from fout6-smtp.messagingengine.com (fout6-smtp.messagingengine.com [103.168.172.149]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6E7D514F11B; Fri, 7 Jun 2024 14:12:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=103.168.172.149 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717769533; cv=none; b=MguXsrUj3ztjjWm3c/zA4jQvciv5hc0Qh7ZIQdE+vhez/1gVuSSzUJ0Wd2HGzU3cojZrLj1/VTlUog+hzFrfTGxI6sqnhTe7Uj7w/+8D4ohWl700+0fhQMkRfhGC2XPtsliQuhthCu3MNQ4rJoO4anrmltrqbzdACU1AjFbQ1Yg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717769533; c=relaxed/simple; bh=s3Z3gwcM2mExYmHr73HG/w9dhoTKFqZX8pMjtLuupXI=; h=MIME-Version:Message-Id:In-Reply-To:References:Date:From:To:Cc: Subject:Content-Type; b=KayM546S2KCcRn7+QDF8MylspQp/uRO6F72vEcN6knBzfXLe9IrNHPznwjN+bs8DoE8LHoA44eBqr1omCMOI8oBuWW1nlJ13mYaV/zcfI4c0SItTsmFLqyJ8mOHUXrnWFmzC5OHJrBSD0Lle/X3ukGbILMMTU8UjnOkSx9JY+iA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de; spf=pass smtp.mailfrom=arndb.de; dkim=pass (2048-bit key) header.d=arndb.de header.i=@arndb.de header.b=YyrtcjUX; dkim=pass (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b=YRsTiXvq; arc=none smtp.client-ip=103.168.172.149 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=arndb.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=arndb.de Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailfout.nyi.internal (Postfix) with ESMTP id 6B36B13800D4; Fri, 7 Jun 2024 10:12:10 -0400 (EDT) Received: from imap51 ([10.202.2.101]) by compute5.internal (MEProxy); Fri, 07 Jun 2024 10:12:10 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=arndb.de; h=cc :cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1717769530; x=1717855930; bh=INQDVUt3zv kdBbSzkPvyjoHwhwcMzQA7bETzh/itaN8=; b=YyrtcjUXNNnFS59RukiM2VgRDV 7NzuuzQnmtFqKzlZoI6yOs7QLxWYq2iwRhw3mKKxvCRKa6LCMqRN+dOZ/jYOYr2S xaBy781VNVw7/8PnWD8dewvpQ0iUoILS8HKhAF4zLrRH+7HQ6Zlqayda9oTtPSZt Rfy6raVdB55pVAiLBue3tpVWZ4wS26pkYUix6nfmaUse0LUUOGUCh2dgSTqCY9RW 4sLsc/ftzjC1NqnRty68kISenbb0/hKXvO6GQnGIRdTCT28p2IdGtErcJBX9hu7s Ia7FWIVrU+AG4Y0e5ezduYoTM8x8fcIcPeRSMFZvpjtGy3C8HHw9bF+xgLbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; t=1717769530; x=1717855930; bh=INQDVUt3zvkdBbSzkPvyjoHwhwcM zQA7bETzh/itaN8=; b=YRsTiXvqVEiSCF5FjBDzt4UspukrE6jRNuQrOQTL+zfd QX0qERkqzp/UV11ZVEf+88FyR0D52HKgakrg6nhnQFDP5wWPGhUEHYqvQ2z9XyAc SBfE5S9XsHMeGzfU6VfBaRL38/SiU1Z04zjgQ0vTOU8fN97eS5+TW0ZtDKsRy717 XPpSi1siN1eifuIRbYRnEVcGLmHVOB2IGuGjsAKQruRWbi8vEOLaQPszzGivVY52 uU26p6Fc2fPN8kJ/JJRUuUrLVrkRdTeRJOwNNFHNQbdD+H26IuJHuehEPsxVffOH u93XYskDZa6gfqupgxuiluS+vk+Xu75w4xpXcl+sWw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfedtuddggeelucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepofgfggfkjghffffhvfevufgtsehttdertderredtnecuhfhrohhmpedftehr nhguuceuvghrghhmrghnnhdfuceorghrnhgusegrrhhnuggsrdguvgeqnecuggftrfgrth htvghrnhepffehueegteeihfegtefhjefgtdeugfegjeelheejueethfefgeeghfektdek teffnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hrnhgusegrrhhnuggsrdguvg X-ME-Proxy: Feedback-ID: i56a14606:Fastmail Received: by mailuser.nyi.internal (Postfix, from userid 501) id 31CB8B6008D; Fri, 7 Jun 2024 10:12:09 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.11.0-alpha0-497-g97f96844c-fm-20240526.001-g97f96844 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <23ddf649-f70b-47b0-90df-af572fd50504@app.fastmail.com> In-Reply-To: <87frtoq5yz.fsf@mail.lhotse> References: <20240607061629.530301-1-arnd@kernel.org> <87frtoq5yz.fsf@mail.lhotse> Date: Fri, 07 Jun 2024 16:11:25 +0200 From: "Arnd Bergmann" To: "Michael Ellerman" , "Arnd Bergmann" Cc: "Masahiro Yamada" , "Nathan Chancellor" , "Nicolas Schier" , linux-kbuild@vger.kernel.org, "Nicholas Piggin" , "Christophe Leroy" , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] powerpc: vdso: fix building with wrong-endian toolchain Content-Type: text/plain On Fri, Jun 7, 2024, at 14:42, Michael Ellerman wrote: > Arnd Bergmann writes: >> >> Signed-off-by: Arnd Bergmann >> --- >> I'm fairly sure this worked in the past, but I did not try to bisect the >> issue. > > It still works for me. > > I use the korg toolchains every day, and kisskb uses them too. > > What commit / defconfig are you seeing the errors with? > > Is it just the 12.3.0 toolchain or all of them? I just tested 12.3.0 > here and it built OK. > > I guess you're building on x86 or arm64? I build on ppc64le, I wonder if > that makes a difference. > > The patch is probably OK regardless, but I'd rather understand what the > actual problem is. I tested again and found that the problem is actually part of my local build setup, which overrides the 'CPP' variable in the top-level makefile that I use for building multiple kernels concurrently. This ends up clashing with this other line that only powerpc sets: arch/powerpc/Makefile:CPP = $(CC) -E $(KBUILD_CFLAGS) It's rare that someone overrides CPP, so quite possibly I'm the only one that has seen this so far, but it also seems like it should be possible to do that. This patch seems to work as well for me, and is a little more logical, but it's also more invasive and has a higher regression risk: 8<--------- diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile index 65261cbe5bfd..9ad4ca318e34 100644 --- a/arch/powerpc/Makefile +++ b/arch/powerpc/Makefile @@ -62,14 +62,14 @@ KBUILD_LDFLAGS_MODULE += arch/powerpc/lib/crtsavres.o endif ifdef CONFIG_CPU_LITTLE_ENDIAN -KBUILD_CFLAGS += -mlittle-endian +KBUILD_CPPFLAGS += -mlittle-endian KBUILD_LDFLAGS += -EL LDEMULATION := lppc GNUTARGET := powerpcle MULTIPLEWORD := -mno-multiple KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-save-toc-indirect) else -KBUILD_CFLAGS += $(call cc-option,-mbig-endian) +KBUILD_CPPFLAGS += $(call cc-option,-mbig-endian) KBUILD_LDFLAGS += -EB LDEMULATION := ppc GNUTARGET := powerpc @@ -95,7 +95,7 @@ aflags-$(CONFIG_CPU_BIG_ENDIAN) += $(call cc-option,-mbig-endian) aflags-$(CONFIG_CPU_LITTLE_ENDIAN) += -mlittle-endian ifeq ($(HAS_BIARCH),y) -KBUILD_CFLAGS += -m$(BITS) +KBUILD_CPPFLAGS += -m$(BITS) KBUILD_AFLAGS += -m$(BITS) KBUILD_LDFLAGS += -m elf$(BITS)$(LDEMULATION) endif @@ -176,7 +176,6 @@ KBUILD_CPPFLAGS += -I $(srctree)/arch/powerpc $(asinstr) KBUILD_AFLAGS += $(AFLAGS-y) KBUILD_CFLAGS += $(call cc-option,-msoft-float) KBUILD_CFLAGS += $(CFLAGS-y) -CPP = $(CC) -E $(KBUILD_CFLAGS) CHECKFLAGS += -m$(BITS) -D__powerpc__ -D__powerpc$(BITS)__ ifdef CONFIG_CPU_BIG_ENDIAN diff --git a/arch/powerpc/kernel/vdso/Makefile b/arch/powerpc/kernel/vdso/Makefile index 1b93655c2857..3516e71926e5 100644 --- a/arch/powerpc/kernel/vdso/Makefile +++ b/arch/powerpc/kernel/vdso/Makefile @@ -59,7 +59,7 @@ ldflags-$(CONFIG_LD_IS_LLD) += $(call cc-option,--ld-path=$(LD),-fuse-ld=lld) ldflags-$(CONFIG_LD_ORPHAN_WARN) += -Wl,--orphan-handling=$(CONFIG_LD_ORPHAN_WARN_LEVEL) # Filter flags that clang will warn are unused for linking -ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER) $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CFLAGS)) +ldflags-y += $(filter-out $(CC_AUTO_VAR_INIT_ZERO_ENABLER) $(CC_FLAGS_FTRACE) -Wa$(comma)%, $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS)) CC32FLAGS := -m32 LD32FLAGS := -Wl,-soname=linux-vdso32.so.1 --------->8 Arnd