Bug 1560666 - turn off C++17 aligned allocation support; r=glandium
authorNathan Froyd <froydnj@mozilla.com>
Wed, 14 Aug 2019 01:37:34 +0000
changeset 487892 f4aa9fbabdcb23241759d769590fe28aa2aed616
parent 487891 cd37bc4841c455b5c5a228e3930bf0f9f6f5cb3a
child 487893 eaef1d403d31e1db6fb78dd377704f601525c74a
push id36433
push userbtara@mozilla.com
push dateWed, 14 Aug 2019 21:57:52 +0000
treeherdermozilla-central@7d9a2196d313 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1560666
milestone70.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1560666 - turn off C++17 aligned allocation support; r=glandium Just like C++14 sized deallocation support, we don't want to support this. We shouldn't be using `new` on over-aligned types anyway. Differential Revision: https://phabricator.services.mozilla.com/D41819
build/moz.configure/bindgen.configure
build/moz.configure/flags.configure
js/rust/build.rs
js/src/wasm/cranelift/build.rs
--- a/build/moz.configure/bindgen.configure
+++ b/build/moz.configure/bindgen.configure
@@ -234,17 +234,17 @@ set_config('MOZ_LIBCLANG_PATH', bindgen_
 set_config('MOZ_CLANG_PATH', bindgen_config_paths.clang_path)
 
 
 @depends(target, target_is_unix, cxx_compiler, bindgen_cflags_android,
          bindgen_config_paths.clang_flags)
 def basic_bindgen_cflags(target, is_unix, compiler_info, android_cflags,
                          clang_flags):
     args = [
-        '-x', 'c++', '-fno-sized-deallocation',
+        '-x', 'c++', '-fno-sized-deallocation', '-fno-aligned-new',
         '-DTRACING=1', '-DIMPL_LIBXUL', '-DMOZILLA_INTERNAL_API',
         '-DRUST_BINDGEN'
     ]
 
     if is_unix:
         args += ['-DOS_POSIX=1']
 
     if target.os == 'Android':
--- a/build/moz.configure/flags.configure
+++ b/build/moz.configure/flags.configure
@@ -2,16 +2,19 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 # We support C++14, but we don't want to enable the sized deallocation
 # facilities in C++14 yet.
 check_and_add_gcc_flag('-fno-sized-deallocation', compiler=cxx_compiler)
+# Likewise for C++17 and aligned allocation.  It's not immediately obvious
+# from the clang and GCC documentation, but they both support this.
+check_and_add_gcc_flag('-fno-aligned-new', compiler=cxx_compiler)
 
 # Please keep these last in this file.
 add_old_configure_assignment('_COMPILATION_CFLAGS', compilation_flags.cflags)
 add_old_configure_assignment(
     '_COMPILATION_CXXFLAGS', compilation_flags.cxxflags)
 add_old_configure_assignment(
     '_COMPILATION_HOST_CFLAGS', compilation_flags.host_cflags)
 add_old_configure_assignment(
--- a/js/rust/build.rs
+++ b/js/rust/build.rs
@@ -140,16 +140,17 @@ const UNSAFE_IMPL_SYNC_TYPES: &'static [
     "JSTypedMethodJitInfo",
 ];
 
 /// Flags passed through bindgen directly to Clang.
 const EXTRA_CLANG_FLAGS: &'static [&'static str] = &[
     "-x", "c++",
     "-std=gnu++14",
     "-fno-sized-deallocation",
+    "-fno-aligned-new",
     "-DRUST_BINDGEN",
 ];
 
 /// Types which we want to generate bindings for (and every other type they
 /// transitively use).
 const WHITELIST_TYPES: &'static [&'static str] = &[
     "JS::AutoCheckCannotGC",
     "JS::CallArgs",
--- a/js/src/wasm/cranelift/build.rs
+++ b/js/src/wasm/cranelift/build.rs
@@ -42,16 +42,17 @@ fn main() {
         .rustified_enum("BD_.*|Trap|TypeCode|FuncTypeIdDescKind")
         .whitelist_type("BD_.*|Trap|TypeCode|FuncTypeIdDescKind")
         .header("baldrapi.h")
         .clang_args(&[
             "-x",
             "c++",
             "-std=gnu++14",
             "-fno-sized-deallocation",
+            "-fno-aligned-new",
             "-DRUST_BINDGEN",
         ])
         .clang_arg("-I../..");
 
     match env::var_os("MOZ_TOPOBJDIR") {
         Some(path) => {
             let path = PathBuf::from(path).join("js/src/rust/extra-bindgen-flags");