@@ -723,6 +723,13 @@ proper position among the other output files. */
723
723
#define CPP_SPEC " "
724
724
#endif
725
725
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
+
726
733
/* Operating systems can define OS_CC1_SPEC to provide extra args to cc1 and
727
734
cc1plus or extra switch-translations. The OS_CC1_SPEC is appended
728
735
to CC1_SPEC in the initialization of cc1_spec. */
@@ -748,6 +755,12 @@ proper position among the other output files. */
748
755
#define LINK_SPEC " "
749
756
#endif
750
757
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
+
751
764
/* config.h can define LIB_SPEC to override the default libraries. */
752
765
#ifndef LIB_SPEC
753
766
#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. */
1201
1214
1202
1215
static const char *asm_debug = ASM_DEBUG_SPEC;
1203
1216
static 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 ;
1205
1218
static const char *cc1_spec = CC1_SPEC OS_CC1_SPEC;
1206
1219
static const char *cc1plus_spec = CC1PLUS_SPEC;
1207
1220
static const char *link_gcc_c_sequence_spec = LINK_GCC_C_SEQUENCE_SPEC;
1208
1221
static const char *link_ssp_spec = LINK_SSP_SPEC;
1209
1222
static const char *asm_spec = ASM_SPEC;
1210
1223
static 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 ;
1212
1225
static const char *lib_spec = LIB_SPEC;
1213
1226
static const char *link_gomp_spec = " " ;
1214
1227
static const char *libgcc_spec = LIBGCC_SPEC;
@@ -1984,7 +1997,7 @@ init_spec (void)
1984
1997
#endif
1985
1998
1986
1999
#if defined LINK_EH_SPEC || defined LINK_BUILDID_SPEC || \
1987
- defined LINKER_HASH_STYLE || defined LINK_LIBC_SPEC
2000
+ defined LINKER_HASH_STYLE
1988
2001
# ifdef LINK_BUILDID_SPEC
1989
2002
/* Prepend LINK_BUILDID_SPEC to whatever link_spec we had before. */
1990
2003
obstack_grow (&obstack, LINK_BUILDID_SPEC, sizeof (LINK_BUILDID_SPEC) - 1 );
@@ -2002,10 +2015,6 @@ init_spec (void)
2002
2015
obstack_grow (&obstack, LINKER_HASH_STYLE, sizeof (LINKER_HASH_STYLE) - 1 );
2003
2016
obstack_1grow (&obstack, ' ' );
2004
2017
}
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 );
2009
2018
# endif
2010
2019
obstack_grow0 (&obstack, link_spec, strlen (link_spec));
2011
2020
link_spec = XOBFINISH (&obstack, const char *);
0 commit comments