Line
Link Here
|
0 |
-- /src/bootstrap/lib.rs |
0 |
++ /src/bootstrap/lib.rs |
Lines 863-868
Link Here
|
863 |
} |
863 |
} |
864 |
} |
864 |
} |
865 |
|
865 |
|
|
|
866 |
/// Returns a list of flags to pass to the C++ compiler for the target |
867 |
/// specified. |
868 |
fn cxxflags(&self, target: &str) -> Vec<String> { |
869 |
// Filter out -O and /O (the optimization flags) that we picked up from |
870 |
// gcc-rs because the build scripts will determine that for themselves. |
871 |
let mut base = self.cxx[target].args().iter() |
872 |
.map(|s| s.to_string_lossy().into_owned()) |
873 |
.filter(|s| !s.starts_with("-O") && !s.starts_with("/O")) |
874 |
.collect::<Vec<_>>(); |
875 |
|
876 |
// If we're compiling on macOS then we add a few unconditional flags |
877 |
// indicating that we want libc++ (more filled out than libstdc++) and |
878 |
// we want to compile for 10.7. This way we can ensure that |
879 |
// LLVM/jemalloc/etc are all properly compiled. |
880 |
if target.contains("apple-darwin") { |
881 |
base.push("-stdlib=libc++".into()); |
882 |
} |
883 |
|
884 |
// Work around an apparently bad MinGW / GCC optimization, |
885 |
// See: http://lists.llvm.org/pipermail/cfe-dev/2016-December/051980.html |
886 |
// See: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=78936 |
887 |
if target == "i686-pc-windows-gnu" { |
888 |
base.push("-fno-omit-frame-pointer".into()); |
889 |
} |
890 |
return base |
891 |
} |
892 |
|
866 |
/// Returns flags to pass to the compiler to generate code for `target`. |
893 |
/// Returns flags to pass to the compiler to generate code for `target`. |
867 |
fn rustc_flags(&self, target: &str) -> Vec<String> { |
894 |
fn rustc_flags(&self, target: &str) -> Vec<String> { |
868 |
// New flags should be added here with great caution! |
895 |
// New flags should be added here with great caution! |
869 |
-- /src/bootstrap/native.rs |
896 |
++ /src/bootstrap/native.rs |
Lines 178-184
Link Here
|
178 |
|
178 |
|
179 |
cfg.build_arg("-j").build_arg(build.jobs().to_string()); |
179 |
cfg.build_arg("-j").build_arg(build.jobs().to_string()); |
180 |
cfg.define("CMAKE_C_FLAGS", build.cflags(target).join(" ")); |
180 |
cfg.define("CMAKE_C_FLAGS", build.cflags(target).join(" ")); |
181 |
cfg.define("CMAKE_CXX_FLAGS", build.cflags(target).join(" ")); |
181 |
cfg.define("CMAKE_CXX_FLAGS", build.cxxflags(target).join(" ")); |
182 |
}; |
182 |
}; |
183 |
|
183 |
|
184 |
configure_compilers(&mut cfg); |
184 |
configure_compilers(&mut cfg); |