public inbox for frysk-cvs@sourceware.org
help / color / mirror / Atom feed
* [SCM]  master: Build a singular .so.
@ 2008-06-19 12:55 cagney
  0 siblings, 0 replies; only message in thread
From: cagney @ 2008-06-19 12:55 UTC (permalink / raw)
  To: frysk-cvs

The branch, master has been updated
       via  a0d0cc59f7dcc4377aee0568bcc4b890e8b55e6b (commit)
      from  aa7ad2daa6bd5e33ba0b5dce6dceb3df009b6f15 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit a0d0cc59f7dcc4377aee0568bcc4b890e8b55e6b
Author: Andrew Cagney <cagney@redhat.com>
Date:   Thu Jun 19 08:53:20 2008 -0400

    Build a singular .so.
    
    This adds the locally modified elfutils and libunwind code to frysk's
    jni library.  Over time we'll be able to prune this back.
    
    frysk-common/ChangeLog
    2008-06-19  Andrew Cagney  <cagney@redhat.com>
    
    	* Makefile.rules (JNI_OBJECT_LIST): Define.
    	(JNI_LIBRARY_LIST): Define.
    	(JNI_ARCHIVE_LIST): Define.
    	(%-jni.so: %-jni.a): New rule.
    
    frysk-sys/ChangeLog
    2008-06-19  Andrew Cagney  <cagney@redhat.com>
    
    	* Makefile.am (JNI_LIBRARY_LIST): Define.
    	(JNI_ARCHIVE_LIST): Define.
    	(JNI_OBJECT_LIST): Define.

-----------------------------------------------------------------------

Summary of changes:
 frysk-common/ChangeLog      |    7 +++++++
 frysk-common/Makefile.rules |   30 ++++++++++++++++++++++++++++++
 frysk-sys/ChangeLog         |    6 ++++++
 frysk-sys/Makefile.am       |   15 +++++++++++++++
 4 files changed, 58 insertions(+), 0 deletions(-)

First 500 lines of diff:
diff --git a/frysk-common/ChangeLog b/frysk-common/ChangeLog
index da3952f..2c22c3d 100644
--- a/frysk-common/ChangeLog
+++ b/frysk-common/ChangeLog
@@ -1,3 +1,10 @@
+2008-06-19  Andrew Cagney  <cagney@redhat.com>
+
+	* Makefile.rules (JNI_OBJECT_LIST): Define.
+	(JNI_LIBRARY_LIST): Define.
+	(JNI_ARCHIVE_LIST): Define.
+	(%-jni.so: %-jni.a): New rule.
+
 2008-06-17  Andrew Cagney  <cagney@redhat.com>
 
 	* Makefile.rules (Runner): Load libaudit.so.
diff --git a/frysk-common/Makefile.rules b/frysk-common/Makefile.rules
index 321f510..3c7d8fc 100644
--- a/frysk-common/Makefile.rules
+++ b/frysk-common/Makefile.rules
@@ -94,6 +94,7 @@ GEN_CLASSPATH =
 GEN_SOURCEPATH = $(srcdir) $(top_builddir)
 empty=
 space=$(empty) $(empty)
+comma=$(empty),$(empty)
 JAVAROOT = classes
 
 # The list of libraries for the GCJ programs is different to that of
@@ -465,6 +466,35 @@ SUFFIXES += .so
 		-Wl,--soname,$$soname,-z,-defs
 	if readelf -d $@.tmp | fgrep -q TEXTREL; then exit 1; fi
 	mv $@.tmp $@
+\f
+# Build a JNI shared object from one or more archives and one or more
+# object files.  This lets frysk bundle up into a single somewhat
+# large shared object, all the native code it needs to drag around.
+# Over time it should become smaller.
+
+# A list of .a files that should be incorporated into the .so.
+JNI_ARCHIVE_LIST =
+
+# List of shared objects required by this code.  The link-loader will
+# automatically pull these in as part of the build.
+JNI_LIBRARY_LIST =
+
+# A list of extra object files that should be added to the .so.
+JNI_OBJECT_LIST =
+
+%-jni.so: %-jni.a
+	soname=`basename $@` ; \
+	$(CC) -shared -o $@.tmp \
+		-Wl,--whole-archive \
+		-Wl,$< \
+		$(JNI_ARCHIVE_LIST:%=-Wl,%) \
+		-Wl,--no-whole-archive \
+		-Wl,--soname,$$soname,-z,-defs \
+		$(JNI_OBJECT_LIST) \
+		$(JNI_LIBRARY_LIST)
+	if readelf -d $@.tmp | fgrep TEXTREL; then exit 1; fi
+	mv $@.tmp $@
+
 
 # Clueless automake: Use a phony DATA entry to convince AUTOMAKE that
 # it really should install a .so file into LIBDIR.  The obvious
diff --git a/frysk-sys/ChangeLog b/frysk-sys/ChangeLog
index 52b6d1c..c482e0e 100644
--- a/frysk-sys/ChangeLog
+++ b/frysk-sys/ChangeLog
@@ -1,3 +1,9 @@
+2008-06-19  Andrew Cagney  <cagney@redhat.com>
+
+	* Makefile.am (JNI_LIBRARY_LIST): Define.
+	(JNI_ARCHIVE_LIST): Define.
+	(JNI_OBJECT_LIST): Define.
+
 2008-05-27  Andrew Cagney  <cagney@redhat.com>
 
 	* Makefile.am (JniRunner.java): Delete.
diff --git a/frysk-sys/Makefile.am b/frysk-sys/Makefile.am
index 24032eb..79ef060 100644
--- a/frysk-sys/Makefile.am
+++ b/frysk-sys/Makefile.am
@@ -71,6 +71,21 @@ lib/unwind/cni/Unwind%.cxx: lib/unwind/Unwind%.java lib/unwind/cni/UnwindH.hxx
 lib/unwind/Unwind%.java: lib/unwind/Unwind.java
 
 \f
+# Depend on these runtimes.
+JNI_LIBRARY_LIST += -lstdc++
+JNI_LIBRARY_LIST += -laudit
+# Bundle in the local elfutils code.
+JNI_ARCHIVE_LIST += ../frysk-imports/elfutils/libasm/libasm_pic.a
+JNI_ARCHIVE_LIST += ../frysk-imports/elfutils/libdwfl/libdwfl_pic.a
+JNI_ARCHIVE_LIST += ../frysk-imports/elfutils/libdw/libdw_pic.a
+JNI_ARCHIVE_LIST += ../frysk-imports/elfutils/libelf/libelf_pic.a
+JNI_ARCHIVE_LIST += ../frysk-imports/elfutils/libebl/libebl.a
+# Bundle in the local libunwind code.
+JNI_OBJECT_LIST += ../frysk-imports/libunwind-i386/src/{,dwarf/,mi/,x86/}.libs/*.o
+JNI_OBJECT_LIST += ../frysk-imports/libunwind-x86_64/src/{,dwarf/,mi/,x86_64/}.libs/*.o
+JNI_OBJECT_LIST += ../frysk-imports/libunwind-ppc32/src/{,dwarf/,mi/,ppc32/}.libs/*.o
+JNI_OBJECT_LIST += ../frysk-imports/libunwind-ppc64/src/{,dwarf/,mi/,ppc64/}.libs/*.o
+\f
 # jnixx's auto-detect algorithm misses hidden class references,
 # explicitly add them here.
 JNIXX_CLASSES += frysk.sys.ProcessIdentifierFactory


hooks/post-receive
--
frysk system monitor/debugger


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-06-19 12:55 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-06-19 12:55 [SCM] master: Build a singular .so cagney

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