Commit 4ca39b53 authored by machenbach's avatar machenbach Committed by Commit bot

[gn] Don't use PIE for host executables

Using PIE switches on ASLR. With mksnapshot, this can lead
to non-deterministic snapshots.

BUG=v8:5233

Review-Url: https://codereview.chromium.org/2179303003
Cr-Commit-Position: refs/heads/master@{#38084}
parent 1314406c
......@@ -2181,6 +2181,9 @@ if (current_toolchain == v8_snapshot_toolchain) {
v8_executable("mksnapshot") {
visibility = [ ":*" ] # Only targets in this file can depend on this.
# This is executed on the host only and doesn't require PIE.
want_pie = false
sources = [
"src/snapshot/mksnapshot.cc",
]
......@@ -2203,6 +2206,9 @@ v8_executable("mkpeephole") {
# bytecodes that are described in bytecodes.{cc,h}.
visibility = [ ":*" ] # Only targets in this file can depend on this.
# This is executed on the host only and doesn't require PIE.
want_pie = false
sources = [
"src/interpreter/bytecode-peephole-optimizer.h",
"src/interpreter/bytecodes.cc",
......
......@@ -87,13 +87,19 @@ template("v8_source_set") {
template("v8_executable") {
executable(target_name) {
forward_variables_from(invoker, "*", [ "configs" ])
forward_variables_from(invoker, "*", [ "configs", "want_pie"])
configs += invoker.configs
configs -= v8_remove_configs
configs += v8_add_configs
if (is_linux) {
# For enabling ASLR.
ldflags = [ "-pie" ]
if (!defined(invoker.want_pie) || invoker.want_pie) {
if (is_linux) {
# For enabling ASLR.
ldflags = [ "-pie" ]
}
} else {
if (is_android) {
configs -= "//build/config/android:executable_config"
}
}
}
}
......
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