Ticket #53605: patch-use-libcxx.3.diff
File patch-use-libcxx.3.diff, 3.0 KB (added by RJVB (René Bertin), 8 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")) 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) 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 46 46 #endif 47 47 48 48 #ifndef LIBSTDCXX 49 #define LIBSTDCXX "stdc++" 49 #define LIBSTDCXX "c++" 50 #define LIBSTDCXXABI "c++abi" 51 // using libsupc++ is a hack, probably to be dropped on systems that have a new enough libc++ 52 // which has `operator delete(void*, unsigned long)` 53 #define LIBSUPCXX "supc++" 54 #else 55 #warning "LIBSTDCXX predefined" 50 56 #endif 51 # ifndef LIBSTDCXX_PROFILE57 #undef LIBSTDCXX_PROFILE 52 58 #define LIBSTDCXX_PROFILE LIBSTDCXX 53 #endif 59 54 60 #ifndef LIBSTDCXX_STATIC 55 61 #define LIBSTDCXX_STATIC NULL 62 #else 63 #warning "LIBSTDCXX_STATIC predefined" 56 64 #endif 57 65 58 66 void … … 342 350 j++; 343 351 } 344 352 #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) 353 // NOT checking for the existence of LIBSTDCXXABI and LIBSUPCXX on purpose 354 if (getenv ("GCC_FORCE_LIBSTDCPP")) { 355 fprintf(stderr, "GCC_FORCE_LIBSTDCPP - using -lstdc++ instead of -l%s -l%s -l%s\n", 356 LIBSTDCXX, LIBSTDCXXABI, LIBSUPCXX); 357 generate_option (OPT_l, "stdc++", 1, 358 CL_DRIVER, &new_decoded_options[j]); 359 added_libraries++; 360 j++; 361 } else { 362 generate_option (OPT_l, 363 saw_profile_flag ? LIBSTDCXX_PROFILE : LIBSTDCXX, 1, 364 CL_DRIVER, &new_decoded_options[j]); 365 added_libraries++; 366 j++; 367 // add -lc++abi and -lsupc++ 368 generate_option (OPT_l, LIBSTDCXXABI, 1, 369 CL_DRIVER, &new_decoded_options[j]); 370 added_libraries++; 371 j++; 372 generate_option (OPT_l, LIBSUPCXX, 1, 373 CL_DRIVER, &new_decoded_options[j]); 374 added_libraries++; 375 j++; 376 } 377 /* Add target-dependent static library, if necessary. */ 378 if ((static_link || library > 1) && (LIBSTDCXX_STATIC != NULL || getenv("GCC_IS_BUILDING_ITSELF"))) 352 379 { 353 generate_option (OPT_l, LIBSTDCXX_STATIC , 1,380 generate_option (OPT_l, LIBSTDCXX_STATIC ? LIBSTDCXX_STATIC : "stdc++", 1, 354 381 CL_DRIVER, &new_decoded_options[j]); 355 382 added_libraries++; 356 383 j++;