void-packages/srcpkgs/mozjs128/patches/017-no-lto-readelf.patch
2025-02-20 17:40:52 -08:00

36 lines
1.4 KiB
Diff

commit 1cc729c5221d0ce4c80786ccdcb2de4a6ca382b6
Author: Daniel Kolesa <daniel@octaforge.org>
Date: Sun Jan 23 21:55:43 2022 +0100
drop some library checks
This calls readelf and won't work with LTO'd setups.
diff --git a/config/makefiles/rust.mk b/config/makefiles/rust.mk
index 401c2933..ade4f1da 100644
--- a/config/makefiles/rust.mk
+++ b/config/makefiles/rust.mk
@@ -497,22 +497,6 @@ force-cargo-library-build:
$(call BUILDSTATUS,START_Rust $(notdir $(RUST_LIBRARY_FILE)))
$(call CARGO_BUILD) --lib $(cargo_target_flag) $(rust_features_flag) -- $(cargo_rustc_flags)
$(call BUILDSTATUS,END_Rust $(notdir $(RUST_LIBRARY_FILE)))
-# When we are building in --enable-release mode; we add an additional check to confirm
-# that we are not importing any networking-related functions in rust code. This reduces
-# the chance of proxy bypasses originating from rust code.
-# The check only works when rust code is built with -Clto but without MOZ_LTO_RUST_CROSS.
-# Sanitizers and sancov also fail because compiler-rt hooks network functions.
-ifndef MOZ_PROFILE_GENERATE
-ifeq ($(OS_ARCH), Linux)
-ifeq (,$(rustflags_sancov)$(MOZ_ASAN)$(MOZ_TSAN)$(MOZ_UBSAN))
-ifndef MOZ_LTO_RUST_CROSS
-ifneq (,$(filter -Clto,$(cargo_rustc_flags)))
- $(call py_action,check_binary $(@F),--networking $(RUST_LIBRARY_FILE))
-endif
-endif
-endif
-endif
-endif
$(eval $(call make_cargo_rule,$(RUST_LIBRARY_FILE),force-cargo-library-build))