From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Madhavan Srinivasan <maddy@linux.ibm.com>,
Venkat Rao Bagalkote <venkat88@linux.ibm.com>,
linuxppc-dev <linuxppc-dev@lists.ozlabs.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [main-line]Build warnings on PowerPC system
Date: Fri, 28 Mar 2025 12:48:53 +0100 [thread overview]
Message-ID: <d021d85f-e00e-4795-878f-ee53a5fd886c@csgroup.eu> (raw)
In-Reply-To: <e18df940-bb30-44c9-9384-7325e8d02d25@linux.ibm.com>
Le 28/03/2025 à 12:14, Madhavan Srinivasan a écrit :
>
>>>> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
>>>> index 1db60fe13802..09ceb5a42d81 100755
>>>> --- a/arch/powerpc/boot/wrapper
>>>> +++ b/arch/powerpc/boot/wrapper
>>>> @@ -235,7 +235,7 @@ fi
>>>> # suppress some warnings in recent ld versions
>>>> nowarn="-z noexecstack"
>>>> if ! ld_is_lld; then
>>>> - if [ "$LD_VERSION" -ge "$(echo 2.39 | ld_version)" ]; then
>>>> + if [ "$LD_VERSION" -ge "$(echo 2.35 | ld_version)" ]; then
>>>> nowarn="$nowarn --no-warn-rwx-segments"
>>>> fi
>>>> fi
>>> Above change fixes the issue. No warnings observed. Thank you!!
>>
>> Take care, this must be a special version of binutils.
>>
>> With regular 2.36.1 I get following error:
>>
>> $ /opt/gcc/gcc-8.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --version
>> GNU ld (GNU Binutils) 2.36.1
>> Copyright (C) 2021 Free Software Foundation, Inc.
>> This program is free software; you may redistribute it under the terms of
>> the GNU General Public License version 3 or (at your option) a later version.
>> This program has absolutely no warranty.
>>
>> $ /opt/gcc/gcc-8.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld --no-warn-rwx-segments test.o
>> /opt/gcc/gcc-8.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld: unrecognized option '--no-warn-rwx-segments'
>> /opt/gcc/gcc-8.5.0-nolibc/powerpc64-linux/bin/powerpc64-linux-ld: use the --help option for usage information
>>
>
> Nice catch. Thanks Christophe.
>
> May be we need to handle this special/specific case with an
> additional check
>
> diff --git a/arch/powerpc/boot/wrapper b/arch/powerpc/boot/wrapper
> index 1db60fe13802..d3779c20e548 100755
> --- a/arch/powerpc/boot/wrapper
> +++ b/arch/powerpc/boot/wrapper
> @@ -237,6 +237,8 @@ nowarn="-z noexecstack"
> if ! ld_is_lld; then
> if [ "$LD_VERSION" -ge "$(echo 2.39 | ld_version)" ]; then
> nowarn="$nowarn --no-warn-rwx-segments"
> + elif [ "$LD_VERSION" -eq "235020000" ]; then
> + nowarn="$nowarn --no-warn-rwx-segments"
> fi
> fi
>
I think it is not the official version of 2.35.2, it is a modified
version from a distribution. It doesn't exist in the official 2.35.2:
$ git remote -v
origin https://sourceware.org/git/binutils-gdb.git (fetch)
origin https://sourceware.org/git/binutils-gdb.git (push)
$ git grep rwx-segments origin/binutils-2_35-branch
[empty]
What about doing something like commit 0d362be5b142 ("Makefile: link
with -z noexecstack --no-warn-rwx-segments") ?
Christophe
prev parent reply other threads:[~2025-03-28 12:20 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-26 19:03 [main-line]Build warnings on PowerPC system Venkat Rao Bagalkote
2025-03-27 13:52 ` Madhavan Srinivasan
2025-03-27 14:01 ` Venkat Rao Bagalkote
2025-03-27 15:06 ` Madhavan Srinivasan
2025-03-27 16:24 ` Venkat Rao Bagalkote
2025-03-27 18:55 ` Christophe Leroy
2025-03-28 11:14 ` Madhavan Srinivasan
2025-03-28 11:48 ` Christophe Leroy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=d021d85f-e00e-4795-878f-ee53a5fd886c@csgroup.eu \
--to=christophe.leroy@csgroup.eu \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=maddy@linux.ibm.com \
--cc=venkat88@linux.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).