Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 344659 - dev-java/icedtea: add ~sparc keyword
Summary: dev-java/icedtea: add ~sparc keyword
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Keywording and Stabilization (show other bugs)
Hardware: All Linux
: High normal (vote)
Assignee: Java team
URL:
Whiteboard:
Keywords: KEYWORDREQ
: 344221 (view as bug list)
Depends on: 159780 344345 345319
Blocks: icedtea-tracker
  Show dependency tree
 
Reported: 2010-11-08 10:00 UTC by Alex Buell
Modified: 2015-08-21 07:28 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
icedtea-6.1.9.1-patch (icedtea-6.1.9.1-patch,460 bytes, patch)
2010-11-08 10:02 UTC, Alex Buell
Details | Diff
patch (icedtea-sparc.patch,390 bytes, patch)
2010-11-29 19:06 UTC, Vlastimil Babka (Caster) (RETIRED)
Details | Diff
patch the ebuild with this patch (icedtea-6.1.9.2.ebuild.patch,543 bytes, patch)
2010-11-29 19:08 UTC, Vlastimil Babka (Caster) (RETIRED)
Details | Diff
OpenJDK 6 patch that fixes compilation error (openjdk-6-sparc.patch,613 bytes, patch)
2010-11-29 20:19 UTC, Alex Buell
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Buell 2010-11-08 10:00:43 UTC
openjdk/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp has an error on line 38 that stops the build. 

Attached with this e-mail is a patch that needs to be applied when building on SPARC platforms.
Comment 1 Alex Buell 2010-11-08 10:02:17 UTC
Created attachment 253605 [details, diff]
icedtea-6.1.9.1-patch
Comment 2 Serkan Kaba (RETIRED) gentoo-dev 2010-11-09 11:58:14 UTC
The best is to send this to icedtea upstream.

@Andrew: Would like to have this patch incorporated?
Comment 3 Alex Buell 2010-11-22 12:08:32 UTC
Has this progressed any further? I tried to patch this using an adapted icedtea ebuild but discovered the build process actually unpacks the openjdk tarball and patches it with its own patches. I think that this patch needs to go into their set of patches so it can build on SPARC. I can't emerge this package without it failing without this vital patch. 

Is there some other way I can patch openjdk without having to go through upstream?
Comment 4 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-26 23:05:56 UTC
Any difference with dev-java/icedtea-6.1.9.2 ? Then we could finally keyword it.

The correct bootstrap order using should be (to avoid unfortunate circular dependencies):
enable gcj flag for sys-devel/gcc
emerge -1 dev-java/gcj-jdk =virtual/jdk-1.5
emerge --onlydeps icedtea
emerge icedtea

A few dev-java packages will have to get ~sparc keyword in the process.
Can anyone from sparc team try it?
Comment 5 Alex Buell 2010-11-26 23:14:10 UTC
I'll try it - this was my bug report :) 
Comment 6 Michael Weber (RETIRED) gentoo-dev 2010-11-27 02:11:44 UTC
done dev-java/java-config-wrapper-0.16
done dev-java/java-config-2.1.11 (but not -r1 -r2)

i have problems with 
dev-java/ecj-gcj-3.5.2-r2 doesn't build
app-admin/eselect-ecj-0.6 (RDEPEND.bad dev-java/ecj-gcj)
Comment 7 Alex Buell 2010-11-27 08:24:32 UTC
(In reply to comment #6)

> dev-java/ecj-gcj-3.5.2-r2 doesn't build

Yeah, the bootstrap generates a lot of warnings, presumably because gcj is thinking it is 1.4 not 1.5/1.6. Have you failed a bug report about it?
Comment 8 Alex Buell 2010-11-27 08:44:42 UTC
I just succeeded in getting ecj-gcj installed. But there appears to be problems with running my test collection of java programs, mostly to do with not being able to find the AWT toolkit. Running simple console only java programs appears to work. 

Need to find out why it's not able to find the AWT toolkit, and it should work. 
Comment 9 Alex Buell 2010-11-27 08:49:47 UTC
I just figured it out - ecj-gcj is only a subset of the ecj compiler, it's just a bootstrap to allow it to build icedtea. Testing with icedtea-6.1.9.2 now.
Comment 10 Alex Buell 2010-11-27 08:49:53 UTC
I just figured it out - ecj-gcj is only a subset of the ecj compiler, it's just a bootstrap to allow it to build icedtea. Testing with icedtea-6.1.9.2 now.
Comment 11 Alex Buell 2010-11-27 12:44:18 UTC
Sadly, upstream has still not patched the error:

/var/tmp/portage/dev-java/icedtea-6.1.9.2/work/icedtea6-1.9.2/openjdk-ecj/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp: In function 'bool detect_niagara()':
/var/tmp/portage/dev-java/icedtea-6.1.9.2/work/icedtea6-1.9.2/openjdk-ecj/hotspot/src/os_cpu/linux_sparc/vm/vm_version_linux_sparc.cpp:38: error: format '%100[^
' expects type 'char*', but argument 3 has type 'char (*)[128]'


Of course, if I edit the offending line of code and carry on with the build, it should work as expected, upstream really needs prodding to add the fix.
Comment 12 Alex Buell 2010-11-27 13:15:14 UTC
I've finally sent the one-liner patch to joe.darcy at Oracle to get it into the OpenJDK for the next release. Hopefully that should sort it out. 
Comment 13 Alex Buell 2010-11-27 15:52:13 UTC
On first build, had to add the one-line patch, then re-run with FEATURE="keepwork", finally got it installed. 

Tested with Vuze and some of my GUI java classes, appears to work well. 

I can confirm that using gcj and ecj-jdk will bootstrap this build, really needs the one-liner patch to go in. 
Comment 14 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-29 17:57:20 UTC
(In reply to comment #11)
> Sadly, upstream has still not patched the error:
> Of course, if I edit the offending line of code and carry on with the build, it
> should work as expected, upstream really needs prodding to add the fix.

I just wonder how such error could go unnoticed until now ? 

(In reply to comment #13)
> I can confirm that using gcj and ecj-jdk will bootstrap this build, really
> needs the one-liner patch to go in. 

To be sure, to build with gcj-jdk, there must be no version of icedtea6 or icedtea6-bin already installed, otherwise those will be used. The build should echo an einfo about what is used before unpacking. To avoid uninstalling icedtea6/bin just to test it, one can use the override variable: JAVA_PKG_FORCE_VM=gcj-jdk emerge ...

Comment 15 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-29 19:06:46 UTC
Created attachment 255861 [details, diff]
patch

saves as files/icedtea-sparc.patch
Comment 16 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-29 19:08:18 UTC
Created attachment 255863 [details, diff]
patch the ebuild with this patch

Can you test that this (together with previous) attachment works?
Comment 17 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-29 19:09:08 UTC
Also mailing oracle people probably won't help as the code that needs to be fixed is added by an icedtea patch. So we need to fix it in icedtea, not openjdk.
Andrew: can you check?
Comment 18 Andrew John Hughes 2010-11-29 19:48:33 UTC
Alex, sorry I've only just seen this issue.  

The patch you're patching (patches/icedtea-sparc.patch) hasn't been applied for a long time.  It should have been removed.  So I don't see why changing it has any affect whatsoever.

Can you post something that's actually against the OpenJDK tree?
Comment 19 Alex Buell 2010-11-29 19:58:07 UTC
Andrew, 

That patch I gave needs to be applied against the OpenJDK tree, it can't be patched with our ebuild as the Icedtea framework unpacks OpenJDK sources and does the patching itself. That was why I was hoping to get it fixed upstream. 
Comment 20 Alex Buell 2010-11-29 19:59:31 UTC
I'll personally unpack the OpenJDK sources and generate a patch. It's pretty easy to do, so I will get this sorted now.
Comment 21 Alex Buell 2010-11-29 20:19:09 UTC
Created attachment 255873 [details, diff]
OpenJDK 6 patch that fixes compilation error

This patch was generated against the OpenJDK tree itself.
Comment 22 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-11-29 21:04:38 UTC
(In reply to comment #18)
> The patch you're patching (patches/icedtea-sparc.patch) hasn't been applied for
> a long time.  It should have been removed.  So I don't see why changing it has
> any affect whatsoever.

Sorry that was my fault.
Comment 23 Andrew John Hughes 2010-12-02 18:32:21 UTC
Intuitively, this patch seems odd to me as &cpu should be the same as &cpu[0] if my knowledge of C and C++ serves me correctly.

I went to check this:

$ cat test.cpp 
#include <cstdio>

int main()
{
  char cpu[128];

  printf("%p, %p\n", &cpu, &cpu[0]);
  return 0;
}

On sparc32:

$ g++ -g -Wall -o testapp test.cpp 
$ ./testapp 
0xffcd7984, 0xffcd7984
$ file testapp 
testapp: ELF 32-bit MSB executable, SPARC32PLUS, V8+ Required, version 1 (SYSV), for GNU/Linux 2.6.8, dynamically linked (uses shared libs), not stripped

and sparc64:

$ g++ -g -Wall -o testapp2 test.cpp 
$ ./testapp2
0x7feff9393f0, 0x7feff9393f0
$ file testapp2
testapp2: ELF 64-bit MSB executable, SPARC V9, relaxed memory ordering, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped

So I'm baffled by your patch.  What failure occurs without it?
Comment 24 Alex Buell 2010-12-02 19:12:22 UTC
I refer you to comment #11, that shows the error that the patch fixes.
Comment 25 Andrew John Hughes 2010-12-02 19:30:07 UTC
That still doesn't explain why this fixes it to me.

Without this patch, IcedTea6 has been built on sparc for Fedora, Debian and Ubuntu.  What is different in your case?
Comment 26 Alex Buell 2010-12-02 19:53:09 UTC
I think it might be down to the stricter QA controls in the ebuild. I think that problem normally results in a warning but this time it got flagged as an error which can stop the build. Misuse of -Werror maybe? It would explain why it builds OK on other distributions, perhaps? 
Comment 27 Andrew John Hughes 2010-12-02 21:09:03 UTC
Hmmm... -Werror is present upstream so everyone gets that.

I'm tending towards putting it in, because it won't hurt anything (the two being the same thing).  I would like to understand why this is an issue though.

Which gcc are you using? Maybe it is older than on most distros.
Comment 28 Alex Buell 2010-12-02 21:50:54 UTC
Using GCC 4.4.4, this is a stable SPARC gentoo box. 
Comment 29 Andrew John Hughes 2010-12-08 20:44:35 UTC
I added the patch to 1.9.3 in the overlay.  Let me know if you need it applied to any other versions.

Still not sure about adding it upstream unless I can replicate the issue.
Comment 30 Alex Buell 2010-12-09 02:18:30 UTC
I'm happy to say that the latest icedtea 6.1.9.3 from the java overlay was successfully built on SPARC, using GNU gcj and ecj-gcj 3.5.2-r2. I'd particularly like to see this ebuild go into the portage tree soon for testing and perhaps going unstable. I have tested the JVM with some java programs that I wrote years ago and they seem to work. Does the icedtea ebuild provides a way to run tests on it? 

I intend to unmask the netbeans ebuilds and test it with icedtea tomorrow morning. 

At some point in the future I would like to get 64bit up and running - I am running a multilibbed profile on SPARC (like AMD64)
Comment 31 Alex Buell 2010-12-09 17:19:44 UTC
I can confirm that NetBeans 6.8-r1 and its ~114 dependencies, once unmasked, ran flawlessly. Testing with my old NetBean projects but all seems well. 
Comment 32 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2010-12-12 11:40:11 UTC
The patch was added to main tree. Now the sparc arch team can test and add keywords. Please see the bootstrap instructions in comment 4.

If there is a problem with ecj-gcj (comment 6) we need more info.
Comment 33 Alex Buell 2010-12-14 02:12:00 UTC
First I unmerged and rebuilt icedtea6-1.9.3 from the main tree, seems to build OK and installed correctly. Should be OK for testing. 
Comment 34 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2011-01-21 00:19:29 UTC
*** Bug 344221 has been marked as a duplicate of this bug. ***
Comment 35 Vlastimil Babka (Caster) (RETIRED) gentoo-dev 2011-02-14 10:49:16 UTC
(In reply to comment #6)
> done dev-java/java-config-wrapper-0.16
> done dev-java/java-config-2.1.11 (but not -r1 -r2)

Why not the latest? This is not sustainable.

> i have problems with 
> dev-java/ecj-gcj-3.5.2-r2 doesn't build

Still waiting for some logs/info 

Comment 36 Andrew John Hughes 2011-02-15 23:04:51 UTC
This is upstreamed in 1.9.7: http://blog.fuseyism.com/index.php/2011/02/15/security-icedtea6-1710-187-and-197-released/
Comment 37 Alex Buell 2011-02-21 17:20:44 UTC
Confirmed, 6.1.9.7 builds just fine. 
Comment 38 EoD 2011-08-08 22:13:16 UTC
I can confirm that icedtea 6.1.9.9 builds just fine with GCC 4.4.5 on my sparc box.

I can't build icedtea 6.1.10* (with and without hs20) with GCC 4.4.5. But I can build icedtea 6.1.10.3 without hs20 (it fails with hs20) with icedtea 6.1.9.9.

I can provide build logs for all the mentioned cases.
Comment 39 Ralph Sennhauser (RETIRED) gentoo-dev 2012-06-05 15:59:42 UTC
It's time to give keywording icedtea:7 for sparc a try. Please test and add dependencies to this bug. Thanks.
Comment 40 Raúl Porcel (RETIRED) gentoo-dev 2012-07-29 17:02:51 UTC
Reopen if you're still interested...i'm not interested in java
Comment 41 Patrice Clement gentoo-dev 2015-08-21 07:28:57 UTC
Marking this bug as FIXED.