Commit 7904f95f by Eric Christopher

gcc.c (LINK_SSP_SPEC): Add fstack-protector-all.

2005-08-03  Eric Christopher  <echristo@apple.com>

        * gcc.c (LINK_SSP_SPEC): Add fstack-protector-all.
        * config/darwin.h (LINK_COMMAND_SPEC): Add link_ssp
        spec.

From-SVN: r102719
parent 0646b059
...@@ -96,12 +96,12 @@ Boston, MA 02110-1301, USA. */ ...@@ -96,12 +96,12 @@ Boston, MA 02110-1301, USA. */
name, that also takes an argument, needs to be modified so the name, that also takes an argument, needs to be modified so the
prefix is different, otherwise a '*' after the shorter option will prefix is different, otherwise a '*' after the shorter option will
match with the longer one. match with the longer one.
The SUBTARGET_OPTION_TRANSLATE_TABLE macro, which _must_ be defined The SUBTARGET_OPTION_TRANSLATE_TABLE macro, which _must_ be defined
in gcc/config/{i386,rs6000}/darwin.h, should contain any additional in gcc/config/{i386,rs6000}/darwin.h, should contain any additional
command-line option translations specific to the particular target command-line option translations specific to the particular target
architecture. */ architecture. */
#define TARGET_OPTION_TRANSLATE_TABLE \ #define TARGET_OPTION_TRANSLATE_TABLE \
{ "-all_load", "-Zall_load" }, \ { "-all_load", "-Zall_load" }, \
{ "-allowable_client", "-Zallowable_client" }, \ { "-allowable_client", "-Zallowable_client" }, \
...@@ -207,7 +207,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -207,7 +207,7 @@ Boston, MA 02110-1301, USA. */
%{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \ %{@:-o %f%u.out}%{!@:%{o*}%{!o:-o a.out}} \
%{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \ %{!Zdynamiclib:%{!A:%{!nostdlib:%{!nostartfiles:%S}}}} \
%{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \ %{L*} %(link_libgcc) %o %{fprofile-arcs|fprofile-generate|coverage:-lgcov} \
%{!nostdlib:%{!nodefaultlibs:%G %L}} \ %{!nostdlib:%{!nodefaultlibs:%(link_ssp) %G %L}} \
%{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}" %{!A:%{!nostdlib:%{!nostartfiles:%E}}} %{T*} %{F*} }}}}}}}}"
/* Please keep the random linker options in alphabetical order (modulo /* Please keep the random linker options in alphabetical order (modulo
...@@ -393,9 +393,9 @@ Boston, MA 02110-1301, USA. */ ...@@ -393,9 +393,9 @@ Boston, MA 02110-1301, USA. */
links to, so there's no need for weak-ness for that. */ links to, so there's no need for weak-ness for that. */
#define GTHREAD_USE_WEAK 0 #define GTHREAD_USE_WEAK 0
/* The Darwin linker imposes two limitations on common symbols: they /* The Darwin linker imposes two limitations on common symbols: they
can't have hidden visibility, and they can't appear in dylibs. As can't have hidden visibility, and they can't appear in dylibs. As
a consequence, we should never use common symbols to represent a consequence, we should never use common symbols to represent
vague linkage. */ vague linkage. */
#undef USE_COMMON_FOR_ONE_ONLY #undef USE_COMMON_FOR_ONE_ONLY
#define USE_COMMON_FOR_ONE_ONLY 0 #define USE_COMMON_FOR_ONE_ONLY 0
...@@ -414,7 +414,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -414,7 +414,7 @@ Boston, MA 02110-1301, USA. */
#undef FRAME_BEGIN_LABEL #undef FRAME_BEGIN_LABEL
#define FRAME_BEGIN_LABEL "EH_frame" #define FRAME_BEGIN_LABEL "EH_frame"
/* Emit a label for the FDE corresponding to DECL. EMPTY means /* Emit a label for the FDE corresponding to DECL. EMPTY means
emit a label for an empty FDE. */ emit a label for an empty FDE. */
#define TARGET_ASM_EMIT_UNWIND_LABEL darwin_emit_unwind_label #define TARGET_ASM_EMIT_UNWIND_LABEL darwin_emit_unwind_label
...@@ -567,7 +567,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -567,7 +567,7 @@ Boston, MA 02110-1301, USA. */
/* Ensure correct alignment of bss data. */ /* Ensure correct alignment of bss data. */
#undef ASM_OUTPUT_ALIGNED_DECL_LOCAL #undef ASM_OUTPUT_ALIGNED_DECL_LOCAL
#define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \ #define ASM_OUTPUT_ALIGNED_DECL_LOCAL(FILE, DECL, NAME, SIZE, ALIGN) \
do { \ do { \
unsigned HOST_WIDE_INT _new_size = SIZE; \ unsigned HOST_WIDE_INT _new_size = SIZE; \
......
...@@ -602,7 +602,7 @@ proper position among the other output files. */ ...@@ -602,7 +602,7 @@ proper position among the other output files. */
}} %{fmudflap|fmudflapth: --wrap=main}" }} %{fmudflap|fmudflapth: --wrap=main}"
#endif #endif
#ifndef MFLIB_SPEC #ifndef MFLIB_SPEC
#define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}" #define MFLIB_SPEC "%{fmudflap|fmudflapth: -export-dynamic}"
#endif #endif
/* config.h can define LIBGCC_SPEC to override how and when libgcc.a is /* config.h can define LIBGCC_SPEC to override how and when libgcc.a is
...@@ -674,7 +674,7 @@ proper position among the other output files. */ ...@@ -674,7 +674,7 @@ proper position among the other output files. */
#ifdef TARGET_LIBC_PROVIDES_SSP #ifdef TARGET_LIBC_PROVIDES_SSP
#define LINK_SSP_SPEC "%{fstack-protector:}" #define LINK_SSP_SPEC "%{fstack-protector:}"
#else #else
#define LINK_SSP_SPEC "%{fstack-protector:-lssp_nonshared -lssp }" #define LINK_SSP_SPEC "%{fstack-protector|fstack-protector-all:-lssp_nonshared -lssp }"
#endif #endif
#endif #endif
...@@ -920,16 +920,16 @@ static const struct compiler default_compilers[] = ...@@ -920,16 +920,16 @@ static const struct compiler default_compilers[] =
{".m", "#Objective-C", 0, 0, 0}, {".mi", "#Objective-C", 0, 0, 0}, {".m", "#Objective-C", 0, 0, 0}, {".mi", "#Objective-C", 0, 0, 0},
{".mm", "#Objective-C++", 0, 0, 0}, {".M", "#Objective-C++", 0, 0, 0}, {".mm", "#Objective-C++", 0, 0, 0}, {".M", "#Objective-C++", 0, 0, 0},
{".mii", "#Objective-C++", 0, 0, 0}, {".mii", "#Objective-C++", 0, 0, 0},
{".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0}, {".cc", "#C++", 0, 0, 0}, {".cxx", "#C++", 0, 0, 0},
{".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0}, {".cpp", "#C++", 0, 0, 0}, {".cp", "#C++", 0, 0, 0},
{".c++", "#C++", 0, 0, 0}, {".C", "#C++", 0, 0, 0}, {".c++", "#C++", 0, 0, 0}, {".C", "#C++", 0, 0, 0},
{".CPP", "#C++", 0, 0, 0}, {".ii", "#C++", 0, 0, 0}, {".CPP", "#C++", 0, 0, 0}, {".ii", "#C++", 0, 0, 0},
{".ads", "#Ada", 0, 0, 0}, {".adb", "#Ada", 0, 0, 0}, {".ads", "#Ada", 0, 0, 0}, {".adb", "#Ada", 0, 0, 0},
{".f", "#Fortran", 0, 0, 0}, {".for", "#Fortran", 0, 0, 0}, {".f", "#Fortran", 0, 0, 0}, {".for", "#Fortran", 0, 0, 0},
{".F", "#Fortran", 0, 0, 0}, {".FOR", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0}, {".FOR", "#Fortran", 0, 0, 0},
{".FPP", "#Fortran", 0, 0, 0}, {".FPP", "#Fortran", 0, 0, 0},
{".f90", "#Fortran 95", 0, 0, 0}, {".f95", "#Fortran 95", 0, 0, 0}, {".f90", "#Fortran 95", 0, 0, 0}, {".f95", "#Fortran 95", 0, 0, 0},
{".fpp", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0}, {".fpp", "#Fortran", 0, 0, 0}, {".F", "#Fortran", 0, 0, 0},
{".FOR", "#Fortran", 0, 0, 0}, {".FPP", "#Fortran", 0, 0, 0}, {".FOR", "#Fortran", 0, 0, 0}, {".FPP", "#Fortran", 0, 0, 0},
{".r", "#Ratfor", 0, 0, 0}, {".r", "#Ratfor", 0, 0, 0},
{".p", "#Pascal", 0, 0, 0}, {".pas", "#Pascal", 0, 0, 0}, {".p", "#Pascal", 0, 0, 0}, {".pas", "#Pascal", 0, 0, 0},
...@@ -1120,7 +1120,7 @@ static const struct option_map option_map[] = ...@@ -1120,7 +1120,7 @@ static const struct option_map option_map[] =
{"--static", "-static", 0}, {"--static", "-static", 0},
{"--std", "-std=", "aj"}, {"--std", "-std=", "aj"},
{"--symbolic", "-symbolic", 0}, {"--symbolic", "-symbolic", 0},
{"--sysroot", "--sysroot=", "aj"}, {"--sysroot", "--sysroot=", "aj"},
{"--time", "-time", 0}, {"--time", "-time", 0},
{"--trace-includes", "-H", 0}, {"--trace-includes", "-H", 0},
{"--traditional", "-traditional", 0}, {"--traditional", "-traditional", 0},
...@@ -1441,7 +1441,7 @@ static const char *gcc_libexec_prefix; ...@@ -1441,7 +1441,7 @@ static const char *gcc_libexec_prefix;
#ifndef STANDARD_STARTFILE_PREFIX_2 #ifndef STANDARD_STARTFILE_PREFIX_2
#define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/" #define STANDARD_STARTFILE_PREFIX_2 "/usr/lib/"
#endif #endif
#ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */ #ifdef CROSS_COMPILE /* Don't use these prefixes for a cross compiler. */
#undef MD_EXEC_PREFIX #undef MD_EXEC_PREFIX
#undef MD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX
...@@ -3239,7 +3239,7 @@ process_command (int argc, const char **argv) ...@@ -3239,7 +3239,7 @@ process_command (int argc, const char **argv)
{ {
gcc_exec_prefix = make_relative_prefix (argv[0], standard_bindir_prefix, gcc_exec_prefix = make_relative_prefix (argv[0], standard_bindir_prefix,
standard_exec_prefix); standard_exec_prefix);
gcc_libexec_prefix = make_relative_prefix (argv[0], gcc_libexec_prefix = make_relative_prefix (argv[0],
standard_bindir_prefix, standard_bindir_prefix,
standard_libexec_prefix); standard_libexec_prefix);
if (gcc_exec_prefix) if (gcc_exec_prefix)
...@@ -4797,7 +4797,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part) ...@@ -4797,7 +4797,7 @@ do_spec_1 (const char *spec, int inswitch, const char *soft_matched_part)
bool files_differ = strcmp (input_realname, temp_realname); bool files_differ = strcmp (input_realname, temp_realname);
free (input_realname); free (input_realname);
free (temp_realname); free (temp_realname);
if (files_differ) if (files_differ)
#endif #endif
{ {
temp_filename = save_string (temp_filename, temp_filename = save_string (temp_filename,
...@@ -5656,10 +5656,10 @@ handle_braces (const char *p) ...@@ -5656,10 +5656,10 @@ handle_braces (const char *p)
while (*p++ != '}'); while (*p++ != '}');
return p; return p;
invalid: invalid:
fatal ("braced spec '%s' is invalid at '%c'", orig, *p); fatal ("braced spec '%s' is invalid at '%c'", orig, *p);
#undef SKIP_WHITE #undef SKIP_WHITE
} }
...@@ -6425,13 +6425,13 @@ main (int argc, const char **argv) ...@@ -6425,13 +6425,13 @@ main (int argc, const char **argv)
for (i = 0; (int) i < n_infiles; i++) for (i = 0; (int) i < n_infiles; i++)
{ {
const char *name = infiles[i].name; const char *name = infiles[i].name;
struct compiler *compiler = lookup_compiler (name, struct compiler *compiler = lookup_compiler (name,
strlen (name), strlen (name),
infiles[i].language); infiles[i].language);
if (compiler && !(compiler->combinable)) if (compiler && !(compiler->combinable))
combine_inputs = false; combine_inputs = false;
if (lang_n_infiles > 0 && compiler != input_file_compiler if (lang_n_infiles > 0 && compiler != input_file_compiler
&& infiles[i].language && infiles[i].language[0] != '*') && infiles[i].language && infiles[i].language[0] != '*')
infiles[i].incompiler = compiler; infiles[i].incompiler = compiler;
...@@ -6451,7 +6451,7 @@ main (int argc, const char **argv) ...@@ -6451,7 +6451,7 @@ main (int argc, const char **argv)
infiles[i].compiled = false; infiles[i].compiled = false;
infiles[i].preprocessed = false; infiles[i].preprocessed = false;
} }
if (combine_flag && save_temps_flag) if (combine_flag && save_temps_flag)
{ {
bool save_combine_inputs = combine_inputs; bool save_combine_inputs = combine_inputs;
...@@ -6462,7 +6462,7 @@ main (int argc, const char **argv) ...@@ -6462,7 +6462,7 @@ main (int argc, const char **argv)
for (i = 0; (int) i < n_infiles; i++) for (i = 0; (int) i < n_infiles; i++)
{ {
int this_file_error = 0; int this_file_error = 0;
input_file_number = i; input_file_number = i;
set_input (infiles[i].name); set_input (infiles[i].name);
if (infiles[i].incompiler if (infiles[i].incompiler
...@@ -6571,7 +6571,7 @@ main (int argc, const char **argv) ...@@ -6571,7 +6571,7 @@ main (int argc, const char **argv)
/* Reset the input file name to the first compile/object file name, for use /* Reset the input file name to the first compile/object file name, for use
with %b in LINK_SPEC. We use the first input file that we can find with %b in LINK_SPEC. We use the first input file that we can find
a compiler to compile it instead of using infiles.language since for a compiler to compile it instead of using infiles.language since for
languages other than C we use aliases that we then lookup later. */ languages other than C we use aliases that we then lookup later. */
if (n_infiles > 0) if (n_infiles > 0)
{ {
...@@ -7342,7 +7342,7 @@ print_multilib_info (void) ...@@ -7342,7 +7342,7 @@ print_multilib_info (void)
invalid_select: invalid_select:
fatal ("multilib select '%s' is invalid", multilib_select); fatal ("multilib select '%s' is invalid", multilib_select);
} }
++p; ++p;
} }
...@@ -7613,7 +7613,7 @@ replace_outfile_spec_function (int argc, const char **argv) ...@@ -7613,7 +7613,7 @@ replace_outfile_spec_function (int argc, const char **argv)
/* Must have exactly two arguments. */ /* Must have exactly two arguments. */
if (argc != 2) if (argc != 2)
abort (); abort ();
for (i = 0; i < n_infiles; i++) for (i = 0; i < n_infiles; i++)
{ {
if (outfiles[i] && !strcmp (outfiles[i], argv[0])) if (outfiles[i] && !strcmp (outfiles[i], argv[0]))
...@@ -7622,7 +7622,7 @@ replace_outfile_spec_function (int argc, const char **argv) ...@@ -7622,7 +7622,7 @@ replace_outfile_spec_function (int argc, const char **argv)
return NULL; return NULL;
} }
/* Given two version numbers, compares the two numbers. /* Given two version numbers, compares the two numbers.
A version number must match the regular expression A version number must match the regular expression
([1-9][0-9]*|0)(\.([1-9][0-9]*|0))* ([1-9][0-9]*|0)(\.([1-9][0-9]*|0))*
*/ */
...@@ -7631,7 +7631,7 @@ compare_version_strings (const char *v1, const char *v2) ...@@ -7631,7 +7631,7 @@ compare_version_strings (const char *v1, const char *v2)
{ {
int rresult; int rresult;
regex_t r; regex_t r;
if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$", if (regcomp (&r, "^([1-9][0-9]*|0)(\\.([1-9][0-9]*|0))*$",
REG_EXTENDED | REG_NOSUB) != 0) REG_EXTENDED | REG_NOSUB) != 0)
abort (); abort ();
...@@ -7660,7 +7660,7 @@ compare_version_strings (const char *v1, const char *v2) ...@@ -7660,7 +7660,7 @@ compare_version_strings (const char *v1, const char *v2)
and nothing if it doesn't. and nothing if it doesn't.
The supported <comparison-op> values are: The supported <comparison-op> values are:
>= true if switch is a later (or same) version than arg1 >= true if switch is a later (or same) version than arg1
!> opposite of >= !> opposite of >=
< true if switch is an earlier version than arg1 < true if switch is an earlier version than arg1
...@@ -7730,7 +7730,7 @@ version_compare_spec_function (int argc, const char **argv) ...@@ -7730,7 +7730,7 @@ version_compare_spec_function (int argc, const char **argv)
case '<' << 8 | '>': case '<' << 8 | '>':
result = comp1 < 0 || comp2 >= 0; result = comp1 < 0 || comp2 >= 0;
break; break;
default: default:
abort (); abort ();
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment