File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -8,8 +8,19 @@ fn main() {
8
8
9
9
println ! ( "cargo:rustc-link-search=native={}" , custom_lib_dir) ;
10
10
println ! ( "cargo:rustc-link-lib=static={}" , custom_lib_name) ;
11
- /* FIXME: this is assuming a C++ fuzzer, but should be customizable */
12
- println ! ( "cargo:rustc-link-lib=stdc++" ) ;
11
+
12
+ // Allow user to specify use of LLVM or GCC C++ stdlib, or none.
13
+ // "cargo:rustc-link-lib=stdc++" is used by default for
14
+ // backward-compatibility.
15
+ // Note: google/oss-fuzz uses LLVM C++ stdlib as of 15 Jan 2020
16
+ if let Ok ( std_cxx_flag) = :: std:: env:: var ( "CUSTOM_LIBFUZZER_STD_CXX" ) {
17
+ match std_cxx_flag. as_str ( ) {
18
+ "c++" => println ! ( "cargo:rustc-link-lib=c++" ) ,
19
+ "stdc++" => println ! ( "cargo:rustc-link-lib=stdc++" ) ,
20
+ "none" => ( ) ,
21
+ _ => println ! ( "cargo:rustc-link-lib=stdc++" ) ,
22
+ }
23
+ }
13
24
} else {
14
25
let mut build = cc:: Build :: new ( ) ;
15
26
let sources = :: std:: fs:: read_dir ( "libfuzzer" )
You can’t perform that action at this time.
0 commit comments