public inbox for java-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [patch] Link the dummy libgcj_bc shared library with --no-as-needed
@ 2013-09-04 10:05 Matthias Klose
  2013-09-04 10:21 ` Andrew Haley
  0 siblings, 1 reply; 2+ messages in thread
From: Matthias Klose @ 2013-09-04 10:05 UTC (permalink / raw)
  To: GCJ-patches

[-- Attachment #1: Type: text/plain, Size: 385 bytes --]

When building a compiler which passes --no-as-needed by default to the linker,
libgcj_bc.so ends up without a DTNEEDED entry for libgcj, because no symbols in
libgcj are required to resolve symbols in libgcj_bc.  This causes about 500 test
cases to fail.  Solved by explicitly passing -Wl,--no-as-needed.  Is this ok for
upstream? It's not needed, but doesn't hurt either.

  Matthias

[-- Attachment #2: gcc-as-needed.diff --]
[-- Type: text/plain, Size: 513 bytes --]

	* Makefile.am (libgcj_bc.la): Link using -Wl,--no-as-needed.
	* Makefile.in: Regenerate.

--- a/src/libjava/Makefile.am
+++ b/src/libjava/Makefile.am
@@ -625,7 +625,7 @@
 	rm .libs/libgcj_bc.so; \
 	mv .libs/libgcj_bc.so.1.0.0 .libs/libgcj_bc.so; \
 	$(libgcj_bc_dummy_LINK) -xc /dev/null -Wl,-soname,libgcj_bc.so.1 \
-	-o .libs/libgcj_bc.so.1.0.0 -lgcj || exit; \
+	-o .libs/libgcj_bc.so.1.0.0 -Wl,--no-as-needed -lgcj || exit; \
 	rm .libs/libgcj_bc.so.1; \
 	$(LN_S) libgcj_bc.so.1.0.0 .libs/libgcj_bc.so.1
 

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

* Re: [patch] Link the dummy libgcj_bc shared library with --no-as-needed
  2013-09-04 10:05 [patch] Link the dummy libgcj_bc shared library with --no-as-needed Matthias Klose
@ 2013-09-04 10:21 ` Andrew Haley
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Haley @ 2013-09-04 10:21 UTC (permalink / raw)
  To: Matthias Klose; +Cc: GCJ-patches

On 09/04/2013 11:05 AM, Matthias Klose wrote:
> When building a compiler which passes --no-as-needed by default to the linker,
> libgcj_bc.so ends up without a DTNEEDED entry for libgcj, because no symbols in
> libgcj are required to resolve symbols in libgcj_bc.  This causes about 500 test
> cases to fail.  Solved by explicitly passing -Wl,--no-as-needed.  Is this ok for
> upstream? It's not needed, but doesn't hurt either.

That doesn't make sense.  If the compiler is passing --no-as-needed by default to the linker,
why do you need to pass it again?

Andrew.


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

end of thread, other threads:[~2013-09-04 10:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-04 10:05 [patch] Link the dummy libgcj_bc shared library with --no-as-needed Matthias Klose
2013-09-04 10:21 ` Andrew Haley

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