Closed Bug 646340 Opened 9 years ago Closed 9 years ago

[gcc 4.6] Can't build JS core code on 64-bit system without disabling warning-as-errors.

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: fredbezies, Unassigned)

References

Details

User-Agent:       Mozilla/5.0 (X11; Linux x86_64; rv:2.2a1pre) Gecko/20100101 Firefox/4.2a1pre
Build Identifier: 

Hello.

Another gcc 4.6 bug. If I want to build minefield with updated js code, I can't until I use --disable-warnings-as-errors options in .mozconfig.

If I don't I got errors message while processing jsatom.cpp, jsarray.cpp, jsapi.cpp.

Reproducible: Always

Steps to Reproduce:
1. Get gcc 4.6
2. Get last source trunk code
3. Build using .mozconfig shown below
Actual Results:  
warning and broken build process.

Expected Results:  
Build process going on ?

.mozconfig used :

export AUTOCONF=autoconf-2.13
export CXXFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -fpermissive"

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/../objdir-fx
mk_add_options MOZ_MAKE_FLAGS=-j4

# Options for ‘configure’ (same as command-line options).
ac_add_options --enable-application=browser
ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --disable-tests
ac_add_options --disable-crashreporter
ac_add_options --with-ccache

A bug like bug 645469 ?!
Errors log :

jsatom.cpp
In file included from /home/fred/logs/fox/src/js/src/jsatom.cpp:64:0:
/home/fred/logs/fox/src/js/src/jsobjinlines.h: In member function ‘void JSObject::setArrayLength(uint32)’:
/home/fred/logs/fox/src/js/src/jsobjinlines.h:364:24: erreur: transtypage vers un pointeur depuis un entier de taille différente [-Werror=int-to-pointer-cast]
/home/fred/logs/fox/src/js/src/jsatom.cpp: In member function ‘JSAtomListElement* JSAtomList::add(js::Parser*, JSAtom*, JSAtomList::AddHow)’:
/home/fred/logs/fox/src/js/src/jsatom.cpp:828:47: erreur: transtypage vers un pointeur depuis un entier de taille différente [-Werror=int-to-pointer-cast]
cc1plus: all warnings being treated as errors


In the directory  /home/fred/logs/fox/objdir-fx/js/src
The following command failed to execute properly:
/usr/bin/ccache c++ -o jsatom.o -c -I./../../dist/system_wrappers_js -include /home/fred/logs/fox/src/js/src/config/gcc_hidden.h -DOSTYPE="Linux2.6" -DOSARCH=Linux -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".so" -Ictypes/libffi/include -I. -I/home/fred/logs/fox/src/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/home/fred/logs/fox/objdir-fx/dist/include/nspr -I/home/fred/logs/fox/src/js/src -I/home/fred/logs/fox/src/js/src/assembler -I/home/fred/logs/fox/src/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -march=x86-64 -mtune=generic -O2 -pipe -fpermissive -fno-strict-aliasing -pthread -pipe -DNDEBUG -DTRIMMED -g -O3 -fstrict-aliasing -fno-stack-protector -fomit-frame-pointer -Werror -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsatom.pp /home/fred/logs/fox/src/js/src/jsatom.cpp
make[5]: *** [jsatom.o] Erreur 1
make[5]: *** Attente des tâches non terminées....
In file included from /home/fred/logs/fox/src/js/src/jsarray.cpp:110:0:
/home/fred/logs/fox/src/js/src/jsobjinlines.h: In member function ‘void JSObject::setArrayLength(uint32)’:
/home/fred/logs/fox/src/js/src/jsobjinlines.h:364:24: erreur: transtypage vers un pointeur depuis un entier de taille différente [-Werror=int-to-pointer-cast]
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h: At global scope:
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h:346:31: erreur: ‘nanojit::SavedRegs’ defined but not used [-Werror=unused-variable]
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h:354:31: erreur: ‘nanojit::SingleByteStoreRegs’ defined but not used [-Werror=unused-variable]
cc1plus: all warnings being treated as errors


In the directory  /home/fred/logs/fox/objdir-fx/js/src
The following command failed to execute properly:
/usr/bin/ccache c++ -o jsarray.o -c -I./../../dist/system_wrappers_js -include /home/fred/logs/fox/src/js/src/config/gcc_hidden.h -DOSTYPE="Linux2.6" -DOSARCH=Linux -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".so" -Ictypes/libffi/include -I. -I/home/fred/logs/fox/src/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/home/fred/logs/fox/objdir-fx/dist/include/nspr -I/home/fred/logs/fox/src/js/src -I/home/fred/logs/fox/src/js/src/assembler -I/home/fred/logs/fox/src/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -march=x86-64 -mtune=generic -O2 -pipe -fpermissive -fno-strict-aliasing -pthread -pipe -DNDEBUG -DTRIMMED -g -O3 -fstrict-aliasing -fno-stack-protector -fomit-frame-pointer -Werror -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsarray.pp /home/fred/logs/fox/src/js/src/jsarray.cpp
make[5]: *** [jsarray.o] Erreur 1
In file included from /home/fred/logs/fox/src/js/src/jsapi.cpp:93:0:
/home/fred/logs/fox/src/js/src/jsobjinlines.h: In member function ‘void JSObject::setArrayLength(uint32)’:
/home/fred/logs/fox/src/js/src/jsobjinlines.h:364:24: erreur: transtypage vers un pointeur depuis un entier de taille différente [-Werror=int-to-pointer-cast]
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h: At global scope:
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h:346:31: erreur: ‘nanojit::SavedRegs’ defined but not used [-Werror=unused-variable]
/home/fred/logs/fox/src/js/src/nanojit/NativeX64.h:354:31: erreur: ‘nanojit::SingleByteStoreRegs’ defined but not used [-Werror=unused-variable]
cc1plus: all warnings being treated as errors


In the directory  /home/fred/logs/fox/objdir-fx/js/src
The following command failed to execute properly:
/usr/bin/ccache c++ -o jsapi.o -c -I./../../dist/system_wrappers_js -include /home/fred/logs/fox/src/js/src/config/gcc_hidden.h -DOSTYPE="Linux2.6" -DOSARCH=Linux -DEXPORT_JS_API -D__STDC_LIMIT_MACROS -DJS_HAS_CTYPES -DDLL_PREFIX="lib" -DDLL_SUFFIX=".so" -Ictypes/libffi/include -I. -I/home/fred/logs/fox/src/js/src -I. -I./../../dist/include -I./../../dist/include/nsprpub -I/home/fred/logs/fox/objdir-fx/dist/include/nspr -I/home/fred/logs/fox/src/js/src -I/home/fred/logs/fox/src/js/src/assembler -I/home/fred/logs/fox/src/js/src/yarr -fPIC -fno-rtti -fno-exceptions -Wall -Wpointer-arith -Woverloaded-virtual -Wsynth -Wno-ctor-dtor-privacy -Wno-non-virtual-dtor -Wcast-align -Wno-invalid-offsetof -Wno-variadic-macros -Werror=return-type -pedantic -Wno-long-long -march=x86-64 -mtune=generic -O2 -pipe -fpermissive -fno-strict-aliasing -pthread -pipe -DNDEBUG -DTRIMMED -g -O3 -fstrict-aliasing -fno-stack-protector -fomit-frame-pointer -Werror -DUSE_SYSTEM_MALLOC=1 -DENABLE_ASSEMBLER=1 -DENABLE_JIT=1 -DMOZILLA_CLIENT -include ./js-confdefs.h -MD -MF .deps/jsapi.pp /home/fred/logs/fox/src/js/src/jsapi.cpp
make[5]: *** [jsapi.o] Erreur 1
make[4]: *** [libs_tier_js] Erreur 2
make[3]: *** [tier_js] Erreur 2
make[2]: *** [default] Erreur 2
make[1]: *** [realbuild] Erreur 2
make: *** [build] Erreur 2
Assignee: nobody → general
Blocks: 609532
Component: Build Config → JavaScript Engine
QA Contact: build-config → general
See, this is why we can't have nice things.
This is no different than having to back out tinderbox upgrades to new compilers.  It's just something developers will see more often, rather than only release people seeing it, and which affects a few more "customers".

I would puzzle this out if I understood French (nyet!) and had time (a little iffy, but I will make time for warnings-as-errors, they've already been immensely helpful despite being around only a week-ish).  But if no one else will, I'll try to work backward from the location to divine the errors (and fixes).
(In reply to comment #1)
> jsatom.cpp
> In file included from /home/fred/logs/fox/src/js/src/jsatom.cpp:64:0:
> /home/fred/logs/fox/src/js/src/jsobjinlines.h: In member function ‘void
> JSObject::setArrayLength(uint32)’:
> /home/fred/logs/fox/src/js/src/jsobjinlines.h:364:24: erreur: transtypage vers
> un pointeur depuis un entier de taille différente [-Werror=int-to-pointer-cast]

The errors are all the same ("erreur: transtypage vers un pointeur depuis un entier de taille différente"), and mean "casting to a pointer from an entity of a different size".
Warnings-as-errors is now off again.  See bug 646702 for follow-up.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
(In reply to comment #3)
> I would puzzle this out if I understood French 
[...]
(In reply to comment #4)
> mean "casting to a pointer from an entity of a different size".

FWIW, the flagged code is:

> 363 inline void
> 364 JSObject::setArrayLength(uint32 length)
> 365 {
> 366     JS_ASSERT(isArray());
> 367     setPrivate((void*) length);

and GCC is warning us because a void* is a 64-bit value, whereas |length| is a 32-bit value.
Summary: [gcc 4.6] Can't build JS core code without disabling warning-as-errors. → [gcc 4.6] Can't build JS core code on 64-bit system without disabling warning-as-errors.
You need to log in before you can comment on or make changes to this bug.