From: Iain Sandoe Date: Sun, 18 Oct 2015 18:33:05 +0000 (+0000) Subject: Revise Darwin's sysroot handling to be compatible with the clang toolchain. X-Git-Tag: upstream/12.2.0~51754 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d42becb9d876f54d0ee0b6c7a5ebfd30851b4e1d;p=platform%2Fupstream%2Fgcc.git Revise Darwin's sysroot handling to be compatible with the clang toolchain. gcc/ * config/darwin.h (TARGET_SYSTEM_ROOT): Remove this from here, (HAVE_LD_SYSROOT): New. (SYSROOT_SPEC): New. (LINK_SYSROOT_SPEC): Revise to remove the default for target sysroot. (STANDARD_STARTFILE_PREFIX_1): New. (STANDARD_STARTFILE_PREFIX_2): New. From-SVN: r228950 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dc21d7d..46cff7b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,13 @@ 2015-10-18 Iain Sandoe + * config/darwin.h (TARGET_SYSTEM_ROOT): Remove this from here, + (HAVE_LD_SYSROOT): New. (SYSROOT_SPEC): New. + (LINK_SYSROOT_SPEC): Revise to remove the default for target sysroot. + (STANDARD_STARTFILE_PREFIX_1): New. + (STANDARD_STARTFILE_PREFIX_2): New. + +2015-10-18 Iain Sandoe + * config/darwin-driver.c (darwin_default_min_version): Refactor code. (darwin_driver_init): Note a version-min when provided on the c/l. * config/darwin.h (%darwin_minversion): Remove. diff --git a/gcc/config/darwin.h b/gcc/config/darwin.h index bb4451a..7d093c9 100644 --- a/gcc/config/darwin.h +++ b/gcc/config/darwin.h @@ -207,12 +207,21 @@ extern GTY(()) int darwin_ms_struct; #undef LINK_GCC_C_SEQUENCE_SPEC #define LINK_GCC_C_SEQUENCE_SPEC "%G %L" -#ifdef TARGET_SYSTEM_ROOT -#define LINK_SYSROOT_SPEC \ - "%{isysroot*:-syslibroot %*;:-syslibroot " TARGET_SYSTEM_ROOT "}" -#else +/* ld64 supports a sysroot, it just has a different name and there's no easy + way to check for it at config time. */ +#undef HAVE_LD_SYSROOT +#define HAVE_LD_SYSROOT 1 +/* It seems the only (working) way to get a space after %R is to append a + dangling '/'. */ +#define SYSROOT_SPEC "%{!isysroot*:-syslibroot %R/ }" + +/* Do the same as clang, for now, and insert the sysroot for ld when an + isysroot is specified. */ #define LINK_SYSROOT_SPEC "%{isysroot*:-syslibroot %*}" -#endif + +/* Suppress the addition of extra prefix paths when a sysroot is in use. */ +#define STANDARD_STARTFILE_PREFIX_1 "" +#define STANDARD_STARTFILE_PREFIX_2 "" #define DARWIN_PIE_SPEC "%{fpie|pie|fPIE:}"