Closed Bug 1055627 Opened 5 years ago Closed 5 years ago

Pass MOZ_GLUE_PROGRAM_LDFLAGS after STATIC_LIBS to linker.

Categories

(Firefox Build System :: General, defect)

x86
Other
defect
Not set

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: jacek, Assigned: jacek)

References

Details

Attachments

(1 file)

Attached patch patchSplinter Review
Otherwise linking to static js lib fails on mingw.
Attachment #8475252 - Flags: review?(gps)
(In reply to Jacek Caban from comment #0)
> Created attachment 8475252 [details] [diff] [review]
> patch
> 
> Otherwise linking to static js lib fails on mingw.

How does it fail?
Attachment #8475252 - Flags: review?(gps) → review?(mh+mozilla)
JS sources depend on mozglue and for that to work, mozglue needs to be passed after them to the linker. Here is an example of error:

$ MOZCONFIG=/home/jacek/mozilla/mozconfig-browser ./mach build js/src/gdb/
 0:00.13 /usr/bin/gmake -C /home/jacek/mozilla/mozilla-build -j8 -s backend.RecursiveMakeBackend
 0:00.25 /usr/bin/gmake -C js/src/gdb -j8 -s
 0:00.27 gdb-tests.exe
 0:06.02 Executing: i686-w64-mingw32-g++ -mwindows -o gdb-tests.exe -Wall -Wpointer-arith -Woverloaded-virtual -Werror=return-type -Werror=int-to-pointer-cast -Wtype-limits -Wempty-body -Werror=conversion-null -Wsign-compare -Wno-invalid-offsetof -Wcast-align -Wno-format -mms-bitfields -mstackrealign -fno-keep-inline-dllexport -fno-rtti -fno-exceptions -fno-math-errno -std=gnu++0x -pipe -DNDEBUG -DTRIMMED -g -O -fomit-frame-pointer /home/jacek/mozilla/mozilla-build/js/src/gdb/tmpjv1S6i.list -static-libgcc -static-libstdc++ -Wl,--large-address-aware -L../../../dist/lib -lmozglue ../libjs_static.a -lm -lgdi32 -lwinmm -lwsock32 -lpsapi -L../../../dist/nsprpub/lib/ds/plds4 -lplds4 -L../../../dist/nsprpub/lib/libc/src/plc4 -lplc4 -L../../../dist/nsprpub/pr/src/nspr4 -lnspr4
 0:06.02 /home/jacek/mozilla/mozilla-build/js/src/gdb/tmpjv1S6i.list:
 0:06.02     INPUT("Unified_cpp_js_src_gdb0.o")
 0:06.02 
 0:06.02 ../libjs_static.a(Unified_cpp_js_src7.o): In function `ZN2js3jit12SimdConstant4hashERKS1_':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jit/IonTypes.h:334: undefined reference to `_imp___ZN7mozilla9HashBytesEPKvj'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src0.o): In function `ZN19ModuleCharsForStore4initERN2js8frontend6ParserINS1_16FullParseHandlerEEE':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/asmjs/AsmJSModule.cpp:1926: undefined reference to `_imp___ZN7mozilla11Compression3LZ48compressEPKcjPc'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src0.o): In function `ZN20ModuleCharsForLookup11deserializeEPN2js16ExclusiveContextEPKh':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/asmjs/AsmJSModule.cpp:1993: undefined reference to `_imp___ZN7mozilla11Compression3LZ410decompressEPKcPcj'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src8.o): In function `FracNumberToCString':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jsnum.cpp:1287: undefined reference to `_imp___ZN17double_conversion23DoubleToStringConverter19EcmaScriptConverterEv'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src8.o): In function `ZNK17double_conversion23DoubleToStringConverter10ToShortestEdPNS_13StringBuilderE':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/../../mfbt/double-conversion/double-conversion.h:159: undefined reference to `_imp___ZNK17double_conversion23DoubleToStringConverter20ToShortestIeeeNumberEdPNS_13StringBuilderENS0_8DtoaModeE'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src8.o): In function `ZN2js22CompressedSourceHasher11computeHashEPKvj':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jsscript.h:622: undefined reference to `_imp___ZN7mozilla9HashBytesEPKvj'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src8.o): In function `ZN2js20ScriptBytecodeHasher4hashERKNS0_6LookupE':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jsscript.h:1952: undefined reference to `_imp___ZN7mozilla9HashBytesEPKvj'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src8.o): In function `ZN2js22CompressedSourceHasher11computeHashEPKvj':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jsscript.h:622: undefined reference to `_imp___ZN7mozilla9HashBytesEPKvj'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src9.o): In function `ZN2js10CompressorD2Ev':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:45: undefined reference to `_imp__MOZ_Z_deflateEnd'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src9.o): In function `ZN2js10Compressor4initEv':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:62: undefined reference to `_imp__MOZ_Z_deflateInit_'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src9.o): In function `ZN2js10Compressor12compressMoreEv':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:90: undefined reference to `_imp__MOZ_Z_deflate'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src9.o): In function `ZN2js16DecompressStringEPKhjPhj':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:118: undefined reference to `_imp__MOZ_Z_inflateInit_'
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:123: undefined reference to `_imp__MOZ_Z_inflate'
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/vm/Compression.cpp:125: undefined reference to `_imp__MOZ_Z_inflateEnd'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src5.o): In function `ZNK2js3jit9MConstant17canProduceFloat32Ev':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jit/MIR.cpp:586: undefined reference to `_imp___ZN7mozilla22IsFloat32RepresentableEd'
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jit/MIR.cpp:588: undefined reference to `_imp___ZN7mozilla22IsFloat32RepresentableEd'
 0:06.02 ../libjs_static.a(Unified_cpp_js_src5.o): In function `ZN2js3jit23MAsmJSUnsignedToFloat327foldsToERNS0_13TempAllocatorE':
 0:06.02 /home/jacek/mozilla/mozilla-central/js/src/jit/MIR.cpp:3325: undefined reference to `_imp___ZN7mozilla22IsFloat32RepresentableEd'
 0:06.02 collect2: error: ld returned 1 exit status
 0:06.02 gmake[1]: *** [gdb-tests.exe] Error 1
 0:06.02 gmake: *** [default] Error 2
Attachment #8475252 - Flags: review?(mh+mozilla) → review+
https://hg.mozilla.org/mozilla-central/rev/2e3703f9be76
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Depends on: 1059255
Blocks: 1062559
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.