Skip to content

meson: add option to build debugcc as a dynamically linked binary#39

Merged
konradybcio merged 1 commit intolinux-msm:masterfrom
obbardc:wip/obbardc/build-dynamicallly-linked-bins
Dec 5, 2025
Merged

meson: add option to build debugcc as a dynamically linked binary#39
konradybcio merged 1 commit intolinux-msm:masterfrom
obbardc:wip/obbardc/build-dynamicallly-linked-bins

Conversation

@obbardc
Copy link
Contributor

@obbardc obbardc commented Nov 24, 2025

No description provided.

@obbardc obbardc marked this pull request as ready for review November 24, 2025 22:34

executable('debugcc',
debugcc_srcs,
link_args: ['-static','-static-libgcc'],
Copy link
Contributor Author

@obbardc obbardc Nov 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

open to allowing this to be set at build-time with a variable.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We defaulted to static builds because debugcc is often used in e.g. ramdisks without a "real" rootfs. I'm not super confident packaging debugcc in distro repositories is of much use though, given it requires CONFIG_IO_STRICT_DEVMEM=n which is not a great default

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure, how would you feel if I changed the patch to default to a static build && add a variable to be able to change to dynamic build ?

I use debugcc with custom kernel & upstream rootfs, so I still think there's some value in having it in the distro for me at least :-)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Something like -Ddynamic-linking sounds fine

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done !

@obbardc obbardc force-pushed the wip/obbardc/build-dynamicallly-linked-bins branch from 5acc39d to 9b35001 Compare November 25, 2025 12:29
debugcc is currently linked statically using -static and -static-libgcc.
This can cause issues for distributions that prefer dynamically linked
binaries (e.g. larger binaries and duplicated runtime code which could
otherwise be shared).

Add a Meson boolean option `dynamic-linking` which when enabled removes
the explicit static link flags so that debugcc is built as a dynamically
linked binary using the default toolchain behaviour. The default for this
option is false so that existing builds continue to get a statically
linked binary unless they opt in to dynamic linking.

Signed-off-by: Christopher Obbard <christopher.obbard@linaro.org>
@obbardc obbardc force-pushed the wip/obbardc/build-dynamicallly-linked-bins branch from 9b35001 to 73b135d Compare December 5, 2025 11:57
@obbardc obbardc changed the title Build debugcc as a dynamically linked binary meson: add option to build debugcc as a dynamically linked binary Dec 5, 2025
@obbardc obbardc requested a review from quic-kdybcio December 5, 2025 12:02
@konradybcio konradybcio merged commit 37b22bf into linux-msm:master Dec 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments