mirror of
https://github.com/openai/codex.git
synced 2026-11-06 20:20:34 +00:00
Pack relative relocations in x86-64 musl release builds (#59805)
## What changed Add `-z pack-relative-relocs` to the Cargo and Bazel release linker flags for `x86_64-unknown-linux-musl`, alongside the existing safe identical code folding. GitOrigin-RevId: 1398ea6775e6b8ec81e624def6c23e8053363544
This commit is contained in:
committed by
copyberry
parent
da279f6fd4
commit
7b54fd245d
@@ -261,9 +261,9 @@ target_cxx_var="CXX_${TARGET}"
|
||||
target_cxx_var="${target_cxx_var//-/_}"
|
||||
echo "${target_cxx_var}=${cxx}" >> "$GITHUB_ENV"
|
||||
|
||||
# Enable safe identical code folding for release packages on x86-64 musl.
|
||||
# Fold identical code and pack relocations for x86-64 musl release packages.
|
||||
if [[ "${TARGET}" == "x86_64-unknown-linux-musl" && "${CODEX_MUSL_RELEASE_LINK_FLAGS:-}" == "1" ]]; then
|
||||
link_flags=(-Cllvm-args=--addrsig -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--icf=safe)
|
||||
link_flags=(-Cllvm-args=--addrsig -Clink-arg=-fuse-ld=lld -Clink-arg=-Wl,--icf=safe,-z,pack-relative-relocs)
|
||||
echo "RUSTFLAGS=${RUSTFLAGS:+$RUSTFLAGS }${link_flags[*]}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@ def _release_profile_impl(settings, attr):
|
||||
# Match the Cargo release linker for x86-64 static PIEs.
|
||||
profile[_RUSTC_FLAGS] += [
|
||||
"-Cllvm-args=--addrsig",
|
||||
"-Clink-arg=-Wl,--icf=safe",
|
||||
"-Clink-arg=-Wl,--icf=safe,-z,pack-relative-relocs",
|
||||
]
|
||||
return profile
|
||||
|
||||
|
||||
Reference in New Issue
Block a user