mirror of
https://github.com/dart-lang/sdk
synced 2024-09-04 16:03:44 +00:00
[build] Enable PIE on non-IA32 Linux.
(Gets ASLR working to hopefully make non-determinism surface more often.) (Thought I enabled this back in 2015...) Bug: b/22479195 Bug: https://github.com/dart-lang/sdk/issues/31427 Change-Id: I02381e364ccb8bccbf5aa561959bceb7be067128 Reviewed-on: https://dart-review.googlesource.com/59281 Reviewed-by: Zach Anderson <zra@google.com> Commit-Queue: Ryan Macnak <rmacnak@google.com>
This commit is contained in:
parent
ebc30fd0da
commit
8d82cdd6d8
|
@ -292,11 +292,16 @@ if (is_win) {
|
||||||
"//build/config/mac:mac_dynamic_flags",
|
"//build/config/mac:mac_dynamic_flags",
|
||||||
"//build/config/mac:mac_executable_flags",
|
"//build/config/mac:mac_executable_flags",
|
||||||
]
|
]
|
||||||
} else if (is_linux || is_android) {
|
} else if (is_linux) {
|
||||||
_executable_configs += [ "//build/config/gcc:executable_ldconfig" ]
|
_executable_configs += [
|
||||||
if (is_android) {
|
"//build/config/gcc:executable_ldconfig",
|
||||||
_executable_configs += [ "//build/config/android:executable_config" ]
|
"//build/config/linux:executable_config",
|
||||||
}
|
]
|
||||||
|
} else if (is_android) {
|
||||||
|
_executable_configs += [
|
||||||
|
"//build/config/gcc:executable_ldconfig",
|
||||||
|
"//build/config/android:executable_config",
|
||||||
|
]
|
||||||
}
|
}
|
||||||
set_defaults("executable") {
|
set_defaults("executable") {
|
||||||
configs = _executable_configs
|
configs = _executable_configs
|
||||||
|
|
|
@ -234,7 +234,7 @@ config("compiler") {
|
||||||
# 3. When using the sanitizers.
|
# 3. When using the sanitizers.
|
||||||
# Otherwise there is a performance hit, in particular on ia32.
|
# Otherwise there is a performance hit, in particular on ia32.
|
||||||
if (is_android || is_asan || is_lsan || is_msan || is_tsan ||
|
if (is_android || is_asan || is_lsan || is_msan || is_tsan ||
|
||||||
(is_linux && current_cpu == "arm")) {
|
(is_linux && current_cpu != "x86")) {
|
||||||
cflags += [ "-fPIC" ]
|
cflags += [ "-fPIC" ]
|
||||||
ldflags += [ "-fPIC" ]
|
ldflags += [ "-fPIC" ]
|
||||||
}
|
}
|
||||||
|
|
|
@ -28,3 +28,10 @@ config("sdk") {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
config("executable_config") {
|
||||||
|
if (current_cpu != "x86") {
|
||||||
|
cflags = [ "-fPIE" ]
|
||||||
|
ldflags = [ "-pie" ]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue