path: root/configure
diff options
authorRich Felker <>2017-08-11 00:17:00 -0400
committerRich Felker <>2017-08-11 00:17:00 -0400
commitdc2f368e565c37728b0d620380b849c3a1ddd78f (patch)
tree670c8185a57f03ca9779ef87f3bb834f2799fcd8 /configure
parent947d330f68c49680dcc54439f56da2a297228962 (diff)
disable global visibility override hack (vis.h) by default
neither current compilers nor linkers treat protected visibility the way I expected, as having fixed source-level semantics rather than being dependent on target-specific ABI details, and change seems unlikely. while the use here does not actually depend on the specific semantics, at least some versions of some linkers, especially lld, refuse to allow linking to a where the symbols have protected visibility. this cannot be detected at configure-time because linking itself works fine, and because even if we could test linking an application against successfully, we could not justifiably assume that the same linker used to link would also be used later to link applications. disable the vis.h hack by default at the configure level, but add an explicit "auto" option to request the old configure-time detection rather than just removing it. this leaves it easy to evaluate whether it actually resulted in significant size or performance benefits while ensuring that out-of-the-box builds are not unlinkable for some users. fortunately, preliminary evaluation suggests that at least x86_64, arm, and aarch64 don't suffer at all from the change, and impact on other archs is low. if low is not low enough, it should not be hard to analyze where the significant PLT call ABI costs are present and mitigate them without the hack.
Diffstat (limited to 'configure')
1 files changed, 3 insertions, 2 deletions
diff --git a/configure b/configure
index 539c9fcb..02b736ce 100755
--- a/configure
+++ b/configure
@@ -31,7 +31,7 @@ Optional features:
--enable-optimize=... optimize listed components for speed over size [auto]
--enable-debug build with debugging information [disabled]
--enable-warnings build with recommended warnings flags [disabled]
- --enable-visibility use global visibility options to optimize PIC [auto]
+ --enable-visibility use global visibility options to optimize PIC [no]
--enable-wrapper=... build given musl toolchain wrapper [auto]
--disable-shared inhibit building shared library [enabled]
--disable-static inhibit building static library [enabled]
@@ -135,7 +135,7 @@ target=
@@ -163,6 +163,7 @@ case "$arg" in
--disable-debug|--enable-debug=no) debug=no ;;
--enable-warnings|--enable-warnings=yes) warnings=yes ;;
--disable-warnings|--enable-warnings=no) warnings=no ;;
+--enable-visibility=auto) visibility=auto ;;
--enable-visibility|--enable-visibility=yes) visibility=yes ;;
--disable-visibility|--enable-visibility=no) visibility=no ;;
--enable-wrapper|--enable-wrapper=yes) wrapper=detect ;;