Closed Bug 321664 Opened 19 years ago Closed 15 years ago

--enable-js-ultrasparc not ok when using gnu binutils with gcc on solaris

Categories

(Firefox Build System :: General, defect)

Other
Other
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: niki.waibel, Unassigned)

References

Details

Attachments

(1 file)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8) Gecko/20051227 Firefox/1.5
Build Identifier: ftp://mirror.switch.ch/mirror/mozilla/firefox/releases/1.5/source/firefox-1.5-source.tar.bz2

using --enable-js-ultrasparc is not ok (compile fails):
===
gcc -o jsapi.o -c  -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=0000000000 -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA -DULTRA_SPARC   -I../../dist/include/js -I../../dist/include -I../../dist/include/nspr    -I../../dist/sdk/include -I/tmp/mozilla/js/src -I/usr/openwin/include   -fPIC -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -Wno-long-long -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -Wall -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include -O3 -fomit-frame-pointer -freorder-blocks -fno-reorder-functions -pthreads -pipe  -DNDEBUG -DTRIMMED -ffunction-sections -O3 -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0  -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -include ../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/jsapi.pp jsapi.c
/misc/sparc-sun-solaris2.9/bin/as: unrecognized option `-ULTRA_SPARC'
jsapi.c: In function 'JS_ConvertArgumentsVA':
jsapi.c:178: warning: array subscript has type 'char'
jsapi.c: In function 'JS_PushArgumentsVA':
jsapi.c:305: warning: array subscript has type 'char'
jsapi.c:314: warning: array subscript has type 'char'
make[3]: *** [jsapi.o] Error 2
make[3]: Leaving directory `/tmp/mozilla/js/src'
make[2]: *** [libs] Error 2
make[2]: Leaving directory `/tmp/mozilla/js'
make[1]: *** [tier_2] Error 2
make[1]: Leaving directory `/tmp/mozilla'
make: *** [default] Error 2
===
when gcc is setup to use the gnu binutils (i guess it's ok when using gcc with sun as/ld) in solaris!

gcc, compiled to use gnu as/ld, does not understand -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
which is set in
mozilla/js/src/Makefile.in
line 276, 277 and 279.

info page says:
`-D'
     Ignored.  This option is accepted for script compatibility with
     calls to other assemblers.
the following happens:
===
nwaibel@blade1000-1:~/fbuild $ as -DULTRA_SPARC
as: unrecognized option `-ULTRA_SPARC'
nwaibel@blade1000-1:~/fbuild $ as --version
GNU assembler 2.16.91.0.5 20051219
Copyright 2005 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License.  This program has absolutely no warranty.
This assembler was configured for a target of `sparc-sun-solaris2.9'.
===
also, option -P is not available with gnu as.
if gcc is called it will preprocess the assembler file anyway.

option -L is there. man page says:
       -L
       --keep-locals
           Keep  (in  the  symbol  table) local symbols.  On traditional a.out
           systems these start with L, but different  systems  have  different
           local label prefixes.
could be ok to use it...

one solution for the problems mentioned would be -- obviously -- to switch off the asm code, but on the other hand it should not be too hard to detect gnu as/ld and pass other options.

maybe i can find a way and provide a patch here...

Reproducible: Always

Steps to Reproduce:
compile firefox on solaris using gcc (compiled to use gnu binutils!!!).
Actual Results:  
gcc -o jsapi.o -c  -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=0000000000 -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA -DULTRA_SPARC   -I../../dist/include/js -I../../dist/include -I../../dist/include/nspr    -I../../dist/sdk/include -I/tmp/mozilla/js/src -I/usr/openwin/include   -fPIC -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -Wno-long-long -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -Wall -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include -O3 -fomit-frame-pointer -freorder-blocks -fno-reorder-functions -pthreads -pipe  -DNDEBUG -DTRIMMED -ffunction-sections -O3 -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0  -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -include ../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/jsapi.pp jsapi.c
/misc/sparc-sun-solaris2.9/bin/as: unrecognized option `-ULTRA_SPARC'
jsapi.c: In function 'JS_ConvertArgumentsVA':
jsapi.c:178: warning: array subscript has type 'char'
jsapi.c: In function 'JS_PushArgumentsVA':
jsapi.c:305: warning: array subscript has type 'char'
jsapi.c:314: warning: array subscript has type 'char'
make[3]: *** [jsapi.o] Error 2
make[3]: Leaving directory `/tmp/mozilla/js/src'
make[2]: *** [libs] Error 2
make[2]: Leaving directory `/tmp/mozilla/js'
make[1]: *** [tier_2] Error 2
make[1]: Leaving directory `/tmp/mozilla'
make: *** [default] Error 2


Expected Results:  
a compiled binary called firefox-bin ;-)
changing mozilla/js/src/Makefile:
=====
--- Makefile.orig      2005-12-28 00:13:34.849752000 +0100
+++ Makefile    2005-12-28 00:02:41.666905200 +0100
@@ -273,10 +273,10 @@
 ifdef JS_ULTRASPARC_OPTS
 DEFINES += -DULTRA_SPARC
 ifdef GNU_CC
-CFLAGS   += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
-CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
+CFLAGS   += -Wa,-xarch=v8plus,-L
+CXXFLAGS += -Wa,-xarch=v8plus,-L
 else
-ASFLAGS  += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
+ASFLAGS  += -xarch=v8plus -L
 endif # GNU_CC
 endif # JS_ULTRASPARC_OPTS

=====
solves this problem.

hmmm, do you really still need this fancy asm-option stuff?
maybe it was there once to assemble lock_SunOS.s, which seems not to be used anymore at all...
asm is used in jslock.c only, and imho does not need any options passed directly to as (-Wa,XXX gcc option). gcc option -DULTRA_SPARC (or not) is enough, i think.

so
=====
--- /home/nwaibel/Makefile      2005-12-28 00:13:34.849752000 +0100
+++ Makefile    2005-12-28 00:47:39.292096600 +0100
@@ -272,12 +272,6 @@
 
 ifdef JS_ULTRASPARC_OPTS
 DEFINES += -DULTRA_SPARC
-ifdef GNU_CC
-CFLAGS   += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
-CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
-else
-ASFLAGS  += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
-endif # GNU_CC
 endif # JS_ULTRASPARC_OPTS
 
 endif

=====
could be ok as well, right?
actually i am not right. removing all options results in:
===
gcc -o jslock.o -c  -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=0000000000 -DEXPORT_JS_API  -DJS_USE_SAFE_ARENA -DULTRA_SPARC   -I../../dist/include/js -I../../dist/include -I../../dist/include/nspr    -I../../dist/sdk/include -I/tmp/mozilla/js/src -I/usr/openwin/include   -fPIC -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -Wno-long-long -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -Wall -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include -O3 -fomit-frame-pointer -freorder-blocks -fno-reorder-functions -pthreads -pipe  -DNDEBUG -DTRIMMED -ffunction-sections -O3  -I"/tmp/mozilla/dist/include" -I"/tmp/mozilla/directory/c-sdk/ldap/include" -I/misc/sparc-sun-solaris2.9/include -I/usr/X11R6/include -I/usr/openwin/include  -I/usr/openwin/include -include ../../mozilla-config.h -DMOZILLA_CLIENT -Wp,-MD,.deps/jslock.pp jslock.c
{standard input}: Assembler messages:
{standard input}:410: Error: Architecture mismatch on "cas".
{standard input}:410:  (Requires v9|v9a|v9b; requested architecture is v8.)
{standard input}:440: Error: Architecture mismatch on "cas".
{standard input}:440:  (Requires v9|v9a|v9b; requested architecture is v8.)
{standard input}:846: Error: Architecture mismatch on "cas".
{standard input}:846:  (Requires v9|v9a|v9b; requested architecture is v8.)
...
===
it seems that the 1st suggested patch is the safest:
=====
--- Makefile.orig      2005-12-28 00:13:34.849752000 +0100
+++ Makefile    2005-12-28 00:02:41.666905200 +0100
@@ -273,10 +273,10 @@
 ifdef JS_ULTRASPARC_OPTS
 DEFINES += -DULTRA_SPARC
 ifdef GNU_CC
-CFLAGS   += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0
-CXXFLAGS += -Wa,-xarch=v8plus,-DULTRA_SPARC,-P,-L,-D_ASM,-D__STDC__=0,-K,PIC
+CFLAGS   += -Wa,-xarch=v8plus,-L
+CXXFLAGS += -Wa,-xarch=v8plus,-L
 else
-ASFLAGS  += -xarch=v8plus -DULTRA_SPARC -P -L -D_ASM -D__STDC__=0 -K PIC
+ASFLAGS  += -xarch=v8plus -L
 endif # GNU_CC
 endif # JS_ULTRASPARC_OPTS

=====

can anyone confirm that this works ok on
solaris/sparc/gcc/sun as/sun ld
solaris/sparc/sun cc/sun as/sun ld
?
bug 502696 will fix this, as it
 - deprecates ULTRA_SPARC and --enable-js-ultrasparc
 - builds on GCC with -mcpu=v9 -fPIC
 - does not add the SunStudio ASFLAGS to CFLAGS or CXXFLAGS

Note that the ancient version of gnu as that ships with Solaris 10 has a bug which prevents it from building v9 code. More details in bug 502696 comment 3.
Status: UNCONFIRMED → RESOLVED
Closed: 15 years ago
Depends on: 502696
Resolution: --- → FIXED
Component: Build Config → General
Product: Firefox → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: