gen-classlist.sh.in: canonicalize pathnames in lib/classes
Andrew Haley
aph@redhat.com
Wed Jan 31 16:58:00 GMT 2007
The new gcj RPM we've made for Fedora 7 has broken debuginfo, with
many source files missing. It turns out that the reason for this is
rather complicated, but it all ends up with the file
builddir/libgcj/classpath/lib/classes containing stuff like
../../../../../libjava/classpath/org/omg/PortableServer/POAPackage/NoServantHelper.java
Now, what directory is this "../" path relative to, you might ask? :-)
The trouble is that these source file name then go into the debug
information in the object files, and rpmbuild then tries to extract
the source files from the source tree to put them into the debug RPM
and, as you might expect, gets *horribly* confused.
gdb, of course, can't find the source files either.
This patch rewrites filenames in lib/classes that start with "../" to
start with "${abs_top_builddir}/". This ensures that the debug info
in gcc-generated libraries points to the place where the source files
actually are, then rpmbuild can find the sourcefiles, and we can debug
an installed libgcj with gdb. Much better...
This patch should be perfectly okay for vanilla Classpath too, but it
isn't necessary there. I hope Classpath people won't mind it.
Andrew.
2007-01-31 Andrew Haley <aph@redhat.com>
* lib/gen-classlist.sh.in: Convert relative pathnames to absolute
pathnames in lib/classes.
Index: gen-classlist.sh.in
===================================================================
--- gen-classlist.sh.in (revision 121108)
+++ gen-classlist.sh.in (working copy)
@@ -117,6 +117,7 @@
cp ${top_builddir}/lib/classes.1 ${top_builddir}/lib/classes.2
# Strip the package part.
sed -e 's/^[^ ]* //' -e 's, ,/,' < ${top_builddir}/lib/classes.1 \
+ -e "s|^\.\./|${abs_top_builddir}/|" \
> ${top_builddir}/lib/classes
echo "JAVA_SRCS = \\" > ${top_builddir}/lib/java.dep
for i in `cat ${top_builddir}/lib/classes` ; do
More information about the Java-patches
mailing list