Use top-level config support for enabling plugins.

Also recognizes --plugin options when plugins are disabled.

2018-03-28  Cary Coutant  <ccoutant@gmail.com>

gold/
	PR gold/21423
	PR gold/22500
	* configure.ac: Call AC_USE_SYSTEM_EXTENSIONS.
	Replace check for --enable-plugins with AC_PLUGINS.
	* options.cc (parse_plugin, parse_plugin_opt): Remove #ifdef.
	(General_options::finalize): Check if plugins enabled.
	* options.h (--plugin, --plugin-opt): Define even if plugins not
	enabled.
	* Makefile.in: Regenerate.
	* aclocal.m4: Regenerate.
	* configure: Regenerate.
	* testsuite/Makefile.in: Regenerate.
This commit is contained in:
Cary Coutant 2018-03-27 17:49:49 -07:00
parent 8205a328f8
commit 24538276c6
8 changed files with 1900 additions and 1112 deletions

View File

@ -1,3 +1,18 @@
2018-03-28 Cary Coutant <ccoutant@gmail.com>
PR gold/21423
PR gold/22500
* configure.ac: Call AC_USE_SYSTEM_EXTENSIONS.
Replace check for --enable-plugins with AC_PLUGINS.
* options.cc (parse_plugin, parse_plugin_opt): Remove #ifdef.
(General_options::finalize): Check if plugins enabled.
* options.h (--plugin, --plugin-opt): Define even if plugins not
enabled.
* Makefile.in: Regenerate.
* aclocal.m4: Regenerate.
* configure: Regenerate.
* testsuite/Makefile.in: Regenerate.
2018-03-28 Cary Coutant <ccoutant@gmail.com>
PR gold/22969

View File

@ -87,8 +87,8 @@ subdir = .
DIST_COMMON = NEWS README ChangeLog $(srcdir)/Makefile.in \
$(srcdir)/Makefile.am $(top_srcdir)/configure \
$(am__configure_deps) $(srcdir)/config.in \
$(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in ffsll.c \
ftruncate.c mremap.c pread.c yyscript.h yyscript.c \
$(srcdir)/../mkinstalldirs $(top_srcdir)/po/Make-in \
ftruncate.c pread.c ffsll.c mremap.c yyscript.h yyscript.c \
$(srcdir)/../depcomp $(srcdir)/../ylwrap
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
@ -97,6 +97,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/nls.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/plugins.m4 \
$(top_srcdir)/../config/po.m4 \
$(top_srcdir)/../config/progtest.m4 \
$(top_srcdir)/../config/zlib.m4 \

1
gold/aclocal.m4 vendored
View File

@ -1006,6 +1006,7 @@ m4_include([../config/lcmessage.m4])
m4_include([../config/lead-dot.m4])
m4_include([../config/nls.m4])
m4_include([../config/override.m4])
m4_include([../config/plugins.m4])
m4_include([../config/po.m4])
m4_include([../config/progtest.m4])
m4_include([../config/zlib.m4])

2964
gold/configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -28,6 +28,8 @@ AM_INIT_AUTOMAKE([no-dist parallel-tests])
AM_CONFIG_HEADER(config.h:config.in)
AC_USE_SYSTEM_EXTENSIONS
# PR 14072
AH_VERBATIM([00_CONFIG_H_CHECK],
[/* Check that config.h is #included before system headers
@ -100,14 +102,7 @@ if test "$threads" = "yes"; then
fi
AM_CONDITIONAL(THREADS, test "$threads" = "yes")
AC_ARG_ENABLE([plugins],
[ --enable-plugins linker plugins],
[case "${enableval}" in
yes | "") plugins=yes ;;
no) plugins=no ;;
*) plugins=yes ;;
esac],
[plugins=no])
AC_PLUGINS
if test "$plugins" = "yes"; then
AC_DEFINE(ENABLE_PLUGINS, 1,
[Define to enable linker plugins])

View File

@ -448,7 +448,6 @@ General_options::parse_library(const char*, const char* arg,
cmdline->inputs().add_file(file);
}
#ifdef ENABLE_PLUGINS
void
General_options::parse_plugin(const char*, const char* arg,
Command_line*)
@ -464,7 +463,6 @@ General_options::parse_plugin_opt(const char*, const char* arg,
{
this->add_plugin_option(arg);
}
#endif // ENABLE_PLUGINS
void
General_options::parse_R(const char* option, const char* arg,
@ -1208,6 +1206,13 @@ General_options::finalize()
program_name);
#endif
#ifndef ENABLE_PLUGINS
if (this->has_plugins())
gold_fatal(_("cannot use --plugin: "
"%s was compiled without plugin support"),
program_name);
#endif
std::string libpath;
if (this->user_set_Y())
{

View File

@ -1125,6 +1125,12 @@ class General_options
N_("Load a plugin library"), N_("PLUGIN"));
DEFINE_special(plugin_opt, options::TWO_DASHES, '\0',
N_("Pass an option to the plugin"), N_("OPTION"));
#else
DEFINE_special(plugin, options::TWO_DASHES, '\0',
N_("Load a plugin library (not supported)"), N_("PLUGIN"));
DEFINE_special(plugin_opt, options::TWO_DASHES, '\0',
N_("Pass an option to the plugin (not supported)"),
N_("OPTION"));
#endif
DEFINE_bool(posix_fallocate, options::TWO_DASHES, '\0', true,

View File

@ -1075,6 +1075,7 @@ am__aclocal_m4_deps = $(top_srcdir)/../config/depstand.m4 \
$(top_srcdir)/../config/lead-dot.m4 \
$(top_srcdir)/../config/nls.m4 \
$(top_srcdir)/../config/override.m4 \
$(top_srcdir)/../config/plugins.m4 \
$(top_srcdir)/../config/po.m4 \
$(top_srcdir)/../config/progtest.m4 \
$(top_srcdir)/../config/zlib.m4 \