The linker is told once, not twice #159

Merged
jschoubben merged 1 commits from fix/161-one-ldflags-not-two into main 2026-09-30 10:54:36 +00:00
Owner

novox/hq issue 161. A repeated flag is not a merged one. The Go command takes the last -ldflags and drops the first, so passing the toolchain's flags and then the system stamp as a second one produced a binary that knew its system and had lost -s -w: 12.2MB against 8.5MB, with its debug info intact.

My own comment in the previous change said the linker "accepts and merges" them. It does not, and I found out by reading the file the build produced rather than by reading the comment again.

Linker flags are now the toolchain's own list, composed into one flag with the stamp. A test refuses a compile line that carries -ldflags itself, because that is what makes two.

make check: only the pre-existing failure.

novox/hq issue 161. **A repeated flag is not a merged one.** The Go command takes the last `-ldflags` and drops the first, so passing the toolchain's flags and then the system stamp as a second one produced a binary that knew its system and had lost `-s -w`: 12.2MB against 8.5MB, with its debug info intact. My own comment in the previous change said the linker "accepts and merges" them. It does not, and I found out by reading the file the build produced rather than by reading the comment again. Linker flags are now the toolchain's own list, composed into one flag with the stamp. A test refuses a compile line that carries `-ldflags` itself, because that is what makes two. `make check`: only the pre-existing failure.
jschoubben added 1 commit 2026-09-30 10:54:31 +00:00
novox/hq 04-ISSUES/161. A repeated flag is not a merged one. The Go
command takes the last -ldflags and drops the first, so passing the
toolchain's flags and then the system stamp as a second one produced a
binary that knew its system and had lost -s -w: 12.2MB against 8.5MB,
with its debug info intact.

My own comment said the linker "accepts and merges" them. It does not,
and I found out by reading the file the build produced rather than by
reading the comment again.

Linker flags are now the toolchain's own list, composed into one flag with
the stamp. A test refuses a compile line that carries -ldflags itself,
because that is what makes two.
jschoubben merged commit 1bc099a2db into main 2026-09-30 10:54:36 +00:00
jschoubben deleted branch fix/161-one-ldflags-not-two 2026-09-30 10:54:37 +00:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: novox/mesh-controller#159