From: stephan Date: Fri, 21 Feb 2025 03:19:21 +0000 (+0000) Subject: configure: in several places where support for -Wl,... linker flags are checked,... X-Git-Tag: major-release~254 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=220260b8965eb264cab8cb5ee42baacb08ef1eb4;p=thirdparty%2Fsqlite.git configure: in several places where support for -Wl,... linker flags are checked, ensure that the check invokes the linker (not just the compiler) to avoid false positives. This allows us to remove the AIX-specific handling and --disable-rpath bits added in [a15e0f680], as well as make several similar checks more robust. FossilOrigin-Name: 4e81e2c707a954dcda6219dc94e2b96dd0c9907bd4beab28adad51d488b7d739 --- diff --git a/auto.def b/auto.def index 84dfa824c2..9df87f579a 100644 --- a/auto.def +++ b/auto.def @@ -59,7 +59,7 @@ proj-define-for-opt linemacros AMALGAMATION_LINE_MACROS \ define LINK_TOOLS_DYNAMICALLY [proj-opt-was-provided dynlink-tools] -sqlite-handle-rpath +proj-check-rpath sqlite-handle-soname sqlite-handle-debug sqlite-handle-tcl diff --git a/autoconf/auto.def b/autoconf/auto.def index 069f3e931f..099b52aff7 100644 --- a/autoconf/auto.def +++ b/autoconf/auto.def @@ -11,7 +11,7 @@ use sqlite-config sqlite-config-bootstrap autoconf sqlite-check-common-bins sqlite-check-common-system-deps -sqlite-handle-rpath +proj-check-rpath sqlite-handle-soname sqlite-setup-default-cflags sqlite-handle-debug diff --git a/autosetup/proj.tcl b/autosetup/proj.tcl index 210c79b428..c11b05d5f7 100644 --- a/autosetup/proj.tcl +++ b/autosetup/proj.tcl @@ -944,23 +944,7 @@ proc proj-check-emsdk {} { # --exec-prefix=... or --libdir=... are explicitly passed to # configure then [get-define libdir] is used (noting that it derives # from exec-prefix by default). -# -# Achtung: we have seen platforms which report that a given option -# checked here will work but then fails at build-time, and the current -# order of checks reflects that. Similarly, platforms which are known -# to report success here but fail to handle this flag at link-time are -# special-cased here to behave as if the check failed. proc proj-check-rpath {} { - switch -glob -- [get-define host] { - *-*-aix* { - # Skip this check on platform(s) where we know it to pass at - # this step but fail at build-time, as a workaround for - # https://sqlite.org/forum/forumpost/ae5bd8a84b until we can - # find a more reliable approach. - define LDFLAGS_RPATH "" - return 0 - } - } if {[proj-opt-was-provided libdir] || [proj-opt-was-provided exec-prefix]} { set lp "[get-define libdir]" @@ -971,7 +955,7 @@ proc proj-check-rpath {} { # CFLAGS or LIBS or whatever it is that cc-check-flags updates) then # downstream tests may fail because the resulting rpath gets # implicitly injected into them. - cc-with {} { + cc-with {-link 1} { if {[cc-check-flags "-rpath $lp"]} { define LDFLAGS_RPATH "-rpath $lp" } elseif {[cc-check-flags "-Wl,-rpath,$lp"]} { @@ -1001,7 +985,7 @@ proc proj-check-rpath {} { # potentially avoid some end-user confusion by using their own lib's # name here (which shows up in the "checking..." output). proc proj-check-soname {{libname "libfoo.so.0"}} { - cc-with {} { + cc-with {-link 1} { if {[cc-check-flags "-Wl,-soname,${libname}"]} { define LDFLAGS_SONAME_PREFIX "-Wl,-soname," return 1 diff --git a/autosetup/sqlite-config.tcl b/autosetup/sqlite-config.tcl index be2522fb12..856be4cabc 100644 --- a/autosetup/sqlite-config.tcl +++ b/autosetup/sqlite-config.tcl @@ -244,9 +244,6 @@ proc sqlite-config-bootstrap {buildMode} { static-shell=1 => {Link the sqlite3 shell app against the DLL instead of embedding sqlite3.c} } {*} { - # rpath: https://sqlite.org/forum/forumpost/fa3a6ed858 - rpath=1 - => {Disable checking for rpath support} # soname: https://sqlite.org/src/forumpost/5a3b44f510df8ded soname:=legacy => {SONAME for libsqlite3.so. "none", or not using this flag, sets no @@ -647,17 +644,6 @@ proc sqlite-handle-debug {} { } } -######################################################################## -# If the --disable-rpath flag is used, this [define]s LDFLAGS_RPATH to -# an empty string, else it invokes [proj-check-rpath]. -proc sqlite-handle-rpath {} { - proj-if-opt-truthy rpath { - proj-check-rpath - } { - define LDFLAGS_RPATH "" - } -} - ######################################################################## # "soname" for libsqlite3.so. See discussion at: # https://sqlite.org/src/forumpost/5a3b44f510df8ded @@ -1240,7 +1226,7 @@ proc sqlite-check-mac-cversion {} { define LDFLAGS_MAC_CVERSION "" set rc 0 if {[proj-looks-like-mac]} { - cc-with {} { + cc-with {-link 1} { # These version numbers are historical libtool-defined values, not # library-defined ones if {[cc-check-flags "-Wl,-current_version,9.6.0"] @@ -1264,16 +1250,19 @@ proc sqlite-check-mac-cversion {} { # (e.g. mingw). Returns 1 if supported, else 0. # # If the configure flag --out-implib is not used then this is a no-op. -# The feature is specifically opt-in because on some platforms the -# feature test will pass but using that flag will fail at link-time -# (e.g. OpenBSD). +# If that flag is used but the capability is not available, a fatal +# error is triggered. +# +# This feature is specifically opt-in because it's supported on far +# more platforms than actually need it and enabling it causes creation +# of libsqlite3.so.a files which are unnecessary in most environments. # # Added in response to: https://sqlite.org/forum/forumpost/0c7fc097b2 proc sqlite-check-out-implib {} { define LDFLAGS_OUT_IMPLIB "" set rc 0 if {[proj-opt-was-provided out-implib]} { - cc-with {} { + cc-with {-link 1} { set dll "libsqlite3[get-define TARGET_DLLEXT]" set flags "-Wl,--out-implib,${dll}.a" if {[cc-check-flags $flags]} { @@ -1281,6 +1270,9 @@ proc sqlite-check-out-implib {} { set rc 1 } } + if {!$rc} { + user-error "--out-implib is not supported on this platform" + } } return $rc } diff --git a/manifest b/manifest index 6e5b6edfe0..89f3436486 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C configure:\sautomatically\sfail\sthe\scheck\sfor\srpath\son\sAIX\ssystems\sand\sprovide\sa\s--disable-rpath\sflag\sas\sa\sfallback\sfor\suse\son\splatforms\swhich\spass\sthe\sconfigure-time\srpath\scheck\sbut\sthen\sfail\sat\slink-time.\sBased\son\sdiscussion\sin\s[forum:ae5bd8a84b|forum\sthread\sae5bd8a84b]. -D 2025-02-20T17:14:40.228 +C configure:\sin\sseveral\splaces\swhere\ssupport\sfor\s-Wl,...\slinker\sflags\sare\schecked,\sensure\sthat\sthe\scheck\sinvokes\sthe\slinker\s(not\sjust\sthe\scompiler)\sto\savoid\sfalse\spositives.\sThis\sallows\sus\sto\sremove\sthe\sAIX-specific\shandling\sand\s--disable-rpath\sbits\sadded\sin\s[a15e0f680],\sas\swell\sas\smake\sseveral\ssimilar\schecks\smore\srobust. +D 2025-02-21T03:19:21.417 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md e108e1e69ae8e8a59e93c455654b8ac9356a11720d3345df2a4743e9590fb20d @@ -14,13 +14,13 @@ F art/sqlite370.eps aa97a671332b432a54e1d74ff5e8775be34200c2 F art/sqlite370.ico af56c1d00fee7cd4753e8631ed60703ed0fc6e90 F art/sqlite370.jpg d512473dae7e378a67e28ff96a34da7cb331def2 F art/sqlite370.svg 40b7e2fe8aac3add5d56dd86ab8d427a4eca5bcb3fe4f8946cb3794e1821d531 -F auto.def 9e4315ae57d558c033a7bfb1f3ba0e9e0117147516b8c78c06276663b83b8cad +F auto.def eddf6aef976e2c1a56c0accc3244945e0b22ec6799074c40be160e5a9a5662b0 F autoconf/Makefile.fallback 22fe523eb36dfce31e0f6349f782eb084e86a5620b2b0b4f84a2d6133f53f5ac F autoconf/Makefile.in ed042ba44540e67e17b1e7bd787e8118a9d14664ba8049966ec9bc54a10676ce F autoconf/Makefile.msc 1249e425a24859c7b3f17575275247df9eec3bddc0d1d7e73941f1abdbb95a92 F autoconf/README.first f1d3876e9a7852c22f275a6f06814e64934cecbc0b5b9617d64849094c1fd136 F autoconf/README.txt 7f01dc3915e2d68f329011073662369e62a0938a2c69398807823c57591cb288 -F autoconf/auto.def 64c1a116162da18783a5467b49e539538f7013ea50ae192f182987b5c2f66f9e +F autoconf/auto.def 3a318c4898024b35ed61a4876a42e3dcc313f93bd8486874d1ad498b88643d1a F autoconf/tea/Makefile.in ba0556fee8da09c066bad85a4457904e46ee2c2eabaa309c0e83a78f2f151a8e F autoconf/tea/README.txt 61e62e519579e4a112791354d6d440f8b51ea6db3b0bab58d59f29df42d2dfe3 F autoconf/tea/aclocal.m4 52c47aac44ce0ddb1f918b6993e8beb8eee88f43 @@ -49,8 +49,8 @@ F autosetup/cc-shared.tcl 4f024e94a47f427ba61de1739f6381ef0080210f9fae89112d5c1d F autosetup/cc.tcl c0fcc50ca91deff8741e449ddad05bcd08268bc31177e613a6343bbd1fd3e45f F autosetup/jimsh0.c 6573f6bc6ff204de0139692648d7037ca0b6c067bac83a7b4e087f20a86866a4 F autosetup/pkg-config.tcl 4e635bf39022ff65e0d5434339dd41503ea48fc53822c9c5bde88b02d3d952ba -F autosetup/proj.tcl 57dadc3b9a1e88e8450d1e81b2fdb22d3abf3862f22730cec4441ee346c95d8e -F autosetup/sqlite-config.tcl 87732c140cce3327b709d1f7746c999149500fd28682dff384da58af68c844b0 +F autosetup/proj.tcl cd6134e98d06ab4ae3be746d185dcdbf5180bfa049fe46a6726e703f56ea2f9c +F autosetup/sqlite-config.tcl 9d1e3bbc561af5f8705f96c0f48252112d3e2d3356383f5529f7f9f7b51afb65 F autosetup/system.tcl 51d4be76cd9a9074704b584e5c9cbba616202c8468cf9ba8a4f8294a7ab1dba9 F configure 9a00b21dfd13757bbfb8d89b30660a89ec1f8f3a79402b8f9f9b6fc475c3303a x F contrib/sqlitecon.tcl 210a913ad63f9f991070821e599d600bd913e0ad @@ -2210,8 +2210,8 @@ F tool/version-info.c 3b36468a90faf1bbd59c65fd0eb66522d9f941eedd364fabccd7227350 F tool/warnings-clang.sh bbf6a1e685e534c92ec2bfba5b1745f34fb6f0bc2a362850723a9ee87c1b31a7 F tool/warnings.sh 49a486c5069de041aedcbde4de178293e0463ae9918ecad7539eedf0ec77a139 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P 56027220cc15b69cb98ba5360ffd3718c997e10d51e30eebeff14f0dc358d103 -R f3ae16535d715f2c6ddf37b01c3a97d9 +P a15e0f6802a5ba7bc5a7a70d6a162ea4548b49b132a5ac31263e64c388bbafcb +R 42c23a2d2b7be27c2c7a4de01b0af4e3 U stephan -Z e0fc1942290bf1287975667fbad9ae43 +Z 369390f432e27c3785cf51965afea95c # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index 72543de028..b9eb88d3ff 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -a15e0f6802a5ba7bc5a7a70d6a162ea4548b49b132a5ac31263e64c388bbafcb +4e81e2c707a954dcda6219dc94e2b96dd0c9907bd4beab28adad51d488b7d739