Commit e2717410 authored by Sadrul Chowdhury's avatar Sadrul Chowdhury Committed by Commit Bot

Revert "Add GN args for using orderfile for Chrome OS"

This reverts commit 1189f593.

Reason for revert: Broke official builds on Windows.
https://ci.chromium.org/p/chrome/builders/ci/win64-builder-perf/91116
https://ci.chromium.org/p/chrome/builders/ci/win32-builder-perf/91061


Original change's description:
> Add GN args for using orderfile for Chrome OS
> 
> This patch adds GN args to use an orderfile for linking Chrome.
> By default, it's pointing a path will be updated by autoroller.
> Chrome ebuild can also override the path to test a custom orderfile.
> 
> This patch also consolidates the efforts across Android and Windows,
> to have a configuration of using orderfile in build/config/compiler.
> 
> Bug: chromium:950627
> Test: Chrome builds locally on Chrome OS. Android and Windows is not tested.
> 
> Change-Id: If9fd06368da81e02488cb991c3b7490e6ed91363
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1672231
> Commit-Queue: Tiancong Wang <tcwang@google.com>
> Reviewed-by: Dirk Pranke <dpranke@chromium.org>
> Reviewed-by: Andrew Grieve <agrieve@chromium.org>
> Reviewed-by: Brian Sheedy <bsheedy@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#675412}

TBR=llozano@chromium.org,hans@chromium.org,dpranke@chromium.org,agrieve@chromium.org,gbiv@chromium.org,bsheedy@chromium.org,manojgupta@chromium.org,tcwang@google.com

Change-Id: Ifca0a426bf7fc616c9e7e0d7033a55da4de9865f
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: chromium:950627
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1692238Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Commit-Queue: Sadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#675658}
parent 384b6a0b
...@@ -177,26 +177,6 @@ if (use_debug_fission == "default") { ...@@ -177,26 +177,6 @@ if (use_debug_fission == "default") {
(use_gold || use_lld) && cc_wrapper == "" (use_gold || use_lld) && cc_wrapper == ""
} }
if (is_win || is_android || is_chromeos) {
# Set the path to use orderfile for linking Chrome
# Note that this is for using only one orderfile for linking
# the Chrome binary/library.
declare_args() {
chrome_orderfile_path = ""
if (defined(default_chrome_orderfile)) {
# Allow downstream tools to set orderfile path with
# another variable.
chrome_orderfile_path = default_chrome_orderfile
} else if (is_win && is_clang && is_official_build) {
chrome_orderfile_path = "build/chrome.$target_cpu.orderfile"
} else if (is_chromeos) {
# FIXME(tcwang): update this with autoroller.
chrome_orderfile_path = ""
}
}
}
# default_include_dirs --------------------------------------------------------- # default_include_dirs ---------------------------------------------------------
# #
# This is a separate config so that third_party code (which would not use the # This is a separate config so that third_party code (which would not use the
...@@ -2450,45 +2430,3 @@ if (is_ios || is_mac) { ...@@ -2450,45 +2430,3 @@ if (is_ios || is_mac) {
cflags_objcc = common_flags cflags_objcc = common_flags
} }
} }
if (is_chromeos) {
# This config is intended to be a temporary to facilitate
# the transition to use orderfile in Chrome OS. Once orderfile
# use becomes a default in Chrome OS, this config should not
# be needed.
config("use_orderfile_for_hugepage") {
if (chrome_orderfile_path != "") {
defines = [ "CHROMEOS_ORDERFILE_USE" ]
}
}
}
if (is_win || is_android || is_chromeos) {
# Use orderfile for linking Chrome on win, android, and Chrome OS.
# This config enables using an orderfile for linking in LLD.
config("chrome_orderfile_config") {
assert(use_lld)
if (chrome_orderfile_path != "") {
_rebased_orderfile = rebase_path(chrome_orderfile_path, root_build_dir)
if (is_android || is_chromeos) {
ldflags = [
"-Wl,--symbol-ordering-file",
"-Wl,$_rebased_orderfile",
"-Wl,--no-warn-symbol-ordering",
]
} else {
ldflags = [
"/order:@$rebased_orderfile",
# Ignore warnings about missing functions or functions not in their
# own section.
"/ignore:4037",
"/ignore:4065",
]
}
inputs = [
chrome_orderfile_path,
]
}
}
}
...@@ -335,7 +335,6 @@ if (!is_android && !is_mac) { ...@@ -335,7 +335,6 @@ if (!is_android && !is_mac) {
if (is_chromeos) { if (is_chromeos) {
data_deps += [ "//mojo/core:shared_libraries_for_arc" ] data_deps += [ "//mojo/core:shared_libraries_for_arc" ]
configs += [ "//build/config/chromeos:print_orderfile" ] configs += [ "//build/config/chromeos:print_orderfile" ]
configs += [ "//build/config/compiler:chrome_orderfile_config" ]
} }
# These files are used by the installer so we need a public dep. # These files are used by the installer so we need a public dep.
...@@ -515,7 +514,21 @@ if (is_win) { ...@@ -515,7 +514,21 @@ if (is_win) {
] ]
} }
configs += [ "//build/config/compiler:chrome_orderfile_config" ] if (is_clang && is_official_build) {
orderfile = "build/chrome.$target_cpu.orderfile"
rebased_orderfile = rebase_path(orderfile, root_build_dir)
inputs = [
orderfile,
]
ldflags += [
"/order:@$rebased_orderfile",
# Ignore warnings about missing functions or functions not in their
# own section.
"/ignore:4037",
"/ignore:4065",
]
}
} }
if (is_multi_dll_chrome) { if (is_multi_dll_chrome) {
......
...@@ -1142,6 +1142,26 @@ jinja_template_resources("chrome_test_apk_template_resources") { ...@@ -1142,6 +1142,26 @@ jinja_template_resources("chrome_test_apk_template_resources") {
variables = [ "manifest_package=$chrome_public_test_manifest_package" ] variables = [ "manifest_package=$chrome_public_test_manifest_package" ]
} }
config("orderfile_config") {
if (chrome_orderfile != "") {
_rebased_orderfile = rebase_path(chrome_orderfile, root_build_dir)
if (use_lld) {
# Code reordering is supported only for LLD. This is because orderfile
# generator does not expand symbol names to section names. Without
# section names like 'text.hot' or '.text.unlikely' the Gold linker cannot
# produce a proper ordering.
ldflags = [
"-Wl,--symbol-ordering-file",
"-Wl,$_rebased_orderfile",
"-Wl,--no-warn-symbol-ordering",
]
}
inputs = [
chrome_orderfile,
]
}
}
# Chrome APK's native library. # Chrome APK's native library.
chrome_common_shared_library("libchrome") { chrome_common_shared_library("libchrome") {
sources = [ sources = [
......
...@@ -14,6 +14,16 @@ import("//device/vr/buildflags/buildflags.gni") ...@@ -14,6 +14,16 @@ import("//device/vr/buildflags/buildflags.gni")
bundle_library_suffix = "" bundle_library_suffix = ""
apk_pak_asset_type = "_apk" apk_pak_asset_type = "_apk"
# This value is set downstream for internal builds.
if (!defined(default_chrome_orderfile)) {
default_chrome_orderfile = ""
}
declare_args() {
# Path to a linker orderfile to use for libchrome.so, libmonochrome.so, etc.
chrome_orderfile = default_chrome_orderfile
}
# This template contains all common configuration for native shared libraries, # This template contains all common configuration for native shared libraries,
# including libchrome, monochrome, standalone webview (also called monochrome), # including libchrome, monochrome, standalone webview (also called monochrome),
# and libchromefortest (used by chrome_public_test_apk). # and libchromefortest (used by chrome_public_test_apk).
...@@ -61,7 +71,7 @@ template("chrome_common_shared_library") { ...@@ -61,7 +71,7 @@ template("chrome_common_shared_library") {
deps += [ "//chrome:chrome_android_core" ] deps += [ "//chrome:chrome_android_core" ]
} }
configs += [ "//build/config/compiler:chrome_orderfile_config" ] configs += [ "//chrome/android:orderfile_config" ]
public_configs = extra_chrome_shared_library_configs public_configs = extra_chrome_shared_library_configs
deps += extra_chrome_shared_library_deps deps += extra_chrome_shared_library_deps
......
...@@ -24,7 +24,6 @@ component("chromeos") { ...@@ -24,7 +24,6 @@ component("chromeos") {
configs += [ configs += [
":chromeos_implementation", ":chromeos_implementation",
"//build/config/linux/nss:system_nss_no_ssl_config", "//build/config/linux/nss:system_nss_no_ssl_config",
"//build/config/compiler:use_orderfile_for_hugepage",
] ]
public_deps = [ public_deps = [
"//chromeos/constants", "//chromeos/constants",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment