Skip to content

Commit

Permalink
all_dependent_configs applies unexport to app (#15607)
Browse files Browse the repository at this point in the history
* all_dependent_configs applies unexport to app

* format
  • Loading branch information
bridiver authored Oct 24, 2022
1 parent 1ac5fef commit 0e37979
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 18 deletions.
2 changes: 1 addition & 1 deletion browser/sources.gni
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ if (is_mac) {
brave_chrome_framework_public_deps = [ "//brave:framework_bundle_data" ]
brave_chrome_framework_bundle_deps = [ "//brave:framework_bundle_data" ]
brave_chrome_framework_contents = [ "Frameworks" ]
brave_chrome_framework_ldflags = []
brave_chrome_framework_configs = [ "//brave/build/rust:strip_rust_symbols" ]
}

brave_chrome_browser_sources += brave_browser_autocomplete_sources
Expand Down
5 changes: 0 additions & 5 deletions build/cargo.gni
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ template("rust_ffi") {
static_library(target_name) {
libs = [ rust_lib_output_path ]

all_dependent_configs = [
"//brave/build/rust:strip_rust_symbols",
"//brave/build/rust:too_many_personalities_workaround",
]

if (is_mac) {
frameworks = [ "Security.framework" ]

Expand Down
14 changes: 6 additions & 8 deletions build/rust/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,19 @@ if (is_apple) {
unexport_list_path = "$root_build_dir/brave_rust/rust_lib.unexports"
}

# Too many personalities workaround. Will be fixed in llvm see
# https://reviews.llvm.org/D135728
config("too_many_personalities_workaround") {
if (is_apple && !is_component_build && !use_lld) {
ldflags = [ "-Wl,-no_compact_unwind" ]
}
}

config("strip_rust_symbols") {
if (is_apple) {
ldflags = [
# prevent export of all rust symbols
"-Wl,-unexported_symbols_list," +
rebase_path(unexport_list_path, root_build_dir),
]

# Too many personalities workaround. Will be fixed in llvm see
# https://reviews.llvm.org/D135728
if (!is_component_build && !use_lld) {
ldflags = [ "-Wl,-no_compact_unwind" ]
}
}
}

Expand Down
7 changes: 5 additions & 2 deletions ios/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,11 @@ ios_framework_bundle("brave_core_ios_framework") {

info_plist = "Info.plist"

configs += [ ":internal_config" ]
configs += [ "//build/config/compiler:enable_arc" ]
configs += [
":internal_config",
"//brave/build/rust:strip_rust_symbols",
"//build/config/compiler:enable_arc",
]

deps = [
":brave_core_umbrella_header",
Expand Down
4 changes: 2 additions & 2 deletions patches/chrome-BUILD.gn.patch
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
diff --git a/chrome/BUILD.gn b/chrome/BUILD.gn
index 36b6fc1d94957475528e7a1de2ec97cfca682682..f4600188e919c08189a0a7fd429bb2943eec16e7 100644
index 36b6fc1d94957475528e7a1de2ec97cfca682682..e795f4e983e78ba7f8f32d101af8b24737ca4778 100644
--- a/chrome/BUILD.gn
+++ b/chrome/BUILD.gn
@@ -174,6 +174,7 @@ if (!is_android && !is_mac) {
Expand Down Expand Up @@ -73,7 +73,7 @@ index 36b6fc1d94957475528e7a1de2ec97cfca682682..f4600188e919c08189a0a7fd429bb294
chrome_dylib_version,
"-Wl,-order_file," + rebase_path("app/framework.order", root_build_dir),
]
+ import("//brave/browser/sources.gni") public_deps += brave_chrome_framework_public_deps bundle_deps += brave_chrome_framework_bundle_deps framework_contents += brave_chrome_framework_contents ldflags += brave_chrome_framework_ldflags
+ import("//brave/browser/sources.gni") public_deps += brave_chrome_framework_public_deps bundle_deps += brave_chrome_framework_bundle_deps framework_contents += brave_chrome_framework_contents configs += brave_chrome_framework_configs

if (!is_component_build) {
# Specify a sensible install_name for static builds. The library is
Expand Down

0 comments on commit 0e37979

Please sign in to comment.