JDK-6463272 : GCC 4 java_md.c compile-time error: "PIC register ���%ebx��� clobbered in ���asm���"
  • Type: Bug
  • Component: tools
  • Sub-Component: launcher
  • Affected Version: 6
  • Priority: P3
  • Status: Closed
  • Resolution: Fixed
  • OS: linux
  • CPU: generic
  • Submitted: 2006-08-23
  • Updated: 2011-05-17
  • Resolved: 2011-05-17
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 6 JDK 7
6u2Fixed 7 b04Fixed
Description
GCC 4 compile-time error: "PIC register ���%ebx��� clobbered in ���asm���" in file
   j2se/src/solaris/bin/java_md.c, line 1119.
To fix it, comment out ""%ebx"," in line 1140. Not sure this is the right fix, needs investigation.
See http://blogs.sun.com/roller/page/navi?entry=try_this_at_home_building for details.

Comments
EVALUATION Seems like an important fix to get into place 9allowing GCC4 and Debian builds to succeed), this change is being reviewed.
24-08-2006

SUGGESTED FIX ######### File: ./java_md.c ######### (cd . && sccs diffs -w -s -b java_md.c) ------- java_md.c ------- 1140c1140 < "%eax", "%ebx", "%ecx", "%edx" --- > "%eax", "%ecx", "%edx"
24-08-2006

SUGGESTED FIX Kelly's suggested fix is to remove ebx from the clobbers section. This is fine since ebx is manually protected by storing it before calling cpuid and restoring it afterwards. Notice that there may be a bug in the code just above the affected code in the 64 bit case. However, I'm not sure if ebx/rbx is reserved in this case or if gcc will automatically save the contents of the registion (which it doesn't in the 32 bit case).
24-08-2006