SQLite User Forum

SQLite 3.50: Is there no way to disable rpath?
Login

SQLite 3.50: Is there no way to disable rpath?

(1) By Guðni (gudnimg) on 2025-06-22 18:21:04 [source]

I'm trying to upgrade SQLite in the Yocto project from 3.48 to 3.49.2+. But am seeing an issue with the output library/binaries having rpaths included.

ERROR: sqlite3-5_3.49.2-r0 do_package_qa: QA Issue: libsqlite3: /usr/lib/libsqlite3.so.3.49.2 contains probably-redundant RPATH /usr/lib [useless-rpaths]
ERROR: sqlite3-5_3.49.2-r0 do_package_qa: QA Issue: sqlite3: /usr/bin/sqlite3 contains probably-redundant RPATH /usr/lib [useless-rpaths]

The --disable-rpath option isn't accepted by autosetup. Any setting LDFLAGS_RPATH="" via the configure command has no effect. Is there something I'm missing?

Any help would be appreciated.

(2) By Stephan Beal (stephan) on 2025-06-22 22:49:50 in reply to 1 [link] [source]

Is there no way to disable rpath?

We have long had configure script code to do that but it was commented out because it was deemed to be a "solution looking for a problem."

This checkin reactivates the --disable-rpath flag and that will part of 3.51.

(3) By Guðni (gudnimg) on 2025-06-23 08:41:20 in reply to 2 [link] [source]

Thanks for the quick reply Stephan and the commit! I’ll update my build to backport that commit into 3.50 to test the change today or in the next few days.

When I was looking into this yesterday I noticed a lot of libraries provide this --disable-rpath option so its not just SQLite specific :)

(4) By Zephyr Lykos (mochaa) on 2026-09-21 10:24:56 in reply to 2 [link] [source]

Hi, we (Fedora packaging) would also want to disable rpath for libtclsqlite3.

PoC: https://fars.ee/xc0H.patch

(5.1) By Stephan Beal (stephan) on 2026-09-21 11:50:32 edited from 5.0 in reply to 4 [link] [source]

... also want to disable rpath for libtclsqlite3.

Can you tell us how you're building it? The extension has a couple of different approaches, one of which (the TEA-style one) is slated for removal as soon as someone (🙋) gets around to it.

In 3.54 (current trunk) --disable-rpath removes the -rpath link flag from tclsqlite3 for me and "make tclextension" does not appear to use -rpath, irrespective of that flag.

(6) By Zephyr Lykos (mochaa) on 2026-09-21 12:20:00 in reply to 5.1 [link] [source]

I can reproduce this with ./configure --disable-rpath && make libtcl && chrpath -l libtcl*.so on b0919c9687f01240c89171e1607816b603450e5b.

This seems to always be defined: https://sqlite.org/src/file?ci=b0919c9687f01240c89171e1607816b603450e5b&name=main.mk&ln=1652

(7) By Stephan Beal (stephan) on 2026-09-21 13:09:58 in reply to 6 [link] [source]

I can reproduce this with ...

In trunk make libtcl now honors --disable-rpath. Thank you for the report!

(8) By Zephyr Lykos (mochaa) on 2026-09-21 13:18:09 in reply to 7 [link] [source]

thanks for the quick fix! we're good with not autodetecting the rpath argument style?

(9) By Stephan Beal (stephan) on 2026-09-21 13:30:00 in reply to 8 [link] [source]

we're good with not autodetecting the rpath argument style?

For the main lib build detect the proper -rpath flag style using the linker. For tcl we rely on the contents of tclConfig.sh, which unfortunately formulates some of its vars as makefile var refs, but that only works when they are injected into a makefile rather than sourced via shell script, like main.mk does (noting that it is a static makefile).

We've yet to hear of any reports where that hard-coded -rpath style has failed for anyone running "make libtcl", so i'm not currently keen on adding new code to unmangle tclConfig.sh to get at the value it records when libtcl is built. If you know of such a system, though, we can do that.

(10) By Zephyr Lykos (mochaa) on 2026-09-21 13:46:42 in reply to 9 [link] [source]

I think it's possible to -include $(TCL_CONFIG_SH), does that break POSIX-make compatibility or some other rule?

(11) By Stephan Beal (stephan) on 2026-09-21 14:07:46 in reply to 10 [link] [source]

I think it's possible to -include $(TCL_CONFIG_SH),

It's a shell script, not a makefile. It would almost parse as a makefile except for quotes around all values (which make would retain as part of the values):

TCL_VERSION='8.6'
...
TCL_CC_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'
TCL_LD_SEARCH_FLAGS='"-Wl,-rpath,${LIB_RUNTIME_DIR}"'

Notice the single quotes around the double quotes: that's the pain point.

We can and do source that file from the make recipes which compile Tcl stuff, but at that point TCL_LD_SEARCH_FLAGS resolves to a string with another unresolved var in it, leaving us with a literal value of -Wl,-rpath,${LIB_RUNTIME_DIR}.

We could add some configure-time acrobatics to get that last bit expanded at the point where we need it, but without a broken use case the required hoop-jumping and regression risks don't seem worth it. The current approach has been in use since at least two years (when the build was last overhauled) without, to the best of my fallible recollection, a single complaint about that particular piece. If it becomes a problem, though, we know where to go looking to fix it.