<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "http://bugs.gentoo.org/bugzilla.dtd">

<bugzilla version="2.22.7"
          urlbase="http://bugs.gentoo.org/"
          maintainer="bugzilla@gentoo.org"
>

    <bug>
          <bug_id>220779</bug_id>
          
          <creation_ts>2008-05-07 16:08 0000</creation_ts>
          <short_desc>GCC 4.3 builds non-working gcj</short_desc>
          <delta_ts>2008-10-04 21:14:48 0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>Gentoo Linux</product>
          <component>Ebuilds</component>
          <version>unspecified</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          
          <priority>P2</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <votes>20</votes>
          <everconfirmed>1</everconfirmed>
          <reporter>vorfeed.canal@gmail.com</reporter>
          <assigned_to>toolchain@gentoo.org</assigned_to>
          <cc>aja@clanarmstrong.com</cc>
    
    <cc>alex@ghisoli.ch</cc>
    
    <cc>Andreas.Klauer@metamorpher.de</cc>
    
    <cc>ceki@qos.ch</cc>
    
    <cc>chewi@aura-online.co.uk</cc>
    
    <cc>cmue81@gmx.de</cc>
    
    <cc>eric225125@yahoo.com</cc>
    
    <cc>gentoo-tigerp@tigerp.net</cc>
    
    <cc>hetfield666@gmail.com</cc>
    
    <cc>j.romildo@gmail.com</cc>
    
    <cc>jarausch@igpm.rwth-aachen.de</cc>
    
    <cc>java@gentoo.org</cc>
    
    <cc>Roguelazer@gmail.com</cc>
    
    <cc>theli@ukr.net</cc>
    
    <cc>virkony@gmail.com</cc>

      

      
          <long_desc isprivate="0">
            <who>vorfeed.canal@gmail.com</who>
            <bug_when>2008-05-07 16:08:49 0000</bug_when>
            <thetext>Upstream explanation is here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32712

Basically you need to either put ftp://sourceware.org/pub/java/ecj-latest.jar as ecg.jar in /var/tmp/portage/sys-devel/gcc-4.3.0/work/gcc-4.3.0 before calling GCC 4.3&apos;s configure or use --with-ecj-jar=filename option...

In this case GCC 4.3 will create useful /usr/libexec/gcc/i686-pc-linux-gnu/4.3.0/ecj1 and GCJ will work. If ecj.jar is not found at compilation time then it&apos;s up to user to provide ecj1 in $PATH...</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nisselarsson@home.se</who>
            <bug_when>2008-05-28 19:18:51 0000</bug_when>
            <thetext>(In reply to comment #0)
&gt; Upstream explanation is here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32712
&gt; 
&gt; Basically you need to either put ftp://sourceware.org/pub/java/ecj-latest.jar
&gt; as ecg.jar in /var/tmp/portage/sys-devel/gcc-4.3.0/work/gcc-4.3.0 before
&gt; calling GCC 4.3&apos;s configure or use --with-ecj-jar=filename option...
&gt; 
&gt; In this case GCC 4.3 will create useful
&gt; /usr/libexec/gcc/i686-pc-linux-gnu/4.3.0/ecj1 and GCJ will work. If ecj.jar is
&gt; not found at compilation time then it&apos;s up to user to provide ecj1 in $PATH...
&gt; 

Adding
cd ${WORKDIR}/${P}/contrib &amp;&amp; ./download_ecj
last in src_unpack() and adding net-ftp/ftp as a dep. to gcj fixes this( I think, still compiling... ). I imagine there&apos;s a better way then the download_ecj and the ftp dep. it requires, but it&apos;s the GCC way of doing it.
Maybe, 
wget ftp://sourceware.org/pub/java/ecj-latest.jar -O ${WORKDIR}/${P}/contrib/ecj.jar
is nicer. I&apos;m new to all this :)

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>nisselarsson@home.se</who>
            <bug_when>2008-05-28 19:27:52 0000</bug_when>
            <thetext>Oops, ecj.jar should go in top-dir. So, (with ftp)
cd ${WORKDIR}/${P} &amp;&amp; ./contrib/download_ecj
or
wget ftp://sourceware.org/pub/java/ecj-latest.jar -O ${WORKDIR}/${P}/ecj.jar
</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vorfeed.canal@gmail.com</who>
            <bug_when>2008-05-29 22:33:19 0000</bug_when>
            <thetext>Yes, this hack will work (I did something similar), but it&apos;s not a good long-term solution. What happens if later ftp://sourceware.org/pub/java/ecj-latest.jar will be changed and will only work with gcc 4.10 or something like this? It&apos;s create a mess. To fix it properly this file should be mirrored somewhere (probably on Gentoo mirrors) under sane name (something like ecj-20070727.jar), then it should be downloaded as normal file and put in proper place at src_unpack stage.

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-06-22 15:05:50 0000</bug_when>
            <thetext>*** Bug 225605 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>vapier@gentoo.org</who>
            <bug_when>2008-06-22 15:21:19 0000</bug_when>
            <thetext>maintaining any java stuff in gcc is undesirable

java team: can you update dev-java/eclipse-ecj so as to provide an `ecj1` symlink ?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ceki@qos.ch</who>
            <bug_when>2008-06-28 12:02:42 0000</bug_when>
            <thetext>I stumbled upon this report while tyring to build &quot;pdftk&quot;.

Following the suggestions found here, I have installed
dev-java/eclipse-ecj and created a symlink from /usr/bin/ecj1 to
/usr/bin/ecj-3.3. However, I have not rebuilt gcc because it takes
&quot;forever&quot;.

Building the&quot; pdftk&quot; fails with

&gt;&gt;&gt; Compiling source in /var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/pdftk ...
make -C ../java_libs
make[1]: Entering directory `/var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/java_libs&apos;
make -C &quot;/var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/java_libs/gnu_local/java/security&quot;;
make[2]: Entering directory `/var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/java_libs/gnu_local/java/security&apos;
gcj -march=k8 -O2 -pipe --encoding=UTF-8 --classpath=&quot;/var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/java_libs&quot; -c Engine.java -o E
ngine.o
/usr/lib64/portage/pym/portage_dep.py:39: DeprecationWarning: DEPRECATION NOTICE: The portage_dep module was replaced by portage.dep
Unrecognized option : -fbootclasspath=/var/tmp/portage/app-text/pdftk-1.41/work/pdftk-1.41/java_libs/:/usr/share/gcc-data/x86_64-pc-linux
-gnu/4.3.1/java/libgcj-4.3.1.jar

Should I rebuild gcc?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>ceki@qos.ch</who>
            <bug_when>2008-06-28 15:18:26 0000</bug_when>
            <thetext>Given my time constraints, and the fact that the problem has been
introduced with gcc version 4.3, I circumvented this problem by
reverting to the earlier version of gcc installed on my system, namely
version 3.4.4.

Unfortunately, this version of gcc was hard masked so I could not
emerge gcc version 3.4.4.. The solution was to find an unmasked
version earlier than version 4.3 but later than version 3.4.4.

Here is how I did it:

&gt; emerge -pv &apos;&lt;sys-devel/gcc-4&apos;
[ebuild   R   ] sys-devel/gcc-3.4.6-r2  USE=&quot;fortran gcj nls (-altivec) -bootstrap -boundschecking -build -d -doc -gtk (-hardened) -ip28 -ip32r10k -libffi (-multilib) -multislot (-n32) (-n64) -nocxx -nopie -nossp -objc -test -vanilla&quot; 0 kB

&gt; USE=&quot;gcj&quot; emerge &apos;=sys-devel/gcc-3.4.6-r2&apos;

I also followed the directions for upgrading GCC [1].

HTH,

[1] http://www.gentoo.org/doc/en/gcc-upgrading.xml

</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>a_gel@web.de</who>
            <bug_when>2008-06-30 15:51:13 0000</bug_when>
            <thetext>I have maked it work.

1. emerge eclips-ecj
2. sudo vim /usr/bin/ecj1
 and where change
gjl_main=&quot;org.eclipse.jdt.internal.compiler.batch.Main&quot;
to
gjl_main=&quot;org.eclipse.jdt.internal.compiler.batch.GCCMain&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>a_gel@web.de</who>
            <bug_when>2008-06-30 15:58:46 0000</bug_when>
            <thetext>Know someone from where ecj1 come from?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-07-01 19:12:18 0000</bug_when>
            <thetext>contrib/download_ecj is the acknowledged way of fulfilling this dependency by upstream.  Hence others will depend on it so the jar file is hardly going to move.  But if you think it&apos;s a problem, then you should discuss it with them rather than complaining here.

As to &apos;maintaining any java stuff in gcc is undesirable&apos;, it&apos;s part of gcc so get over it.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-07-01 19:14:57 0000</bug_when>
            <thetext>Having an ecj1 symlink won&apos;t cut it completely, the build also needs to be supplied with a copy of ecj.jar.  By far the easiest way to do this is to patch gcc-4.3.1 to download ecj as upstream specifies.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-07-01 19:28:25 0000</bug_when>
            <thetext>I&apos;ve put the patched version in the java-overlay for now but this isn&apos;t a permanent solution.  Please fix gcc.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-07-01 19:51:27 0000</bug_when>
            <thetext>Tom Tromey has kindly made the ecj-latest.jar into a symlink which currently
points to ecj-4.3.jar.

ftp://sourceware.org/pub/java/

So now the Gentoo ebuild can rely on this version for 4.3</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chewi@aura-online.co.uk</who>
            <bug_when>2008-07-08 17:01:32 0000</bug_when>
            <thetext>I&apos;ve made the ebuild in java-overlay slightly less evil. No one likes using wget during src_unpack.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>Andreas.Klauer@metamorpher.de</who>
            <bug_when>2008-07-20 14:54:13 0000</bug_when>
            <thetext>I couldn&apos;t get this to work, not manually and not with the ebuilds from the java overlay. So I resorted to emerging gcc 4.2 in a separate slot (gcc-4.2 with gcj useflag, gcc-4.3 without), and symlinked gcj and gcjh to the 4.2 version. With this I can emerge &quot;pdftk&quot; again. Not sure if mixing gcc-4.2 and 4.3 like this is a good idea in general. Would love to see a proper fix for gcc-4.3.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chewi@aura-online.co.uk</who>
            <bug_when>2008-07-20 14:58:58 0000</bug_when>
            <thetext>What was the problem though?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-07-25 18:47:31 0000</bug_when>
            <thetext>The problem is the current build of gcj is unusable -- it can&apos;t compile anything.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chewi@aura-online.co.uk</who>
            <bug_when>2008-07-25 19:01:58 0000</bug_when>
            <thetext>No, I meant what was the problem that Andreas had with the ebuilds from the overlay?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>virkony@gmail.com</who>
            <bug_when>2008-08-02 19:53:57 0000</bug_when>
            <thetext>I&apos;m completely lost with this ecj1...

I have no /usr/bin/ecj1 and I&apos;m getting (dev-java/eclipse-ecj-3.4-r2):
&gt;&gt;&gt; Unpacking ecjsrc-3.4.zip to /var/tmp/portage/portage/dev-java/eclipse-ecj-3.4-r2/work
 * bootstrapping ecj with /usr/x86_64-pc-linux-gnu/gcc-bin/4.3.1/gcj -C ...
gcj: error trying to exec &apos;ecj1&apos;: execvp: Permission denied

for hello.java:
gcj: error trying to exec &apos;ecj1&apos;: execvp: No such file or directory

I have /usr/bin/ecj with &quot;...batch.Main&quot;, so when I create symlink for ecj1:
 * bootstrapping ecj with /usr/x86_64-pc-linux-gnu/gcc-bin/4.3.1/gcj -C ...
Unrecognized option : /var/tmp/portage/portage/dev-java/eclipse-ecj-3.4-r2/temp//ccnGH4Tajx

for hello.java:
invalid debug option: -g1

When I change gjl_main to &quot;...batch.GCCMain&quot;:
 * bootstrapping ecj with /usr/x86_64-pc-linux-gnu/gcc-bin/4.3.1/gcj -C ...
java.lang.ArrayIndexOutOfBoundsException: -1
        at org.eclipse.jdt.internal.compiler.parser.Parser.consumeFieldAccess(Parser.java:3492)
        at org.eclipse.jdt.internal.compiler.parser.Parser.consumeRule(Parser.java:5688)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9007)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9238)
        at org.eclipse.jdt.internal.compiler.parser.Parser.parse(Parser.java:9195)
        at org.eclipse.jdt.internal.compiler.parser.Parser.dietParse(Parser.java:7851)
        at org.eclipse.jdt.internal.compiler.Compiler.internalBeginToCompile(Compiler.java:587)
        at org.eclipse.jdt.internal.compiler.Compiler.beginToCompile(Compiler.java:357)
        at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:371)
        at org.eclipse.jdt.internal.compiler.batch.Main.performCompilation(Main.java:3410)
        at org.eclipse.jdt.internal.compiler.batch.Main.compile(Main.java:1607)
        at org.eclipse.jdt.internal.compiler.batch.GCCMain.compile(GCCMain.java:475)
        at org.eclipse.jdt.internal.compiler.batch.GCCMain.main(GCCMain.java:492)

for hello.java - nothing, and no hello executable or anything else.

Java VM: sun-jdk-1.6
ecj: ecj-3.3
gcc: 4.3.1-r1
COMPILERS=&quot;javac ecj-3.3 jikes&quot;</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>chewi@aura-online.co.uk</who>
            <bug_when>2008-08-02 21:19:11 0000</bug_when>
            <thetext>My ecj1 is at /usr/libexec/gcc/x86_64-pc-linux-gnu/4.3.1/ecj1, which is where it should be. You definitely used gcc from the overlay, right?</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>halcy0n@gentoo.org</who>
            <bug_when>2008-08-03 01:43:43 0000</bug_when>
            <thetext>This has been fixed in the tree.  Thanks all.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>gnu_andrew@member.fsf.org</who>
            <bug_when>2008-08-03 10:51:17 0000</bug_when>
            <thetext>Thanks for doing this.  Just for the record, ecj.jar was not removed, it&apos;s a new external dependency from gcc 4.3 onwards.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>jarausch@igpm.rwth-aachen.de</who>
            <bug_when>2008-09-02 12:35:47 0000</bug_when>
            <thetext>(In reply to comment #21)
&gt; This has been fixed in the tree.  Thanks all.
&gt; 

When or where is the new ebuild available? (not yet in the standard
emerge 2008/09/02)</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-09-15 12:06:11 0000</bug_when>
            <thetext>Please consider revbumping as we still get bug reports about this from people who didn&apos;t recompile gcc after the fix.</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>caster@gentoo.org</who>
            <bug_when>2008-09-15 12:06:36 0000</bug_when>
            <thetext>*** Bug 236398 has been marked as a duplicate of this bug. ***</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hetfield666@gmail.com</who>
            <bug_when>2008-09-21 11:18:07 0000</bug_when>
            <thetext>my gcc is still failing, needs a revdump? seems i&apos;m running the latest one</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>hetfield666@gmail.com</who>
            <bug_when>2008-10-01 17:07:16 0000</bug_when>
            <thetext>after re-emerging it works.
looks fixed in the portage tree</thetext>
          </long_desc>
          <long_desc isprivate="0">
            <who>halcy0n@gentoo.org</who>
            <bug_when>2008-10-04 21:14:48 0000</bug_when>
            <thetext>gcc 4.3.2 is now in the tree, so everyone will be getting that version now anyway.</thetext>
          </long_desc>
      
    </bug>

</bugzilla>