copy liblto_plugin.so into lib/bfd-plugins

Submitted by patrick.oppenlander@gmail.com on Jan. 15, 2021, 2:32 a.m.

Details

Message ID 20210115023237.2784895-1-patrick.oppenlander@gmail.com
State New
Series "install symlink to liblto_plugin.so into lib/bfd-plugins"
Headers show

Commit Message

patrick.oppenlander@gmail.com Jan. 15, 2021, 2:32 a.m.
From: Patrick Oppenlander <patrick.oppenlander@gmail.com>

The ar, nm and ranlib tools will automatically load plugins from the
lib/bfd-plugins directory if present.

With this file in place it is no longer necessary to use the gcc-
prefixed versions of these tools (or the --plugin argument) to handle
LTO objects.
---
 litecross/Makefile | 2 ++
 1 file changed, 2 insertions(+)

Patch hide | download patch | download mbox

diff --git a/litecross/Makefile b/litecross/Makefile
index 8ec0ed2..3b797d1 100644
--- a/litecross/Makefile
+++ b/litecross/Makefile
@@ -254,6 +254,8 @@  install-binutils: | obj_binutils/.lc_built
 install-gcc: | obj_gcc/.lc_built
 	cd obj_gcc && $(MAKE) MAKE="$(MAKE) $(LIBTOOL_ARG)" DESTDIR=$(DESTDIR)$(OUTPUT) install
 	ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc
+	mkdir -p $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
+	cp -L $(DESTDIR)$(OUTPUT)/libexec/gcc/$(TARGET)/$(file < src_gcc/gcc/BASE-VER)/liblto_plugin.so $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
 
 ifneq ($(LINUX_SRCDIR),)
 TARGET_ARCH = $(firstword $(subst -, ,$(TARGET)))

Comments

Fangrui Song Jan. 15, 2021, 2:56 a.m.
On Thu, Jan 14, 2021 at 6:33 PM <patrick.oppenlander@gmail.com> wrote:
>
> From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
>
> The ar, nm and ranlib tools will automatically load plugins from the
> lib/bfd-plugins directory if present.
>
> With this file in place it is no longer necessary to use the gcc-
> prefixed versions of these tools (or the --plugin argument) to handle
> LTO objects.
> ---
>  litecross/Makefile | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/litecross/Makefile b/litecross/Makefile
> index 8ec0ed2..3b797d1 100644
> --- a/litecross/Makefile
> +++ b/litecross/Makefile
> @@ -254,6 +254,8 @@ install-binutils: | obj_binutils/.lc_built
>  install-gcc: | obj_gcc/.lc_built
>         cd obj_gcc && $(MAKE) MAKE="$(MAKE) $(LIBTOOL_ARG)" DESTDIR=$(DESTDIR)$(OUTPUT) install
>         ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc
> +       mkdir -p $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
> +       cp -L $(DESTDIR)$(OUTPUT)/libexec/gcc/$(TARGET)/$(file < src_gcc/gcc/BASE-VER)/liblto_plugin.so $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
>
>  ifneq ($(LINUX_SRCDIR),)
>  TARGET_ARCH = $(firstword $(subst -, ,$(TARGET)))
> --
> 2.30.0
>

Your 'file' seems different. https://www.darwinsys.com/file/ (The Fine
Free File Comman) does not support `file < ...`
patrick.oppenlander@gmail.com Jan. 15, 2021, 3:30 a.m.
On Fri, Jan 15, 2021 at 1:56 PM Fangrui Song <emacsray@gmail.com> wrote:
>
> On Thu, Jan 14, 2021 at 6:33 PM <patrick.oppenlander@gmail.com> wrote:
> >
> > From: Patrick Oppenlander <patrick.oppenlander@gmail.com>
> >
> > The ar, nm and ranlib tools will automatically load plugins from the
> > lib/bfd-plugins directory if present.
> >
> > With this file in place it is no longer necessary to use the gcc-
> > prefixed versions of these tools (or the --plugin argument) to handle
> > LTO objects.
> > ---
> >  litecross/Makefile | 2 ++
> >  1 file changed, 2 insertions(+)
> >
> > diff --git a/litecross/Makefile b/litecross/Makefile
> > index 8ec0ed2..3b797d1 100644
> > --- a/litecross/Makefile
> > +++ b/litecross/Makefile
> > @@ -254,6 +254,8 @@ install-binutils: | obj_binutils/.lc_built
> >  install-gcc: | obj_gcc/.lc_built
> >         cd obj_gcc && $(MAKE) MAKE="$(MAKE) $(LIBTOOL_ARG)" DESTDIR=$(DESTDIR)$(OUTPUT) install
> >         ln -sf $(TARGET)-gcc $(DESTDIR)$(OUTPUT)/bin/$(TARGET)-cc
> > +       mkdir -p $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
> > +       cp -L $(DESTDIR)$(OUTPUT)/libexec/gcc/$(TARGET)/$(file < src_gcc/gcc/BASE-VER)/liblto_plugin.so $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
> >
> >  ifneq ($(LINUX_SRCDIR),)
> >  TARGET_ARCH = $(firstword $(subst -, ,$(TARGET)))
> > --
> > 2.30.0
> >
>
> Your 'file' seems different. https://www.darwinsys.com/file/ (The Fine
> Free File Comman) does not support `file < ...`

In this context $(file ...) is a make function, not a shell command.

https://www.gnu.org/software/make/manual/html_node/File-Function.html

Patrick