Thread (8 messages) 8 messages, 3 authors, 2025-03-28

Re: [main-line]Build warnings on PowerPC system

From: Madhavan Srinivasan <maddy@linux.ibm.com>
Date: 2025-03-28 11:14:55
Also in: lkml
Subsystem: linux for powerpc (32-bit and 64-bit), the rest · Maintainers: Madhavan Srinivasan, Michael Ellerman, Linus Torvalds

quoted
quoted
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

 
Maddy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help