* [PATCH] Fix PR lto/49664: liblto_plugin.so exports too many symbols
@ 2021-09-12 16:11 apinski
2021-09-13 9:10 ` Richard Biener
0 siblings, 1 reply; 2+ messages in thread
From: apinski @ 2021-09-12 16:11 UTC (permalink / raw)
To: gcc-patches; +Cc: Andrew Pinski
From: Andrew Pinski <apinski@marvell.com>
So right now liblto_plugin.so exports many libiberty symbols and
simple_object file symbols but really it just needs to export onload.
This fixes the problem by using "-export-symbols-regex onload" on
the libtool link line.
lto-plugin/ChangeLog:
* Makefile.am: Export only onload.
* Makefile.in: Regenerate.
---
lto-plugin/Makefile.am | 3 ++-
lto-plugin/Makefile.in | 7 ++++---
2 files changed, 6 insertions(+), 4 deletions(-)
diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
index 8b20e1d1d87..988d7a78294 100644
--- a/lto-plugin/Makefile.am
+++ b/lto-plugin/Makefile.am
@@ -21,7 +21,8 @@ in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
liblto_plugin_la_SOURCES = lto-plugin.c
# 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)
+ $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
+ -export-symbols-regex onload
# Can be simplified when libiberty becomes a normal convenience library.
libiberty = $(with_libiberty)/libiberty.a
libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
index 20611c6b1e6..f8df31bb1e8 100644
--- a/lto-plugin/Makefile.in
+++ b/lto-plugin/Makefile.in
@@ -323,6 +323,7 @@ prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
real_target_noncanonical = @real_target_noncanonical@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -350,9 +351,9 @@ libexecsub_LTLIBRARIES = liblto_plugin.la
in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
liblto_plugin_la_SOURCES = lto-plugin.c
# 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 \
+liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module \
+ -avoid-version -bindir $(libexecsubdir) -export-symbols-regex \
+ onload $(if $(wildcard $(libiberty_noasan)),, $(if $(wildcard \
$(libiberty_pic)),,-Wc,$(libiberty)))
# Can be simplified when libiberty becomes a normal convenience library.
libiberty = $(with_libiberty)/libiberty.a
--
2.17.1
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix PR lto/49664: liblto_plugin.so exports too many symbols
2021-09-12 16:11 [PATCH] Fix PR lto/49664: liblto_plugin.so exports too many symbols apinski
@ 2021-09-13 9:10 ` Richard Biener
0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2021-09-13 9:10 UTC (permalink / raw)
To: Andrew Pinski; +Cc: GCC Patches
On Sun, Sep 12, 2021 at 6:12 PM apinski--- via Gcc-patches
<gcc-patches@gcc.gnu.org> wrote:
>
> From: Andrew Pinski <apinski@marvell.com>
>
> So right now liblto_plugin.so exports many libiberty symbols and
> simple_object file symbols but really it just needs to export onload.
>
> This fixes the problem by using "-export-symbols-regex onload" on
> the libtool link line.
OK.
> lto-plugin/ChangeLog:
>
> * Makefile.am: Export only onload.
> * Makefile.in: Regenerate.
> ---
> lto-plugin/Makefile.am | 3 ++-
> lto-plugin/Makefile.in | 7 ++++---
> 2 files changed, 6 insertions(+), 4 deletions(-)
>
> diff --git a/lto-plugin/Makefile.am b/lto-plugin/Makefile.am
> index 8b20e1d1d87..988d7a78294 100644
> --- a/lto-plugin/Makefile.am
> +++ b/lto-plugin/Makefile.am
> @@ -21,7 +21,8 @@ in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
> liblto_plugin_la_SOURCES = lto-plugin.c
> # 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)
> + $(lt_host_flags) -module -avoid-version -bindir $(libexecsubdir) \
> + -export-symbols-regex onload
> # Can be simplified when libiberty becomes a normal convenience library.
> libiberty = $(with_libiberty)/libiberty.a
> libiberty_noasan = $(with_libiberty)/noasan/libiberty.a
> diff --git a/lto-plugin/Makefile.in b/lto-plugin/Makefile.in
> index 20611c6b1e6..f8df31bb1e8 100644
> --- a/lto-plugin/Makefile.in
> +++ b/lto-plugin/Makefile.in
> @@ -323,6 +323,7 @@ prefix = @prefix@
> program_transform_name = @program_transform_name@
> psdir = @psdir@
> real_target_noncanonical = @real_target_noncanonical@
> +runstatedir = @runstatedir@
> sbindir = @sbindir@
> sharedstatedir = @sharedstatedir@
> srcdir = @srcdir@
> @@ -350,9 +351,9 @@ libexecsub_LTLIBRARIES = liblto_plugin.la
> in_gcc_libs = $(foreach lib, $(libexecsub_LTLIBRARIES), $(gcc_build_dir)/$(lib))
> liblto_plugin_la_SOURCES = lto-plugin.c
> # 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 \
> +liblto_plugin_la_LDFLAGS = $(AM_LDFLAGS) $(lt_host_flags) -module \
> + -avoid-version -bindir $(libexecsubdir) -export-symbols-regex \
> + onload $(if $(wildcard $(libiberty_noasan)),, $(if $(wildcard \
> $(libiberty_pic)),,-Wc,$(libiberty)))
> # Can be simplified when libiberty becomes a normal convenience library.
> libiberty = $(with_libiberty)/libiberty.a
> --
> 2.17.1
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-13 9:10 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-12 16:11 [PATCH] Fix PR lto/49664: liblto_plugin.so exports too many symbols apinski
2021-09-13 9:10 ` Richard Biener
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).