This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix bootstrap with --disable-shared and linker plugin


Hi,
my patch to enable linker plugin by default broke bootstrap with --disable-shared since we build
linker plugin as static library. This is pointless.
This patch arranges --enable-shared into lto-plugin conifgury same was as we already do for libiberty.

The patch was confirmed to fix the reported issue and I also tested it with --disable-shared C only
bootstrap.

Bootstrapped/regtested x86_64-linux, OK?

Honza

	PR lto/47225
	* Makefile.def (lto-plugin module): Add @extra_host_lto_plugin_configure_flags.
	* configure.ac: Set extra_host_lto_plugin_configure_flags=--enable-shared
	when doing plugin.
	* Makefile.in: Regenerate.
	* configure: Regenerate.
Index: Makefile.def
===================================================================
--- Makefile.def	(revision 168596)
+++ Makefile.def	(working copy)
@@ -145,7 +145,8 @@ host_modules= { module= libtermcap; no_c
                 missing=maintainer-clean; };
 host_modules= { module= utils; no_check=true; };
 host_modules= { module= gnattools; };
-host_modules= { module= lto-plugin; bootstrap=true; };
+host_modules= { module= lto-plugin; bootstrap=true;
+		extra_configure_flags='@extra_host_lto_plugin_configure_flags@'; };
 
 target_modules = { module= libstdc++-v3;
 		   bootstrap=true;
Index: Makefile.in
===================================================================
--- Makefile.in	(revision 168596)
+++ Makefile.in	(working copy)
@@ -45248,7 +45248,7 @@ configure-lto-plugin:
 	libsrcdir="$$s/lto-plugin"; \
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
-	  --target=${target_alias} $${srcdiroption}  \
+	  --target=${target_alias} $${srcdiroption} @extra_host_lto_plugin_configure_flags@ \
 	  || exit 1
 @endif lto-plugin
 
@@ -45282,7 +45282,8 @@ configure-stage1-lto-plugin:
 	$(SHELL) $${libsrcdir}/configure \
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
-	  $(STAGE1_CONFIGURE_FLAGS)
+	  $(STAGE1_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 .PHONY: configure-stage2-lto-plugin maybe-configure-stage2-lto-plugin
@@ -45315,7 +45316,8 @@ configure-stage2-lto-plugin:
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
-	  $(STAGE2_CONFIGURE_FLAGS)
+	  $(STAGE2_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 .PHONY: configure-stage3-lto-plugin maybe-configure-stage3-lto-plugin
@@ -45348,7 +45350,8 @@ configure-stage3-lto-plugin:
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
-	  $(STAGE3_CONFIGURE_FLAGS)
+	  $(STAGE3_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 .PHONY: configure-stage4-lto-plugin maybe-configure-stage4-lto-plugin
@@ -45381,7 +45384,8 @@ configure-stage4-lto-plugin:
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
-	  $(STAGE4_CONFIGURE_FLAGS)
+	  $(STAGE4_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 .PHONY: configure-stageprofile-lto-plugin maybe-configure-stageprofile-lto-plugin
@@ -45414,7 +45418,8 @@ configure-stageprofile-lto-plugin:
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
-	  $(STAGEprofile_CONFIGURE_FLAGS)
+	  $(STAGEprofile_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 .PHONY: configure-stagefeedback-lto-plugin maybe-configure-stagefeedback-lto-plugin
@@ -45447,7 +45452,8 @@ configure-stagefeedback-lto-plugin:
 	  $(HOST_CONFIGARGS) --build=${build_alias} --host=${host_alias} \
 	  --target=${target_alias} $${srcdiroption} \
 	  --with-build-libsubdir=$(HOST_SUBDIR) \
-	  $(STAGEfeedback_CONFIGURE_FLAGS)
+	  $(STAGEfeedback_CONFIGURE_FLAGS) \
+	  @extra_host_lto_plugin_configure_flags@
 @endif lto-plugin-bootstrap
 
 
Index: configure
===================================================================
--- configure	(revision 168596)
+++ configure	(working copy)
@@ -640,6 +640,7 @@ CFLAGS_FOR_TARGET
 DEBUG_PREFIX_CFLAGS_FOR_TARGET
 SYSROOT_CFLAGS_FOR_TARGET
 stage1_languages
+extra_host_lto_plugin_configure_flags
 extra_host_libiberty_configure_flags
 clooginc
 clooglibs
@@ -6237,6 +6238,7 @@ if test -d ${srcdir}/gcc; then
 
   # If LTO is enabled, add the LTO front end.
   extra_host_libiberty_configure_flags=
+  extra_host_lto_plugin_configure_flags=
   if test "$enable_lto" = "yes" ; then
     case ,${enable_languages}, in
       *,lto,*) ;;
@@ -6245,10 +6247,12 @@ if test -d ${srcdir}/gcc; then
     if test "${build_lto_plugin}" = "yes" ; then
       configdirs="$configdirs lto-plugin"
       extra_host_libiberty_configure_flags=--enable-shared
+      extra_host_lto_plugin_configure_flags=--enable-shared
     fi
   fi
 
 
+
   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
   potential_languages=,c,
 
Index: configure.ac
===================================================================
--- configure.ac	(revision 168596)
+++ configure.ac	(working copy)
@@ -1810,6 +1810,7 @@ if test -d ${srcdir}/gcc; then
 
   # If LTO is enabled, add the LTO front end.
   extra_host_libiberty_configure_flags=
+  extra_host_lto_plugin_configure_flags=
   if test "$enable_lto" = "yes" ; then
     case ,${enable_languages}, in
       *,lto,*) ;;
@@ -1818,9 +1819,11 @@ if test -d ${srcdir}/gcc; then
     if test "${build_lto_plugin}" = "yes" ; then
       configdirs="$configdirs lto-plugin"
       extra_host_libiberty_configure_flags=--enable-shared
+      extra_host_lto_plugin_configure_flags=--enable-shared
     fi
   fi
   AC_SUBST(extra_host_libiberty_configure_flags)
+  AC_SUBST(extra_host_lto_plugin_configure_flags)
 
   missing_languages=`echo ",$enable_languages," | sed -e s/,all,/,/ -e s/,c,/,/ `
   potential_languages=,c,


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]