$OpenBSD: patch-lto-plugin_Makefile_in,v 1.1.1.1 2021/08/15 18:42:11 pascal Exp $
Index: lto-plugin/Makefile.in
--- lto-plugin/Makefile.in.orig
+++ lto-plugin/Makefile.in
@@ -349,11 +349,13 @@ AM_LIBTOOLFLAGS = --tag=disable-static
 libexecsub_LTLIBRARIES = liblto_plugin.la
 in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
 liblto_plugin_la_SOURCES = lto-plugin.c
+include $(top_srcdir)/../libversions
 # Note that we intentionally override the bindir supplied by ACX_LT_HOST_FLAGS.
 liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module -avoid-version \
 	-bindir $(libexecsubdir) $(if $(wildcard \
 	$(libiberty_noasan)),, $(if $(wildcard \
-	$(libiberty_pic)),,-Wc,$(libiberty)))
+	$(libiberty_pic)),,-Wc,$(libiberty))) \
+	$(LIBlto_plugin_LTVERSION)
 # Can be simplified when libiberty becomes a normal convenience library.
 libiberty = $(with_libiberty)/libiberty.a
 libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
@@ -685,7 +687,7 @@ $(in_gcc_libs) : $(gcc_build_dir)/%: %
 	  echo WARNING: $* is static, not copying to $@ >&2 ; \
 	else \
 	  $(mkinstalldirs) $(gcc_build_dir) && \
-	  $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $* `pwd`/$@ ; \
+	cp $* `pwd`/$@ ; \
 	fi
 
 # Tell versions [3.59,3.63) of GNU make to not export all variables.
