Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp1010468lqt; Fri, 7 Jun 2024 05:48:06 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUBmhYxsUeWCtdzGVncAVZrj2VwkTfQ8IruR0YdsANQUXnhHNfYKOL7Ld+JKVb5oFNZ+bEiMNSrQFAJuOqiyvNEpM7tT5mvOEeRikjCjA== X-Google-Smtp-Source: AGHT+IGS8RU0kPPso+d6S/4CG7YyAQAoq6dthjAw4RcUyfxOqzr1K57QhuipAA/oUEbBfk5wR8m6 X-Received: by 2002:a17:902:ceca:b0:1f6:1c72:955f with SMTP id d9443c01a7336-1f6d03a10fdmr22356645ad.43.1717764486245; Fri, 07 Jun 2024 05:48:06 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717764486; cv=pass; d=google.com; s=arc-20160816; b=GQsG+e31WbZ1oZuKaRmM6PHax7ZuCNzkxYeSDKpAD17m5fcPZkxBWQfEzqRojsfs32 0TtUvpTQ1ITxhORZXlz08bpFMxLKSnkEj+X7CdO13q/uqj3CoKtazq8Wej5RYOh71QDo Rmxj/bxBt1WBfUNu6Fjy6WbKFau2TGDQ8hjt6xtf8vvuLaTPijTPQlwS3sNCXjlUwiup EKXNm/CAFapEFdOOZL1q/a8C6yMSOP/L6fLpMBd20J5mE9NTR4CZtPKjxl6yM4Q8xe0O iUz33bH8Jqmxt9c7bsrNDeCOGCtqcBwlsQsZ3HAZaJQrKyeQ8UpViAVPkNZ49zkx6+3N g6IA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=bqla57tOtU1mgzH0i+KepUx0yjfzWO1zi3pSk2wCH7k=; fh=uqqVMq9tVYsOe2etlW0niHrJOCSDkJYPyKsmfdUufRo=; b=HOsMThVQtWL67+6cWSZIk6rLbwdI9i63LkzttVqfrzEwSjVz4vDSpUv62ajvWz4t5L omIMrWTqm/P1dywDW727z/d//Ww5jvuMH4KdEwNihp0moLTKNVCoS9sffIKJN/XfZC9u ytQrRmGevSp9nk+OScCpbJu5zeE5r0Bnys/P7EeyoWbvdp0TvuTk4IXgYmJLjR/+kK+M 26acimtXtS57iyoacHmLNX+2igdINnLsZrHtu3C+GEtn8PRdfZ9ejbduta0uVdjOhWxo cqDgwJjtMymMZtGuw4h36cE2TX1AfwxBc4Diz1WShyhE66DXYtw5gfFy+j77ZT8phGpI VXYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=O8v4kHDn; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-206078-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206078-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1f6e7a734e1si3564365ad.14.2024.06.07.05.48.05 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jun 2024 05:48:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-206078-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@ellerman.id.au header.s=201909 header.b=O8v4kHDn; arc=pass (i=1 spf=pass spfdomain=ellerman.id.au dkim=pass dkdomain=ellerman.id.au); spf=pass (google.com: domain of linux-kernel+bounces-206078-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-206078-linux.lists.archive=gmail.com@vger.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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9FFF0288CEC for ; Fri, 7 Jun 2024 12:47:34 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id EB07E193093; Fri, 7 Jun 2024 12:42:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b="O8v4kHDn" Received: from mail.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) (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 68862192B71; Fri, 7 Jun 2024 12:42:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=150.107.74.76 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717764179; cv=none; b=fqpPnsDwfiQV97F4HCeuq7OItNcPOnsDtdGY6DUNZsNofNmPu46LsDO1z9/Djl47YaqZ92sjVqdWKogudUvpU1acvJy6erGnbuFnbfVD2uMLG3BZrrriaB8GtWFdGaVY/qHb9KQZ0M5IyT+tpIQmIO2heg699MJKX92eXv+eBXE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717764179; c=relaxed/simple; bh=qEfoIYcUTsUg3gv//R+kNqg80au3Sr4sLIrkhTYVgf4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=IdVcZ+Y+opF/62e6xYMFKj5YgetGdQHjmu2oPTcghL44dzX/SQNT37ABRB51iuQdIsgpxkiHbyfZMhVlQFvjN0STx5BzQGRYwFQ1Si6nCQ0nAS0phuJ9x421fuF6r1ld8U1cBJg+efT20rmHNLZkGooNRtmIog/+QhWDZdgcFHI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au; spf=pass smtp.mailfrom=ellerman.id.au; dkim=pass (2048-bit key) header.d=ellerman.id.au header.i=@ellerman.id.au header.b=O8v4kHDn; arc=none smtp.client-ip=150.107.74.76 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ellerman.id.au DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1717764169; bh=bqla57tOtU1mgzH0i+KepUx0yjfzWO1zi3pSk2wCH7k=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=O8v4kHDnEusUpfTKv+k9ca6+DKUiHrGwKXNLOEj5uQVJnWaRRdXzLXMDqDNJrndoj J4JanOe0eVBq1cm+iF7iDDkGMR/NGrQwNm2N3ZCmN0Kj6X1dCwSNcjWxtKEoqOHW4A jREgJLFAA9rgjPccpjHmRcwgIM5r9GC2CW3aYpl9Py4LXWixl11AiYe7h2cbF8R5ny wMYQhVEF5bZV5JDI7n7Rkg5zmJYIKBw4dph5bKg+DdsT85S58graDqz4dF3GxZxzoL zc3LEhEG40+eUz0kTjrV3F+4yK1Chlt1GwPBU0ZiXNSN2vL4p/jERZzpzt+2W5igEq BWfVHkKqAZtaw== Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4VwgpG42nXz4wc3; Fri, 7 Jun 2024 22:42:46 +1000 (AEST) From: Michael Ellerman To: Arnd Bergmann 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: Re: [PATCH] powerpc: vdso: fix building with wrong-endian toolchain In-Reply-To: <20240607061629.530301-1-arnd@kernel.org> References: <20240607061629.530301-1-arnd@kernel.org> Date: Fri, 07 Jun 2024 22:42:44 +1000 Message-ID: <87frtoq5yz.fsf@mail.lhotse> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Arnd Bergmann writes: > 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. 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. cheers > 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