-KPIC is obsolete in Sun Studio 12 SPARC

RESOLVED FIXED in mozilla1.9.2a1

Status

defect
RESOLVED FIXED
11 years ago
Last year

People

(Reporter: ginnchen+exoracle, Assigned: ginnchen+exoracle)

Tracking

({fixed1.9.1})

Trunk
mozilla1.9.2a1
x86
OpenSolaris
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [fixed1.9.1b99])

Attachments

(3 attachments, 2 obsolete attachments)

See http://docs.sun.com/source/820-4180/man1/CC.1.html

We should use -xcode=pic32 instead.
I'm working on it.
Also I'd like to change to the compiler version check to Sun Studio 12, as some code is known as not working with Sun Studio 11.

I'm testing my patch now.
I'll post it tomorrow.
Assignee: nobody → ginn.chen
Status: NEW → ASSIGNED
Posted patch patch (obsolete) — Splinter Review
1) Use -xcode=pic32 instead of -KPIC for Sun Compiler on Solaris/SPARC.
2) Remove the workaround for -xbuiltin option, the patch of Sun Compiler went public on June 2008.
I didn't find an easy way to test whether the compiler is patched.
But I believe most Sun Studio users have updated their compilers, so it's not really needed.
3) Update the compiler requirement to Sun Studio 12 because nanojit uses some new features of Sun Studio 12.
Attachment #360255 - Flags: review?(jim)
Attachment #360255 - Flags: review?(jim) → review+
Comment on attachment 360255 [details] [diff] [review]
patch

This looks good.

Would it be possible to set SUNSTUDIO_CC and SUNSTUDIO_CXX variables, somewhere around line 400-430, where we set GNU_CC, GNU_CXX, INTEL_CC, and INTEL_CXX, and then test that instead of all these

  if test "$CPU_ARCH" = "sparc" && test "$OS_ARCH" = "SunOS"; then

all over?  Then, the first hunk, substituting -xcode=pic32 for -KPIC, could become its own independent 'elif' clause, a sibling to the 'if test "$GNU_CC"' clause, concerned only with getting the flags right for Sun Studio.  You'd need to duplicate a little code, but I think it would be much easier to determine when a given flag was appropriate, because you'd only be concerned with one compiler at a time.

The 'if test -z "$GNU_CC"' clause in the second hunk could become 'if test "$SUNSTUDIO_CC"'.
Posted patch patch v2 (obsolete) — Splinter Review
Attachment #360255 - Attachment is obsolete: true
Attachment #360484 - Flags: review?(jim)
Do people use GNU ld with Sun Studio?
Comment on attachment 360484 [details] [diff] [review]
patch v2

This looks great.

My only thought was that it seems more robust to decide whether we're using Sun Studio by the same kinds of tests we use to recognize Intel CC:

   if test "`$CC -help 2>&1 | grep -c 'Intel(R) C Compiler'`" != "0"; then
     INTEL_CC=1
   fi
Attachment #360484 - Flags: review?(jim) → review+
(In reply to comment #5)
> Do people use GNU ld with Sun Studio?

I think most people use /usr/ccs/bin/ld with either Sun Studio or gcc on Solaris.
But we can leave it here, in case someone want to use GNU ld.
grep 'Sun C ' / 'Sun C++ '
Attachment #360484 - Attachment is obsolete: true
Attachment #360652 - Flags: review?(jim)
Attachment #360652 - Flags: review?(jim) → review+
http://hg.mozilla.org/mozilla-central/rev/0ebeefbbdac0
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
The version line of Sun Studio Express compiler (PreRelease of next version of Sun Studio) has its codename between "Sun" and "C "/"C++ ".

So use regexp to test it.
Attachment #362540 - Flags: review?(jim)
Attachment #362540 - Flags: review?(jim) → review+
Fix for Sun Studio Express:
http://hg.mozilla.org/mozilla-central/rev/09c2d14ec324
What about 1.9.1?
Target Milestone: --- → mozilla1.9.2a1
It's not must to have but better to have.
The fix should only affects Solaris platform with Sun Studio compiler.
Attachment #375012 - Flags: approval1.9.1?
Comment on attachment 375012 [details] [diff] [review]
patch for 1.9.1 branch (combined fix for Bug 475393 and Bug 488260)
[Checkin: Comment 15]

a191=beltzner
Attachment #375012 - Flags: approval1.9.1? → approval1.9.1+
Comment on attachment 375012 [details] [diff] [review]
patch for 1.9.1 branch (combined fix for Bug 475393 and Bug 488260)
[Checkin: Comment 15]


http://hg.mozilla.org/releases/mozilla-1.9.1/rev/7dc4d4af1ee0
Attachment #375012 - Attachment description: patch for 1.9.1 branch (combined fix for Bug 475393 and Bug 488260) → patch for 1.9.1 branch (combined fix for Bug 475393 and Bug 488260) [Checkin: Comment 15]
Attachment #362540 - Attachment description: fix for Sun Studio Express → fix for Sun Studio Express [Checkin: Comment 11]
Attachment #360652 - Attachment description: patch v3 → patch v3 [Checkin: Comment 9]
Flags: in-testsuite-
Keywords: fixed1.9.1
Whiteboard: [fixed1.9.1b5]
Whiteboard: [fixed1.9.1b5] → [fixed1.9.1b99]
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.