@@ -166,6 +166,16 @@ fn rustc_llvm_build() {
166
166
if flag. starts_with ( "-flto" ) {
167
167
continue ;
168
168
}
169
+ // ignore flags that aren't supported in gcc 8
170
+ if flag == "-Wcovered-switch-default" {
171
+ continue ;
172
+ }
173
+ if flag == "-Wstring-conversion" {
174
+ continue ;
175
+ }
176
+ if flag == "-Werror=unguarded-availability-new" {
177
+ continue ;
178
+ }
169
179
170
180
cfg. flag ( flag) ;
171
181
}
@@ -183,7 +193,7 @@ fn rustc_llvm_build() {
183
193
build_helper:: rerun_if_changed ( Path :: new ( "rustc_llvm_wrapper" ) ) ;
184
194
cfg. file ( "rustc_llvm_wrapper/RustWrapper.cpp" )
185
195
. file ( "rustc_llvm_wrapper/PassWrapper.cpp" )
186
- . include ( "rustc_llvm_wrapper/rustllvm.h " )
196
+ . include ( "rustc_llvm_wrapper" )
187
197
. cpp ( true )
188
198
. cpp_link_stdlib ( None ) // we handle this below
189
199
. compile ( "llvm-wrapper" ) ;
@@ -241,7 +251,7 @@ fn rustc_llvm_build() {
241
251
242
252
// Link in the system libraries that LLVM depends on
243
253
#[ cfg( not( target_os = "windows" ) ) ]
244
- link_llvm_system_libs ( & llvm_config) ;
254
+ link_llvm_system_libs ( & llvm_config, required_components ) ;
245
255
246
256
// LLVM ldflags
247
257
//
@@ -330,10 +340,14 @@ fn rustc_llvm_build() {
330
340
}
331
341
332
342
#[ cfg( not( target_os = "windows" ) ) ]
333
- fn link_llvm_system_libs ( llvm_config : & Path ) {
343
+ fn link_llvm_system_libs ( llvm_config : & Path , components : & [ & str ] ) {
334
344
let mut cmd = Command :: new ( & llvm_config) ;
335
345
cmd. arg ( "--system-libs" ) ;
336
346
347
+ for comp in components {
348
+ cmd. arg ( comp) ;
349
+ }
350
+
337
351
for lib in output ( & mut cmd) . split_whitespace ( ) {
338
352
let name = if let Some ( stripped) = lib. strip_prefix ( "-l" ) {
339
353
stripped
0 commit comments