Ticket #54773: patch-use-libcxx.diff
File patch-use-libcxx.diff, 3.0 KB (added by RJVB (René Bertin), 7 years ago) |
---|
-
incpath.c
old new 129 129 int relocated = cpp_relocated (); 130 130 size_t len; 131 131 132 if (cxx_stdinc) 133 { 134 if (!getenv("LIBCPP_INCLUDE_PATH") && !getenv("GCC_FORCE_LIBSTDCPP")) 135 { 136 add_path (xstrdup ("@LLVMHEADERPATH@"), SYSTEM, true, false); 137 } 138 } 132 139 if (iprefix && (len = cpp_GCC_INCLUDE_DIR_len) != 0) 133 140 { 134 141 /* Look for directories that start with the standard prefix. … … 474 481 /* CPATH and language-dependent environment variables may add to the 475 482 include chain. */ 476 483 add_env_var_paths ("CPATH", BRACKET); 484 if (stdinc && cxx_stdinc && !getenv("GCC_FORCE_LIBSTDCPP")) 485 add_env_var_paths ("LIBCPP_INCLUDE_PATH", SYSTEM); 477 486 add_env_var_paths (lang_env_vars[idx], SYSTEM); 478 487 479 488 target_c_incpath.extra_pre_includes (sysroot, iprefix, stdinc); -
g++spec.c
old new 48 48 #ifndef LIBSTDCXX 49 49 #define LIBSTDCXX "stdc++" 50 50 #endif 51 // libc++ support: 52 #ifndef LIBCXX 53 #define LIBCXX "c++" 54 #define LIBCXXABI "c++abi" 55 // using libsupc++ is a hack, probably to be dropped on systems that have a new enough libc++ 56 // which has `operator delete(void*, unsigned long)` 57 #define LIBSUPCXX "supc++" 58 #endif 51 59 #ifndef LIBSTDCXX_PROFILE 52 60 #define LIBSTDCXX_PROFILE LIBSTDCXX 53 61 #endif 62 54 63 #ifndef LIBSTDCXX_STATIC 55 64 #define LIBSTDCXX_STATIC NULL 56 65 #endif … … 342 351 j++; 343 352 } 344 353 #endif 345 generate_option (OPT_l, 346 saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX, 1, 347 CL_DRIVER, &new_decoded_options[j]); 348 added_libraries++; 349 j++; 350 /* Add target-dependent static library, if necessary. */ 351 if ((static_link || library > 1) && LIBSTDCXX_STATIC != NULL) 354 // NOT checking for the existence of LIBCXXABI and LIBSUPCXX on purpose 355 if (getenv ("GCC_FORCE_LIBSTDCPP")) { 356 fprintf(stderr, "GCC_FORCE_LIBSTDCPP - using -l%s instead of -l%s -l%s -l%s\n", 357 (saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX), LIBCXX, LIBCXXABI, LIBSUPCXX); 358 generate_option (OPT_l, 359 saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX, 1, 360 CL_DRIVER, &new_decoded_options[j]); 361 added_libraries++; 362 j++; 363 } else { 364 generate_option (OPT_l, LIBCXX, 1, 365 CL_DRIVER, &new_decoded_options[j]); 366 added_libraries++; 367 j++; 368 // add -lc++abi and -lsupc++ 369 generate_option (OPT_l, LIBCXXABI, 1, 370 CL_DRIVER, &new_decoded_options[j]); 371 added_libraries++; 372 j++; 373 generate_option (OPT_l, LIBSUPCXX, 1, 374 CL_DRIVER, &new_decoded_options[j]); 375 added_libraries++; 376 j++; 377 } 378 /* Add target-dependent static library, if necessary. */ 379 if ((static_link || library > 1) && (LIBSTDCXX_STATIC != NULL || getenv("GCC_IS_BUILDING_ITSELF"))) 352 380 { 353 generate_option (OPT_l, LIBSTDCXX_STATIC , 1,381 generate_option (OPT_l, LIBSTDCXX_STATIC ? LIBSTDCXX_STATIC : LIBSTDCXX, 1, 354 382 CL_DRIVER, &new_decoded_options[j]); 355 383 added_libraries++; 356 384 j++;