]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gas: add --enable-default-sframe configure option
authorSam James <sam@gentoo.org>
Thu, 3 Jul 2025 10:08:59 +0000 (11:08 +0100)
committerSam James <sam@gentoo.org>
Sat, 23 Aug 2025 02:04:35 +0000 (03:04 +0100)
commitb0653e3db9c6d0d4f1f547e19aaad621aad58920
treeb37c51ee939fa8f0ead2625d6f04f17e639135c0
parent850a812601b9d0d87613ab552becd735424bf89d
gas: add --enable-default-sframe configure option

SFrames make the most sense when userland as a whole is built with them,
so add a --enable-default-sframe configure flag to facilitate distributors
and vendors doing that.

The primary motivation for a configure-time flag is that we don't support
SFrame for 32-bit x86 but some packaging uses the same flags (with some
added on top) for multilib builds (to support old binaries like games),
and simply adding `-Wa,--gsframe` to the standard build flags isn't an
option (*).

That aside, I believe it'll be helpful for testing and eventual adoption
in any case.

In summary, combined with the recent --gsframe=[yes|no] support (**):
* Configured with --enable-default-sframe and nothing is passed
  => SFrames (previously no SFrames)
* Configured with --enable-default-sframe and --gsframe=yes is passed
  => SFrames (no change from before)
* Configured with --enable-default-sframe and --gsframe=no is passed
  => No SFrames (no change from before)
* Configured with --enable-default-sframe and --gsframe is passed
  => SFrames (no change from before)

* Configured with --disable-default-sframe and nothing is passed
  => No SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe=yes is passed
  => SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe=no is passed
  => No SFrames (no change from before)
* Configured with --disable-default-sframe and --gsframe is passed
  => SFrames (no change from before)

I've introduced a sframe_as_bad macro on Indu's suggestion. A following
patch uses its sibling sframe_as_warn heavily and having symmetry plus
the macro as a form of documentation of intent seems useful.

(*) It gets added to multilib builds too and then we hit the
    `.sframe not supported for target` error in gas/dw2gencfi.c.

(**) I've verbosely listed --gsframe=yes but it's the same as --gsframe.

gas/
PR gas/33126
* as.c (enum gen_sframe_option): Initialize if DEFAULT_SFRAME.
* config.in (DEFAULT_SFRAME): New.
* configure: Regenerate.
* configure.ac: Add --enable-default-sframe.
* doc/as.texi: Document --enable-default-sframe.
* dw2gencfi.c (cfi_finish): Don't warn if SFrames are enabled
by default but unavailable for this target.
* gen-sframe.h (sframe_as_bad): New macro.
gas/as.c
gas/config.in
gas/configure
gas/configure.ac
gas/doc/as.texi
gas/dw2gencfi.c
gas/gen-sframe.h