diff options
author | bapt <bapt@FreeBSD.org> | 2014-11-29 11:50:19 +0000 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2014-11-29 11:50:19 +0000 |
commit | d3bf63ef6b0fed51d1009d7cc1ac7be1b1ac264b (patch) | |
tree | 7e2c676b7be884c0cd85e2dd1c95e7225eb5deb5 | |
parent | 42d4bd50d9ff61a8d2429b7978ed0bff89577920 (diff) | |
download | FreeBSD-src-d3bf63ef6b0fed51d1009d7cc1ac7be1b1ac264b.zip FreeBSD-src-d3bf63ef6b0fed51d1009d7cc1ac7be1b1ac264b.tar.gz |
Implement --no-fatal-warning for compatibility with newer ld
what ever order the options are passed to ld(1) the --no-fatal-warning always
disable --fatal-warning
-rw-r--r-- | contrib/binutils/ld/lexsup.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/contrib/binutils/ld/lexsup.c b/contrib/binutils/ld/lexsup.c index 6ef5053..2dfab98 100644 --- a/contrib/binutils/ld/lexsup.c +++ b/contrib/binutils/ld/lexsup.c @@ -84,6 +84,7 @@ enum option_values OPTION_NO_KEEP_MEMORY, OPTION_NO_WARN_MISMATCH, OPTION_NO_WARN_SEARCH_MISMATCH, + OPTION_NO_WARN_FATAL, OPTION_NOINHIBIT_EXEC, OPTION_NON_SHARED, OPTION_NO_WHOLE_ARCHIVE, @@ -375,6 +376,9 @@ static const struct ld_option ld_options[] = { {"fatal-warnings", no_argument, NULL, OPTION_WARN_FATAL}, '\0', NULL, N_("Treat warnings as errors"), TWO_DASHES }, + { {"no-fatal-warnings", no_argument, NULL, OPTION_NO_WARN_FATAL}, + '\0', NULL, N_("Don't treat warnings as errors"), + TWO_DASHES }, { {"fini", required_argument, NULL, OPTION_FINI}, '\0', N_("SYMBOL"), N_("Call SYMBOL at unload-time"), ONE_DASH }, { {"force-exe-suffix", no_argument, NULL, OPTION_FORCE_EXE_SUFFIX}, @@ -568,6 +572,7 @@ parse_args (unsigned argc, char **argv) struct option *really_longopts; int last_optind; enum report_method how_to_report_unresolved_symbols = RM_GENERATE_ERROR; + int no_fatal_warnings = FALSE; shortopts = xmalloc (OPTION_COUNT * 3 + 2); longopts = xmalloc (sizeof (*longopts) * (OPTION_COUNT + 1)); @@ -1317,6 +1322,9 @@ parse_args (unsigned argc, char **argv) case OPTION_WARN_FATAL: config.fatal_warnings = TRUE; break; + case OPTION_NO_WARN_FATAL: + no_fatal_warnings = TRUE; + break; case OPTION_WARN_MULTIPLE_GP: config.warn_multiple_gp = TRUE; break; @@ -1438,6 +1446,8 @@ parse_args (unsigned argc, char **argv) break; } } + if (no_fatal_warnings) + config.fatal_warnings = FALSE; if (ingroup) lang_leave_group (); |