diff options
author | Aidan MacDonald <amachronic@protonmail.com> | 2022-12-04 15:44:20 +0000 |
---|---|---|
committer | Solomon Peachy <pizza@shaftnet.org> | 2023-05-22 14:48:07 -0400 |
commit | e7cc77e5b882be40122010b037401d3e9a4c519b (patch) | |
tree | b0ca97e3c0b7e81852ddcb33dc7961692bd57fd5 | |
parent | 6e05fcf4d01a1beac811a6eaf9c27fa3aed7e4da (diff) | |
download | rockbox-e7cc77e5b8.tar.gz rockbox-e7cc77e5b8.zip |
configure: Detect linker's NO_CROSSREFS_TO() support
NO_CROSSREFS_TO() was first introduced in binutils 2.27.
It is used to have the linker report errors when symbols
from a list of sections refer to a specified section,
which is useful for verifying that normal code does not
refer to INIT_ATTR code.
Note this doesn't actually start using NO_CROSSREFS_TO()
for builds -- that will have to wait until the toolchain
upgrade when we'll have a new enough binutils -- it just
detects support for the feature so it can be conditionally
enabled in linker scripts.
Change-Id: If1553eaa671fcbbdfe6af357a6331931e7c4f997
-rwxr-xr-x | tools/configure | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/tools/configure b/tools/configure index 7f5b5c6f5b..651346ecd8 100755 --- a/tools/configure +++ b/tools/configure @@ -4363,6 +4363,17 @@ else ldver=`$LD --version | head -n 1 | sed -e 's/\ /\n/g' | tail -n 1` fi +# Convert LD version to a number major*100 + minor +ldnum1=`echo $ldver | cut -d . -f1` +ldnum2=`echo $ldver | cut -d . -f2` +ldnum=`(expr $ldnum1 "*" 100 + $ldnum2) 2>/dev/null` + +if test "$ldnum" -ge "227"; then + have_nocrossrefs_to="#define HAVE_NOCROSSREFS_TO" +else + have_nocrossrefs_to="#undef HAVE_NOCROSSREFS_TO" +fi + if [ -z "$gccver" ]; then echo "[WARNING] The compiler you must use ($CC) is not in your path!" echo "[WARNING] this may cause your build to fail since we cannot do the" @@ -4600,6 +4611,9 @@ ${app_lcd_height} #define ROCKBOX_BINARY_PATH "${bindir}" #define ROCKBOX_LIBRARY_PATH "${libdir}" +/* linker feature test macro for validating cross-section references */ +${have_nocrossrefs_to} + #endif /* __BUILD_AUTOCONF_H */ EOF |