Skip to content

Commit

Permalink
Issue 4596 - BUG - lto linking issues
Browse files Browse the repository at this point in the history
Bug Description: Fedora is introducing lto by default which
may affect our build especially with rust and asan

Fix Description: Adapt how we use lto and how we link in
our builds so that lto works for gcc.

fixes: 389ds#4596

Author: William Brown <[email protected]>

Review by: ???
  • Loading branch information
Firstyear authored and vashirov committed Nov 1, 2024
1 parent 0c6fdd6 commit ab8b96a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,11 @@ CARGO_FLAGS = @cargo_defs@

if CLANG_ENABLE
RUSTC_FLAGS = @asan_rust_defs@ @msan_rust_defs@ @tsan_rust_defs@ @debug_rust_defs@
RUSTC_LINK_FLAGS = -C link-arg=-fuse-ld=lld
RUSTC_LINK_FLAGS = -Clink-arg=-fuse-ld=lld
RUST_LDFLAGS = -ldl -lpthread -lc -lm -lrt -lutil
else
RUSTC_FLAGS = @asan_rust_defs@ @msan_rust_defs@ @tsan_rust_defs@ @debug_rust_defs@
RUSTC_LINK_FLAGS =
RUSTC_LINK_FLAGS = -Clink-arg=-fuse-ld=ld
# This avoids issues with stderr being double provided with clang + asan.
RUST_LDFLAGS = -ldl -lpthread -lgcc_s -lc -lm -lrt -lutil
endif
Expand All @@ -81,7 +81,7 @@ CLANG_LDFLAGS = -latomic -fuse-ld=lld
EXPORT_LDFLAGS =
else
CLANG_ON = 0
CLANG_LDFLAGS =
CLANG_LDFLAGS = -flto
if DEBUG
EXPORT_LDFLAGS = -rdynamic
endif
Expand Down

0 comments on commit ab8b96a

Please sign in to comment.