Skip to content

Commit 20d518c

Browse files
hackgnarclaude
andcommitted
Fix armv6 cross link: defer libdbus's libsystemd dep to runtime
rpath-link didn't help because libsystemd.so.0 isn't present in the crosstool-NG cross sysroot at all (not just unsearched). gratttool never references libsystemd directly — only libdbus does, internally — and the Pi provides libsystemd at runtime. Use -Wl,--allow-shlib-undefined so ld does not error on undefined symbols originating inside a shared library, instead of installing libsystemd and its entire transitive tree into the container. armv7/aarch64 unaffected; gratttool's own symbols are still fully checked. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
1 parent 56621bc commit 20d518c

1 file changed

Lines changed: 13 additions & 9 deletions

File tree

.github/workflows/release.yml

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,21 +62,25 @@ jobs:
6262
# multiarch ABI dir with armv7, so libdbus + strip are identical;
6363
# only the codegen differs. arm_arch asserts ARMv6 in verify below.
6464
#
65-
# rustflags: this target's cross image uses a crosstool-NG toolchain
66-
# (/x-tools/...) that is NOT multiarch-aware, so its linker does not
67-
# search /usr/lib/arm-linux-gnueabihf for libdbus's transitive
68-
# NEEDED libsystemd.so.0. -L is never used for transitive shlib deps;
69-
# only -rpath-link is. Point it at the multiarch dir so libsystemd
70-
# (a hard dep of libdbus-1-3, already installed there) resolves.
71-
# Set ONLY on this target — armv7/aarch64 use the Debian multiarch
72-
# gcc which finds it by default, so they stay untouched.
65+
# rustflags: Debian's libdbus-1.so has an internal NEEDED on
66+
# libsystemd.so.0, which is NOT present in this target's crosstool-NG
67+
# cross sysroot (and isn't pulled in as a dep there). gratttool never
68+
# calls libsystemd directly — only libdbus does, internally — so this
69+
# symbol is resolved at runtime on the Pi, where a full systemd
70+
# userland always provides libsystemd.so.0. --allow-shlib-undefined
71+
# tells ld not to error on undefined symbols that originate inside a
72+
# shared library (libdbus); it still fully checks gratttool's own
73+
# symbols. Avoids installing libsystemd + its whole transitive tree
74+
# into the build container. Set ONLY on this target — armv7/aarch64
75+
# use the Debian multiarch gcc, which resolves it at link time, so
76+
# they stay untouched.
7377
- artifact: gratttool-linux-armv6
7478
target: arm-unknown-linux-gnueabihf
7579
cross: true
7680
strip: arm-linux-gnueabihf-strip
7781
pkg_config_path: /usr/lib/arm-linux-gnueabihf/pkgconfig
7882
arm_arch: v6
79-
rustflags: "-C link-arg=-Wl,-rpath-link,/usr/lib/arm-linux-gnueabihf"
83+
rustflags: "-C link-arg=-Wl,--allow-shlib-undefined"
8084

8185
steps:
8286
- uses: actions/checkout@v4

0 commit comments

Comments
 (0)