@@ -723,6 +723,13 @@ proper position among the other output files. */
723723#define CPP_SPEC " "
724724#endif
725725
726+ /* libc can define LIBC_CPP_SPEC to provide extra args to the C preprocessor
727+ or extra switch-translations. */
728+
729+ #ifndef LIBC_CPP_SPEC
730+ #define LIBC_CPP_SPEC " "
731+ #endif
732+
726733/* Operating systems can define OS_CC1_SPEC to provide extra args to cc1 and
727734 cc1plus or extra switch-translations. The OS_CC1_SPEC is appended
728735 to CC1_SPEC in the initialization of cc1_spec. */
@@ -748,6 +755,12 @@ proper position among the other output files. */
748755#define LINK_SPEC " "
749756#endif
750757
758+ /* libc can define LIBC_LINK_SPEC to provide extra args to the linker
759+ or extra switch-translations. */
760+ #ifndef LIBC_LINK_SPEC
761+ #define LIBC_LINK_SPEC " "
762+ #endif
763+
751764/* config.h can define LIB_SPEC to override the default libraries. */
752765#ifndef LIB_SPEC
753766#define LIB_SPEC " %{!shared:%{g*:-lg} %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}}"
@@ -1201,14 +1214,14 @@ proper position among the other output files. */
12011214
12021215static const char *asm_debug = ASM_DEBUG_SPEC;
12031216static const char *asm_debug_option = ASM_DEBUG_OPTION_SPEC;
1204- static const char *cpp_spec = CPP_SPEC;
1217+ static const char *cpp_spec = CPP_SPEC LIBC_CPP_SPEC ;
12051218static const char *cc1_spec = CC1_SPEC OS_CC1_SPEC;
12061219static const char *cc1plus_spec = CC1PLUS_SPEC;
12071220static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
12081221static const char *link_ssp_spec = LINK_SSP_SPEC;
12091222static const char *asm_spec = ASM_SPEC;
12101223static const char *asm_final_spec = ASM_FINAL_SPEC;
1211- static const char *link_spec = LINK_SPEC;
1224+ static const char *link_spec = LINK_SPEC LIBC_LINK_SPEC ;
12121225static const char *lib_spec = LIB_SPEC;
12131226static const char *link_gomp_spec = " " ;
12141227static const char *libgcc_spec = LIBGCC_SPEC;
@@ -1984,7 +1997,7 @@ init_spec (void)
19841997#endif
19851998
19861999#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \
1987- defined LINKER_HASH_STYLE || defined LINK_LIBC_SPEC
2000+ defined LINKER_HASH_STYLE
19882001# ifdef LINK_BUILDID_SPEC
19892002 /* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
19902003 obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof (LINK_BUILDID_SPEC) - 1 );
@@ -2002,10 +2015,6 @@ init_spec (void)
20022015 obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof (LINKER_HASH_STYLE) - 1 );
20032016 obstack_1grow (&obstack, ' ' );
20042017 }
2005- # endif
2006- # ifdef LINK_LIBC_SPEC
2007- /* Prepend LINK_LIBC_SPEC to whatever link_spec we had before. */
2008- obstack_grow (&obstack, LINK_LIBC_SPEC, sizeof (LINK_LIBC_SPEC) - 1 );
20092018# endif
20102019 obstack_grow0 (&obstack, link_spec, strlen (link_spec));
20112020 link_spec = XOBFINISH (&obstack, const char *);
0 commit comments