mailing list of musl libc
 help / color / mirror / Atom feed
* [musl] [PATCH] install symlink to liblto_plugin.so into lib/bfd-plugins
@ 2021-01-14  4:03 patrick.oppenlander
  2021-01-14  8:09 ` Szabolcs Nagy
  0 siblings, 1 reply; 6+ messages in thread
From: patrick.oppenlander @ 2021-01-14  4:03 UTC (permalink / raw)
  To: musl; +Cc: Patrick Oppenlander

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 symlink 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..8bae518 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
+	ln -sf ../../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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [musl] [PATCH] install symlink to liblto_plugin.so into lib/bfd-plugins
  2021-01-14  4:03 [musl] [PATCH] install symlink to liblto_plugin.so into lib/bfd-plugins patrick.oppenlander
@ 2021-01-14  8:09 ` Szabolcs Nagy
  2021-01-14 10:24   ` Patrick Oppenlander
  0 siblings, 1 reply; 6+ messages in thread
From: Szabolcs Nagy @ 2021-01-14  8:09 UTC (permalink / raw)
  To: patrick.oppenlander; +Cc: musl

* patrick.oppenlander@gmail.com <patrick.oppenlander@gmail.com> [2021-01-14 15:03:42 +1100]:
> 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 symlink 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..8bae518 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
> +	ln -sf ../../libexec/gcc/$(TARGET)/$(file < src_gcc/gcc/BASE-VER)/liblto_plugin.so $(DESTDIR)$(OUTPUT)/lib/bfd-plugins

file < BASE-VER

does not do anything useful for me, did you mean

cat BASE-VER

?

this does not work if different TARGETs are installed to the same OUTPUT

or is the plugin independent from target?
then maybe a copy would be better than a symlink
>  
>  ifneq ($(LINUX_SRCDIR),)
>  TARGET_ARCH = $(firstword $(subst -, ,$(TARGET)))
> -- 
> 2.30.0

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [musl] [PATCH] install symlink to liblto_plugin.so into lib/bfd-plugins
  2021-01-14  8:09 ` Szabolcs Nagy
@ 2021-01-14 10:24   ` Patrick Oppenlander
  2021-01-15  2:32     ` [musl] [PATCH] copy " patrick.oppenlander
  0 siblings, 1 reply; 6+ messages in thread
From: Patrick Oppenlander @ 2021-01-14 10:24 UTC (permalink / raw)
  To: Patrick Oppenlander, musl

On Thu, Jan 14, 2021 at 7:09 PM Szabolcs Nagy <nsz@port70.net> wrote:
>
> * patrick.oppenlander@gmail.com <patrick.oppenlander@gmail.com> [2021-01-14 15:03:42 +1100]:
> > 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 symlink 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..8bae518 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
> > +     ln -sf ../../libexec/gcc/$(TARGET)/$(file < src_gcc/gcc/BASE-VER)/liblto_plugin.so $(DESTDIR)$(OUTPUT)/lib/bfd-plugins
>
> file < BASE-VER
>
> does not do anything useful for me, did you mean
>
> cat BASE-VER
>
> ?

It's this:

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

I think it was added in GNU make 4.0 around 2013.

> this does not work if different TARGETs are installed to the same OUTPUT
>
> or is the plugin independent from target?
> then maybe a copy would be better than a symlink

I believe the plugin is target independent but will change between gcc versions.

The plugin is only ~100k so a file copy should be fine. I can submit a
new patch tomorrow when I'm back on the dev box.

Patrick

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [musl] [PATCH] copy liblto_plugin.so into lib/bfd-plugins
  2021-01-14 10:24   ` Patrick Oppenlander
@ 2021-01-15  2:32     ` patrick.oppenlander
  2021-01-15  2:56       ` Fangrui Song
  0 siblings, 1 reply; 6+ messages in thread
From: patrick.oppenlander @ 2021-01-15  2:32 UTC (permalink / raw)
  To: musl; +Cc: Patrick Oppenlander

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [musl] [PATCH] copy liblto_plugin.so into lib/bfd-plugins
  2021-01-15  2:32     ` [musl] [PATCH] copy " patrick.oppenlander
@ 2021-01-15  2:56       ` Fangrui Song
  2021-01-15  3:30         ` Patrick Oppenlander
  0 siblings, 1 reply; 6+ messages in thread
From: Fangrui Song @ 2021-01-15  2:56 UTC (permalink / raw)
  To: musl; +Cc: Patrick Oppenlander

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 < ...`

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [musl] [PATCH] copy liblto_plugin.so into lib/bfd-plugins
  2021-01-15  2:56       ` Fangrui Song
@ 2021-01-15  3:30         ` Patrick Oppenlander
  0 siblings, 0 replies; 6+ messages in thread
From: Patrick Oppenlander @ 2021-01-15  3:30 UTC (permalink / raw)
  To: Fangrui Song; +Cc: musl

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-01-15  3:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14  4:03 [musl] [PATCH] install symlink to liblto_plugin.so into lib/bfd-plugins patrick.oppenlander
2021-01-14  8:09 ` Szabolcs Nagy
2021-01-14 10:24   ` Patrick Oppenlander
2021-01-15  2:32     ` [musl] [PATCH] copy " patrick.oppenlander
2021-01-15  2:56       ` Fangrui Song
2021-01-15  3:30         ` Patrick Oppenlander

mailing list of musl libc

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://inbox.vuxu.org/musl

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 musl musl/ http://inbox.vuxu.org/musl \
		musl@inbox.vuxu.org
	public-inbox-index musl

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.vuxu.org/vuxu.archive.musl


code repositories for the project(s) associated with this inbox:

	https://git.vuxu.org/mirror/musl/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git