Skip to content

Commit

Permalink
fix(arch): use gold linker for MIPS architectures
Browse files Browse the repository at this point in the history
  • Loading branch information
liushuyu committed Jan 20, 2024
1 parent b8179c7 commit 644a51d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion arch/loongson3.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
##@copyright GPL-2.0+
CFLAGS_GCC_ARCH=('-mabi=64' '-march=gs464' '-mtune=gs464e' '-mfix-loongson3-llsc' '-mxgot')
CFLAGS_CLANG_ARCH=('-mabi=64' '-march=mips64r2' '-mtune=mips64r2')
RUSTFLAGS_COMMON_ARCH=('-Clink-arg=-Wl,-build-id=sha1' '-Clink-arg=-Wl,-z,notext')
RUSTFLAGS_COMMON_ARCH=('-Clink-arg=-Wl,-build-id=sha1')
RUSTFLAGS_COMMON_OPTI_NOLTO=('-Clink-arg=-fuse-ld=gold' '-Clink-arg=-Wl,-build-id=sha1')
CFLAGS_GCC_OPTI_LTO=("${CFLAGS_COMMON_OPTI_LTO[@]}" '-flto-partition=none')
LDFLAGS_GCC_OPTI_LTO=("${LDFLAGS_COMMON_OPTI_LTO[@]}" '-mxgot' '-flto-partition=none')

Expand Down
1 change: 1 addition & 0 deletions arch/mips32r6el.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,4 @@ CFLAGS_COMMON_ARCH=('-march=mips32r6' '-mtune=mips32r6' '-mcompact-branches=alwa
# R2 and R6 assemblies. Enabling this options instructs rustix to use the libc
# backend instead.
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=mips32r6' '-Cdebuginfo=0' '-Cllvm-args=--mips-compact-branches=always' '--cfg=rustix_use_libc')
RUSTFLAGS_COMMON_OPTI_NOLTO=('-Clink-arg=-fuse-ld=gold' '-Clink-arg=-Wl,-build-id=sha1')
1 change: 1 addition & 0 deletions arch/mips64r6el.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,4 @@ CFLAGS_COMMON_ARCH=('-march=mips64r6' '-mtune=mips64r6' '-mcompact-branches=alwa
# FIXME: As of Rust 1.71.1, enabling MSA results in broken sha2 checksum
# calculation (breaks all Cargo operations). Disable this feature for now.
RUSTFLAGS_COMMON_ARCH=('-Ctarget-cpu=mips64r6' '-Cdebuginfo=0' '-Ctarget-feature=-msa' '-Cllvm-args=--mips-compact-branches=always' '--cfg=rustix_use_libc')
RUSTFLAGS_COMMON_OPTI_NOLTO=('-Clink-arg=-fuse-ld=gold' '-Clink-arg=-Wl,-build-id=sha1')

0 comments on commit 644a51d

Please sign in to comment.