Summary: | sys-devel/gcc-4.6: 01_all_joined-cpp-defs.patch patch builds an unusable gcj | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Justin Lecher (RETIRED) <jlec> |
Component: | [OLD] Core system | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ag, cruzki123, java, jeanfrancis, printing, xavier.fim |
Priority: | High | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=361783 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | 361783 | ||
Bug Blocks: | 346809 | ||
Attachments: |
/var/log/portage/build/app-text/pdftk-1.44:20110421-074650.log
new fortify default patch gcc-4.6.1-jvgenmain.patch |
Description
Justin Lecher (RETIRED)
![]() Created attachment 270751 [details]
/var/log/portage/build/app-text/pdftk-1.44:20110421-074650.log
build.log
cpp -C -P com/lowagie/text/pdf/PdfEncryption.java.c com/lowagie/text/pdf/PdfEncryption.java gcj -Wall -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." -C com/lowagie/text/Anchor.java Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.internal.compiler.batch.GCCMain at gnu.java.lang.MainThread.run(libgcj.so.12) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at gnu.java.lang.MainThread.run(libgcj.so.12) make[1]: [com/lowagie/text/Anchor.class] Error 1 (ignored) gcjh -force --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." com/lowagie/text/Anchor Exception in thread "main" java.io.IOException: can't find class file com/lowagie/text/Anchor.class in java.net.URLClassLoader{urls=[file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/,file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/./,file:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.0/java/libgcj-4.6.0.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}} at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.12) at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.12) at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.12) make[1]: [com/lowagie/text/Anchor.h] Error 1 (ignored) xmw: err why did you add 4.5 to the summary? that works just fine here... faillog please! Confirm. Build failed with GCC-4.6.1 Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at gnu.java.lang.MainThread.run(libgcj.so.12) make[1]: [org/bouncycastle/asn1/IndefiniteLengthInputStream.class] Error 1 (ignored) gcjh -force --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." org/bouncycastle/asn1/IndefiniteLengthInputStream Exception in thread "main" java.io.IOException: can't find class file org/bouncycastle/asn1/IndefiniteLengthInputStream.class in java.net.URLClassLoader{urls=[file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/,file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/./,file:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/java/libgcj-4.6.1.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}} at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.12) at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.12) at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.12) make[1]: [org/bouncycastle/asn1/IndefiniteLengthInputStream.h] Error 1 (ignored) gcj -Wall -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." -C org/bouncycastle/asn1/BERFactory.java Exception in thread "main" java.lang.NoClassDefFoundError: org.eclipse.jdt.internal.compiler.batch.GCCMain at gnu.java.lang.MainThread.run(libgcj.so.12) Caused by: java.lang.ClassNotFoundException: org.eclipse.jdt.internal.compiler.batch.GCCMain not found in gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}} at java.net.URLClassLoader.findClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at java.lang.ClassLoader.loadClass(libgcj.so.12) at gnu.java.lang.MainThread.run(libgcj.so.12) make[1]: [org/bouncycastle/asn1/BERFactory.class] Error 1 (ignored) gcjh -force --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." org/bouncycastle/asn1/BERFactory Exception in thread "main" java.io.IOException: can't find class file org/bouncycastle/asn1/BERFactory.class in java.net.URLClassLoader{urls=[file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/,file:/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java/./,file:/usr/share/gcc-data/x86_64-pc-linux-gnu/4.6.1/java/libgcj-4.6.1.jar], parent=gnu.gcj.runtime.SystemClassLoader{urls=[file:./], parent=gnu.gcj.runtime.ExtensionClassLoader{urls=[], parent=null}}} at gnu.classpath.tools.javah.Main.getClass(libgcj-tools.so.12) at gnu.classpath.tools.javah.Main.run(libgcj-tools.so.12) at gnu.classpath.tools.javah.GcjhMain.main(libgcj-tools.so.12) make[1]: [org/bouncycastle/asn1/BERFactory.h] Error 1 (ignored) gjar -cf java_lib.jar com/lowagie/*/*/*/*.class com/lowagie/*/*/*.class com/lowagie/*/*.class org/bouncycastle/*/*.class org/bouncycastle/*/*/*.class com/lowagie/text/pdf/fonts/Helvetica-Oblique.afm com/lowagie/text/pdf/fonts/Courier.afm com/lowagie/text/pdf/fonts/Helvetica-BoldOblique.afm com/lowagie/text/pdf/fonts/Courier-Bold.afm com/lowagie/text/pdf/fonts/Times-Roman.afm com/lowagie/text/pdf/fonts/Times-Bold.afm com/lowagie/text/pdf/fonts/Courier-Oblique.afm com/lowagie/text/pdf/fonts/Symbol.afm com/lowagie/text/pdf/fonts/Courier-BoldOblique.afm com/lowagie/text/pdf/fonts/Helvetica.afm com/lowagie/text/pdf/fonts/Helvetica-Bold.afm com/lowagie/text/pdf/fonts/Times-Italic.afm com/lowagie/text/pdf/fonts/ZapfDingbats.afm com/lowagie/text/pdf/fonts/Times-BoldItalic.afm jar: internal error: java.io.FileNotFoundException: com/lowagie/*/*/*/*.class (No such file or directory) at gnu.java.nio.channels.FileChannelImpl.open(libgcj.so.12) at gnu.java.nio.channels.FileChannelImpl.<init>(libgcj.so.12) at gnu.java.nio.channels.FileChannelImpl.create(libgcj.so.12) at java.io.FileInputStream.<init>(libgcj.so.12) at gnu.classpath.tools.jar.Creator.writeFile(libgcj-tools.so.12) at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(libgcj-tools.so.12) at gnu.classpath.tools.jar.Creator.writeCommandLineEntries(libgcj-tools.so.12) at gnu.classpath.tools.jar.Creator.run(libgcj-tools.so.12) at gnu.classpath.tools.jar.Main.run(libgcj-tools.so.12) at gnu.classpath.tools.jar.Main.main(libgcj-tools.so.12) make[1]: [java_lib.o] Error 1 (ignored) gcj -Wall -fsource=1.3 -O2 --encoding=UTF-8 --classpath=":/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java:." -c java_lib.jar In file included from <built-in>:0:0: java_lib.jar:0:0: fatal error: bad zip/jar file java_lib.jar compilation terminated. make[1]: [java_lib.o] Error 1 (ignored) make[1]: Leaving directory `/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/java' make: *** No rule to make target `../java/java_lib.o', needed by `pdftk.o'. Stop. emake failed * ERROR: app-text/pdftk-1.44 failed (compile phase): * Compilation failed. * * Call stack: * ebuild.sh, line 56: Called src_compile * environment, line 2170: Called die * The specific snippet of code: * emake -j1 -f "${S}"/Makefile.Debian || die "Compilation failed." * * If you need support, post the output of 'emerge --info =app-text/pdftk-1.44', * the complete build log and the output of 'emerge -pqv =app-text/pdftk-1.44'. * The complete build log is located at '/var/tmp/portage/app-text/pdftk-1.44/temp/build.log'. * The ebuild environment file is located at '/var/tmp/portage/app-text/pdftk-1.44/temp/environment'. * S: '/var/tmp/portage/app-text/pdftk-1.44/work/pdftk-1.44-dist/pdftk' We tracked down the problem and found that 01_all_joined-cpp-defs.patch in 4.6 patchset to break option parsing in gcj (-Djava.class.path) Excluding this patch makes it work. Created attachment 287829 [details, diff]
new fortify default patch
Debian redid how they added fortify source to gcc-4.6. this should make the need for the cpp patch obsolete.
I'm not sure why this is broken. -Dfoo was a joined option in 4.5. The patch just makes it a joined option in 4.6 as well. (In reply to comment #7) > I'm not sure why this is broken. -Dfoo was a joined option in 4.5. The patch > just makes it a joined option in 4.6 as well. gcj needs it parsed as a seperate option. (i.e. -D java.class.path) It changes what is passed by gcc to jvgenmain, part of the gcj driver. Without the patch: 6073 execve("/mnt/builder/portage/portage/sys-devel/gcc-4.6.1-r1/work/build/./gcc/jvgenmain", ["/mnt/builder/portage/portage/sys"..., "-findirect-dispatch", "-D", "java.class.path=/usr/share/gcc-d"..., "org.eclipse.jdt.internal.compile"..., "/tmp/.private/root/ccnnn10S.i"], [/* 80 vars */] <unfinished ...> With: 30805 execve("/mnt/builder/portage/portage/sys-devel/gcc-4.6.1-r1/work/build/./gcc/jvgenmain", ["/mnt/builder/portage/portage/sys"..., "-findirect-dispatch", "-Djava.class.path=/usr/share/gcc"..., "org.eclipse.jdt.internal.compile"..., "/tmp/.private/root/ccN2x9zr.i"], [/* 80 vars */] <unfinished ...> jvgenmain expects -D to be separate from java.class.path and so fails to parse it correctly with the patch. This results in the property being -Djava.class.path instead of java.class.path in the code outputted by jvgenmain, and so Java programs have no classpath at runtime. Created attachment 288419 [details, diff]
gcc-4.6.1-jvgenmain.patch
Thanks for the explanation. Can someone give this patch a try? (just throw it into /etc/portage/patches/sys-devel/gcc)
(In reply to comment #10) > Created attachment 288419 [details, diff] > gcc-4.6.1-jvgenmain.patch > > Thanks for the explanation. Can someone give this patch a try? (just throw it > into /etc/portage/patches/sys-devel/gcc) Why do we patch gcc and tehn pacth jvmgenmain to fix what the patch caused. And mike added an alternative patch for the former. That patch only covers -D_FORTIFY_SOURCE. We need to match preprocessor flags using spec rules in other situations too. For example, hardened relies on it. Let me know if the patch works. We'll decide how to proceed in bug #361783. (In reply to comment #12) > Let me know if the patch works. We'll decide how to proceed in bug #361783. It works. Fixed in 4.6.2. |