mirror of
https://github.com/NotAShelf/microfetch.git
synced 2026-04-12 12:57:41 +00:00
Binary-specific link flags (-nostartfiles, -static, section stripping) now use cargo:rustc-link-arg-bin so they don't break proc-macro or build-script linking. ld-wrapper only strips sections from static binaries.
16 lines
719 B
TOML
16 lines
719 B
TOML
# Use a linker wrapper that invokes mold then strips junk sections with objcopy.
|
|
# mold cannot discard .eh_frame/.dynstr/.comment via linker scripts, so we do
|
|
# it as a post-link step.
|
|
# See:
|
|
# <https://github.com/rui314/mold?tab=readme-ov-file#how-to-use>
|
|
#
|
|
# Binary-specific link flags live in microfetch/build.rs via cargo:rustc-link-arg-bin
|
|
# so they only affect the final binary and don't break proc-macro or build-script linking.
|
|
[target.'cfg(target_os = "linux")']
|
|
linker = "scripts/ld-wrapper"
|
|
rustflags = [
|
|
# Suppress .eh_frame emission from our own codegen (does not cover compiler_builtins;
|
|
# those remnants are removed by the linker wrapper via objcopy post-link)
|
|
"-C",
|
|
"force-unwind-tables=no",
|
|
]
|