Check linker support for -Wl,-Bstatic in strippedtest.
Ensures libbacktrace's strippedtest suite doesn't fail on systems with non-GNU linkers.
This commit addresses a test suite failure in libbacktrace that occurred on systems using proprietary linkers, like HP-UX’s, which do not support GNU linker flags such as -Wl,-Bstatic. Previously, these flags were hardcoded in the strippedtest build, causing linkage errors. The change introduces an autoconf check to dynamically verify linker support for -Wl,-Bstatic, making the build adaptable to different linker types and preventing the test suite from halting prematurely.
In Details
The libbacktrace test suite includes a 'strippedtest' that links object files with specific linker flags. On targets like hppa64-hp-hpux11.11, the native linker does not understand GNU-specific options like '-Wl,-Bstatic'. The hardcoded use of this flag in Makefile.am caused the strippedtest linkage to fail. This patch adds a new autoconf check, libbacktrace_cv_linker_bstatic, to determine if the target linker supports '-Wl,-Bstatic'. The result is substituted into the BSTATIC_LDFLAG variable, which is then used in strippedtest_LDFLAGS in Makefile.am, allowing the build to correctly omit the…
- libbacktrace
- A library providing functions to generate stack traces, typically used for debugging and error reporting in C/C++ programs.
- strippedtest
- A specific test case within the libbacktrace test suite that likely involves linking object files and verifying behavior, potentially focusing on scenarios where symbols are stripped from binaries.
- -Wl,-Bstatic
- A linker flag passed through the compiler driver. '-Bstatic' instructs the linker to prefer static libraries over shared libraries during the linking process.
- Autoconf
- A tool used in the GNU build system to automatically configure source code packages to adapt to different operating systems and environments. It generates shell scripts that check for system features and set up build parameters.
- Makefile.am
- A file used by the Automake tool to describe how to build software packages. It specifies compilation rules, dependencies, and link commands, and is processed by Autoconf.