Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp842132lqt; Thu, 6 Jun 2024 23:16:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVZbHblPEClDJ/EIgURwOJDrDcwE1B5Wov2mkYKkS0S2SsLMcJoGmmqEb2T48LZHT6nKoscvysb3h9VObA8rAEiz9kSj+78Q6k00wuI/g== X-Google-Smtp-Source: AGHT+IGIRnDDWmWRQHdVRXTDpdK4spGVl6/SKCwblc9m/F6Xql/zvot1Ri33E8WWCW1A1Gb7gePd X-Received: by 2002:a50:f607:0:b0:579:d01a:938b with SMTP id 4fb4d7f45d1cf-57c509a931emr702264a12.35.1717741002828; Thu, 06 Jun 2024 23:16:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717741002; cv=pass; d=google.com; s=arc-20160816; b=s6/qiN9WOIhD2BNuoQx6MLgIpQydBVyhO+XMgpqQ2B9BZsDfQ/ymlGkr3l02MaJ3iL ae4XT54jtOCeMfX3XcFKo5cHbRSXrKCNmH3zLZCrxg0whU/M8j5dcLWw4Bq+PBq4xb1O /XQtOGmNj0Z1AzT9U7LxQY9U+q6EafyCQDAUnkK+9xinL5yO7KmnnTcBwEyIhyVU+vnQ DRr+0/NHDoVx58U8gQnaqweZZl7nY9g7R5EbE3GpeZppLpZKD+yszKh8U4W1OBJr0sef wBzBNGA0JPcwJEXAlah8tjHmx8Lon8n08DljR12p2J7SpO6pbbHT61aJGk9C7BFWEJ7+ Pdwg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=jmSwiqgkSGzopRbP5I7WK1ogxtsSapJBVy1UD4SON1M=; fh=hFwrUFb1SYZh74ZOG36a2ixqaAhuFq6cZnJie9oFULo=; b=GcQdw3i60dKQvrVf1Kb3zc/FbFaTapOuqfbm0rPWcIVW2V71mu6knYLek47AkTRzeI yfsPjhFeRFH7Kkm2pDIQvOf0UWbSKgJo0kU+uPHMqClFZEqsZzaodIWVexF6Oh9dCmB8 xge/d4Y6KEYk9IBuql18+wDkerEeghO09Lgct5+Jy5leH4FE6Ghm+Ruw2t8lRux+9tjZ 0O9fy5P4IG3ya7BclpSWS6iin8M/TzlU9Bqo/OWFgoFLNrzTI/03SP2jBZO0KyAkXis8 KqTVsx0JRR5Pgj95F+jyikzMTABmrikjsHEhUDxZDK7WEE8pkOI/wSZWyFTt47czaSMS B5Ag==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M5eDGq2W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae28a581si1472056a12.617.2024.06.06.23.16.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 23:16:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-205445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=M5eDGq2W; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-205445-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-205445-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 7AAD31F229D6 for ; Fri, 7 Jun 2024 06:16:42 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3732F14F9CB; Fri, 7 Jun 2024 06:16:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="M5eDGq2W" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 54DD11BC2F; Fri, 7 Jun 2024 06:16:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717740998; cv=none; b=dYiYx4SqHAMiEclFKwYfnn2c/4X2xlMNHJ9zU6JJRX2wdnBBCnqRWt8PsJvsG9DNQ25hOdeB9X9Y2H/pf698V+s+sJwP2LFMDfb24fFd1xL/5lZWcDbGIDZ0kWJKbOQhB3rOqA9u3/IYfYAfNwLct6BpWBFSnf7BcK1JRmbyy9Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717740998; c=relaxed/simple; bh=qgHdQ12pGPqv4LQl2A25azzdtAo6RAm5OvuiMvQKvsQ=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=oqcyZcaIaU1yf6znlimhr1qdFmcvwSs23bIcSXjMnwrUywwFSiLAwf6dHimLQ7eGS7AyNLHzDy3LG5x0glEPenUUZiYUYZwpTJpAZuBkfEZ4lg0JoGo4y7Nf9vJa4MW26vx10WuMShkDNY0EWf9Onis/lMKCBFFvhAxxEx2d6xU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=M5eDGq2W; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BA9AC32786; Fri, 7 Jun 2024 06:16:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717740997; bh=qgHdQ12pGPqv4LQl2A25azzdtAo6RAm5OvuiMvQKvsQ=; h=From:To:Cc:Subject:Date:From; b=M5eDGq2WgpC2ptrYYfbhFd1t01HDMrMtZuAl1rxiC9JcCy7KZ4YF6/P6sjFFlpqXM fXN9RKaiYm/hGMpSZBs5oaRZNiYlpLwf+8GhiM8+CE8xMt3EEqKNFQVthqnMrVzy0K sHVG6gKTIC9I8i1h9Ah/GeV8vZp10qrQX1UEgpbnRTksYuvIgGH1m8FkclbLBDTMXr ekv11RBOu1TFJr+bT1CB+6sYa1EH2PFvxc6lBqKvZ90QgfoCPyEJDEi+LWmRrB2ID5 FmBhvhfj4MNMzqt25WhSDw8Hli6LLvWRxd43MlsP4zCMNtDTiN6VBvrs9NboEZzJv3 QBipta5BEZJzA== From: Arnd Bergmann To: Michael Ellerman Cc: Masahiro Yamada , Nathan Chancellor , Nicolas Schier , linux-kbuild@vger.kernel.org, Arnd Bergmann , Nicholas Piggin , Christophe Leroy , "Naveen N. Rao" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org Subject: [PATCH] powerpc: vdso: fix building with wrong-endian toolchain Date: Fri, 7 Jun 2024 08:16:23 +0200 Message-Id: <20240607061629.530301-1-arnd@kernel.org> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Arnd Bergmann Building powerpc64le kernels with the kernel.org crosstool toolchains no longer works as the linker attempts to build a big-endian vdso: powerpc-linux/lib/gcc/powerpc-linux/12.3.0/../../../../powerpc-linux/bin/ld: arch/powerpc/kernel/vdso/sigtramp32-32.o: compiled for a little endian system and target is big endian powerpc-linux/lib/gcc/powerpc-linux/12.3.0/../../../../powerpc-linux/bin/ld: failed to merge target specific data of file arch/powerpc/kernel/vdso/sigtramp32-32.o Apparently creating the vdso.lds files from the lds.S files fails to pass the -mlittle-endian argument here, so the output format gets set wrong. Changing the conditional to check for CONFIG_CPU_LITTLE_ENDIAN instead still works, as the kernel configuration definitions are visible. Signed-off-by: Arnd Bergmann --- I'm fairly sure this worked in the past, but I did not try to bisect the issue. --- arch/powerpc/kernel/vdso/vdso32.lds.S | 2 +- arch/powerpc/kernel/vdso/vdso64.lds.S | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/arch/powerpc/kernel/vdso/vdso32.lds.S b/arch/powerpc/kernel/vdso/vdso32.lds.S index 426e1ccc6971..5845ea2d1cba 100644 --- a/arch/powerpc/kernel/vdso/vdso32.lds.S +++ b/arch/powerpc/kernel/vdso/vdso32.lds.S @@ -7,7 +7,7 @@ #include #include -#ifdef __LITTLE_ENDIAN__ +#ifdef CONFIG_CPU_LITTLE_ENDIAN OUTPUT_FORMAT("elf32-powerpcle", "elf32-powerpcle", "elf32-powerpcle") #else OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc") diff --git a/arch/powerpc/kernel/vdso/vdso64.lds.S b/arch/powerpc/kernel/vdso/vdso64.lds.S index bda6c8cdd459..82c418b18cce 100644 --- a/arch/powerpc/kernel/vdso/vdso64.lds.S +++ b/arch/powerpc/kernel/vdso/vdso64.lds.S @@ -7,7 +7,7 @@ #include #include -#ifdef __LITTLE_ENDIAN__ +#ifdef CONFIG_CPU_LITTLE_ENDIAN OUTPUT_FORMAT("elf64-powerpcle", "elf64-powerpcle", "elf64-powerpcle") #else OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", "elf64-powerpc") -- 2.39.2