#1013244 binutils should be configured with --disable-warn-execstack on mips*

Package:
binutils
Source:
binutils
Description:
GNU assembler, linker and binary utilities
Submitter:
Adrian Bunk
Date:
2022-06-27 22:09:03 UTC
Severity:
serious
Tags:
#1013244#5
Date:
2022-06-19 20:33:53 UTC
From:
To:
Several packages FTBFS on mips* due to a combination of the
following:
1. https://sourceware.org/bugzilla/show_bug.cgi?id=29072
2. makes ~ every linking on mips* emit a warning due to
https://sourceware.org/legacy-ml/libc-announce/2020/msg00001.html
   ("For MIPS hard-float ABIs, the GNU C Library will be configured to
     need an executable stack")
3. this causes FTBFS in packages using -Wl,--fatal-warnings

It wouldn't make sense to start patching all individual packages
that use -Wl,--fatal-warnings, as long as mips* ends up with
~ everything having executable stack the best approach is to
configure binutils with --disable-warn-execstack on mips*

#1013244#12
Date:
2022-06-21 22:29:17 UTC
From:
To:
Dear Maintainer,

This problem is also present on hppa. GNU stack notes are disabled to provide
an executable stack for signal returns and syscall restarts. We also have
a RWX load segement due to trampoline in PLT. This is needed for lazy
binding.

This causes various builds to fail and thousands of testsuite fails in gcc.

We now have vdso support in Linux v5.18 but gcc still doesn't GNU stack notes.

The binutils issue is fixed on hppa by upstream commit
b232f81a54815a90f0bff01067ba08fe17a7c797. Probably, something similar
could be done for mips.

Regards,
Dave Anglin

#1013244#17
Date:
2022-06-22 10:35:14 UTC
From:
To:
is this something that should be better done like for hppa?
#1013244#24
Date:
2022-06-22 11:41:44 UTC
From:
To:
I don't think any additional changes are needed at this time for hppa.

The actual fix upstream was:

commit acd65fa610df09a0954b8fecdadf546215263c5d
Author: Nick Clifton <nickc@redhat.com>
Date:   Tue Jun 21 11:22:38 2022 +0100

     Default to disabling the linker warnings about execstack and RWX segments if the target is the HPPA architecture.

             PR 29263
             * configure.ac (ac_default_ld_warn_execstack): Default to 'no' for
             HPPA targets.
             (ac_default_ld_warn_rwx_segments): Likewise.
             * configure: Regenerate.
             * testsuite/ld-elf/elf.exp: Add the --warn-execstack command line
             option to the command line when running execstack tests for the
             HPPA target.

Unfortunately, configure was not generated correctly when this change was committed.

I plan to add a gcc option to enable output of GNU stack notes.  At some point in the future, it may be possible
to configure binutils on hppa with --enable-warn-execstack but currently an executable stack is needed with
all longterm Linux kernels.

Dave

#1013244#29
Date:
2022-06-27 22:04:28 UTC
From:
To:
Version: 2.38.50.20220627-1

This has now been done upstream also for mips (but FTBFS on mips64el
since there is a testcase testing for the warning that now fails).

cu
Adrian