Last Comment Bug 323997 - TARGET_XPCOM_ABI not set in AIX builds
: TARGET_XPCOM_ABI not set in AIX builds
Status: VERIFIED FIXED
[nvn-dl]
: fixed1.8.0.2, fixed1.8.1
Product: Core
Classification: Components
Component: Build Config (show other bugs)
: 1.8 Branch
: Other AIX
: -- normal (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
http://developer.mozilla.org/en/docs/...
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-01-19 03:01 PST by Ganesh
Modified: 2008-08-18 11:28 PDT (History)
4 users (show)
dveditz: blocking1.8.0.2+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
Patch for firefox 1.5 (818 bytes, patch)
2006-01-19 03:42 PST, Ganesh
cls: review+
Details | Diff | Splinter Review
"updated patch with pkw's comments" (817 bytes, patch)
2006-01-23 04:52 PST, Ganesh
benjamin: review+
dveditz: approval‑branch‑1.8.1+
dveditz: approval1.8.0.2+
Details | Diff | Splinter Review
fixes CPU_ARCH for RS/6000 w/o powerpc CPU also (1.90 KB, patch)
2008-08-12 10:42 PDT, Uli Link (:ul-mcamafia)
cls: review-
Details | Diff | Splinter Review
reworked with cls' suggestions (1.92 KB, patch)
2008-08-13 00:48 PDT, Uli Link (:ul-mcamafia)
cls: review+
Details | Diff | Splinter Review

Description Ganesh 2006-01-19 03:01:23 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8) Gecko/20051111 Firefox/1.5
Build Identifier: 

http://developer.mozilla.org/en/docs/TARGET_XPCOM_ABI
On AIX, the value of TARGET_XPCOM_ABI value is never set correctly.

Issuing the following javascript command in the javascript console results in error NS_ERROR_NOT_AVAILABLE:

Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime).XPCOMABI



Reproducible: Always

Steps to Reproduce:
1. Start firefox
2. open the JavaScript Console
3. Evaluate the following JavaScript code:

Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULRuntime).XPCOMABI

Actual Results:  
It results in error NS_ERROR_NOT_AVAILABLE.

Expected Results:  
It should display "ppc-vacpp".
Comment 1 Ganesh 2006-01-19 03:42:40 PST
Created attachment 208955 [details] [diff] [review]
Patch for firefox 1.5
Comment 2 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2006-01-19 06:24:00 PST
Comment on attachment 208955 [details] [diff] [review]
Patch for firefox 1.5

This is incorrect. The target compiler ABI is a concatenation of the CPU arch and the compiler ABI and is always set at http://lxr.mozilla.org/mozilla/source/configure.in#3534

You should test and set CPU_ARCH at http://lxr.mozilla.org/mozilla/source/configure.in#1031

and TARGET_COMPILER_ABI in
http://lxr.mozilla.org/mozilla/source/configure.in#1262
Comment 3 Ganesh 2006-01-20 02:31:11 PST
(In reply to comment #2)
> (From update of attachment 208955 [details] [diff] [review] [edit])
> This is incorrect. The target compiler ABI is a concatenation of the CPU arch
> and the compiler ABI and is always set at
> http://lxr.mozilla.org/mozilla/source/configure.in#3534
> 
> You should test and set CPU_ARCH at
> http://lxr.mozilla.org/mozilla/source/configure.in#1031
> 
> and TARGET_COMPILER_ABI in
> http://lxr.mozilla.org/mozilla/source/configure.in#1262
> 

Exactly, the target compiler ABI is the cancatenation of CPU_ARCH and TARGET_COMPILER_ABI. But the value of CPU_ARCH will depends on the value of OS_TEST.
http://lxr.mozilla.org/mozilla/source/configure.in#1031

Initially the value of OS_TEST will be set with `uname -m`. 
http://lxr.mozilla.org/mozilla/source/configure.in#796

But in AIX, `uname -m` will return the machine ID and `uname -p` will display CPU Arch. if the OS_ARCH is AIX, I'm overriding OS_TEST value with `uname -p`.Now the OS_TEST will be set with 'powerpc' for AIX and the CPU_ARCH value will be set with 'ppc', http://lxr.mozilla.org/mozilla/source/configure.in#1036.
Comment 4 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2006-01-20 04:59:05 PST
Comment on attachment 208955 [details] [diff] [review]
Patch for firefox 1.5

cls, does that make sense to you?
Comment 5 Philip K. Warren 2006-01-20 07:59:11 PST
I think I prefer 'ibmc' instead of 'vacpp' for the compiler name. The name VisualAge C++ has been changed to XL C/C++ and I think it makes more sense to just use ibmc for the IBM compiler on AIX.
Comment 6 cls 2006-01-20 10:21:27 PST
Comment on attachment 208955 [details] [diff] [review]
Patch for firefox 1.5

r=cls with pkw's suggested change.
Comment 7 Ganesh 2006-01-23 04:52:25 PST
Created attachment 209346 [details] [diff] [review]
"updated patch with pkw's comments"
Comment 8 Philip K. Warren 2006-01-23 09:06:07 PST
Comment on attachment 209346 [details] [diff] [review]
"updated patch with pkw's comments"

Requesting approval for the 1.8 branch.
Comment 9 Benjamin Smedberg AWAY UNTIL 2-AUG-2016 [:bsmedberg] 2006-01-23 09:12:56 PST
Need to get this fixed and verified on the trunk: the approval guidelines for the 1.8.0 branch need two weeks on trunk before we can approve on branch (though it is a very low-risk patch).
Comment 10 Philip K. Warren 2006-01-23 09:32:53 PST
Patch checked in to trunk:

Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1593; previous revision: 1.1592
done
Comment 11 Daniel Veditz [:dveditz] 2006-02-21 23:45:10 PST
Comment on attachment 209346 [details] [diff] [review]
"updated patch with pkw's comments"

approved for 1.8.0 branch, a=dveditz
Comment 12 Philip K. Warren 2006-02-24 09:09:14 PST
Fixed on 1.8.0 branch:

Checking in configure;
/cvsroot/mozilla/configure,v  <--  configure
new revision: 1.1492.2.17.2.5; previous revision: 1.1492.2.17.2.4
done
Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1503.2.15.2.6; previous revision: 1.1503.2.15.2.5
done
Comment 13 Philip K. Warren 2006-02-24 09:29:19 PST
Fixed for 1.8.1:

Checking in configure;
/cvsroot/mozilla/configure,v  <--  configure
new revision: 1.1492.2.39; previous revision: 1.1492.2.38
done
Checking in configure.in;
/cvsroot/mozilla/configure.in,v  <--  configure.in
new revision: 1.1503.2.35; previous revision: 1.1503.2.34
done
Comment 14 Ilya Konstantinov 2006-03-12 05:01:51 PST
Updated the MDC page to include the "ibmc" compiler.
Comment 15 Uli Link (:ul-mcamafia) 2008-08-12 09:01:56 PDT
This fix won't work for AIX 4.3.3 which is a supported configuration for GECKO 1.8.0 and 1.8.1 as there is no "uname -p" before AIX 5.

Second, even on AIX 5.1 with "uname -p" there are machines with OS_TEST resulting in "rs6000" which are not comaptible with "ppc"
Comment 16 Uli Link (:ul-mcamafia) 2008-08-12 10:42:20 PDT
Created attachment 333431 [details] [diff] [review]
fixes CPU_ARCH for RS/6000 w/o powerpc CPU also

Bug should be reopened
Comment 17 cls 2008-08-12 14:18:48 PDT
Comment on attachment 333431 [details] [diff] [review]
fixes CPU_ARCH for RS/6000 w/o powerpc CPU also

Is rs6000 the only type of AIX hardware supported by gecko?  If not, then you shouldn't hardcode OS_TEST=rs6000.  You should probably use ${target_cpu} instead.
Comment 18 Uli Link (:ul-mcamafia) 2008-08-12 15:43:38 PDT
(In reply to comment #17)
> (From update of attachment 333431 [details] [diff] [review])
> Is rs6000 the only type of AIX hardware supported by gecko?  If not, then you
> shouldn't hardcode OS_TEST=rs6000.  You should probably use ${target_cpu}
> instead.

There is only one default cpu architecture: the common mode, regardless if rs6000 or powerpc.
The default for -O or -O2 is "-qarch=com" so the resulting binary runs on every machine regardless of the somewhat misleading build host cpu name. "-qarch=ppc" is incompatible with POWER or POWER2 cpu which are autoconfigured as rs6000-ibm-aix?.?.?.?, "-qarch=pwr" does not run on the PowerPC family cpu, which autoconfigures to powerpc-ibm-aix?.?.?.?
So all hardware types should share the same CPU_ARCH because there is only one XPCOMABI "ppc-ibmc" as long as the default compiler's cpu target is the common mode.
I will evaluate $(target_cpu) on both a rs6000 and powerpc build host and report later, my build hosts are quite slow machines :-(
Comment 19 Uli Link (:ul-mcamafia) 2008-08-13 00:48:41 PDT
Created attachment 333524 [details] [diff] [review]
reworked with cls' suggestions

Now XPCOMABI is set also on AIX 4.3.3 and also on machines with TARGET_CPU=rs6000
Comment 20 Uli Link (:ul-mcamafia) 2008-08-16 02:17:43 PDT
Comment on attachment 333524 [details] [diff] [review]
reworked with cls' suggestions

Requesting approval for active branches.

Risc: close to none. The patch affects the build configuration of AIX builds only. Verifed with tb 2.0.0.16, fx 2.0.0.16 and sm 1.1.11 with this bug's testcase and fx 3.0.1 is correctly configured. 
Porting to AIX5 is still in progress.
Comment 21 Samuel Sidler (old account; do not CC) 2008-08-16 15:29:42 PDT
Can you please put this patch in a new bug? This bug has been verified fixed and already fixed on branches. Adding new patches two and a half years later make it hard to keep track of what's going on. You can carry over review in the new bug as well.
Comment 22 Uli Link (:ul-mcamafia) 2008-08-16 15:59:10 PDT
Opened Follow-up bug 450909

Note You need to log in before you can comment on or make changes to this bug.