Opened 4 months ago

Last modified 5 weeks ago

#23231 needs_review defect

Error in STL wrappers when building Firefox 64-bit for Windows

Reported by: boklm Owned by: tbb-team
Priority: Very High Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: TorBrowserTeam201712
Cc: tbb-team Actual Points:
Parent ID: Points:
Reviewer: Sponsor: Sponsor4

Description

When trying to build firefox for Windows 64 we get the same error as comment 13 in mozilla bug 1269251:
https://bugzilla.mozilla.org/show_bug.cgi?id=1269251#c13

Reverting the change from bug 1269251 is fixing the error, but there is maybe a better solution.

Child Tickets

Attachments (1)

0001-Bug-23231-disable-STL-Wrappers-on-Windows.patch (626 bytes) - added by boklm 6 weeks ago.

Download all attachments as: .zip

Change History (15)

comment:1 Changed 4 months ago by gk

Is that the full error? See: https://bugzilla.mozilla.org/show_bug.cgi?id=1332747 for a similar one which could help debug this one. FWIW: If you hit compile issues that you feel are not fixed on trunk yet you could open a child ticket to https://bugzilla.mozilla.org/show_bug.cgi?id=1330608.

comment:2 Changed 4 months ago by boklm

The full error is:

Executing: /var/tmp/dist/mingw-w64/helpers/x86_64-w64-mingw32-g++ -std=gnu++11 -mwindows -shared -Wl,--out-implib -Wl,libmozglue.a -o mozglue.dll /var/tmp/build/firefox-
af0ca6a886c7/obj-mingw/mozglue/build/tmp8l87fh.list module.res -specs=/var/tmp/dist/mingw-w64/msvcr100.spec -static mozglue.def -DELAYLOAD:user32.dll -luuid -lgdi32 -lwi
nmm -lwsock32 -luserenv -lsecur32 -ldbghelp -lversion -ldelayimp
/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/mozglue/build/tmp8l87fh.list:
    INPUT("SSE.o")
    INPUT("WindowsDllBlocklist.o")
    INPUT("dummy.o")
    INPUT("../../memory/mozalloc/winheap.o")
    INPUT("../../memory/mozalloc/Unified_cpp_memory_mozalloc0.o")
    INPUT("../misc/StackWalk.o")
    INPUT("../misc/TimeStamp.o")
    INPUT("../misc/TimeStamp_windows.o")
    INPUT("../../mfbt/Compression.o")
    INPUT("../../mfbt/Decimal.o")
    INPUT("../../mfbt/Unified_cpp_mfbt0.o")
    INPUT("../../mfbt/Unified_cpp_mfbt1.o")

/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:58: multiple definition of `std::__throw_bad_exception()'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:43: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:62: multiple definition of `std::__throw_bad_alloc()'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:49: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:66: multiple definition of `std::__throw_bad_cast()'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:55: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:70: multiple definition of `std::__throw_bad_typeid()'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:61: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:74: multiple definition of `std::__throw_logic_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:74: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3
/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:78: multiple definition of `std::__throw_domain_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:80: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:82: multiple definition of `std::__throw_invalid_argument(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:86: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:86: multiple definition of `std::__throw_length_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:92: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:90: multiple definition of `std::__throw_out_of_range(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:98: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:110: multiple definition of `std::__throw_runtime_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:104: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:114: multiple definition of `std::__throw_range_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:110: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:118: multiple definition of `std::__throw_overflow_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:116: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:122: multiple definition of `std::__throw_underflow_error(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:122: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:126: multiple definition of `std::__throw_ios_failure(char const*)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:128: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:130: multiple definition of `std::__throw_system_error(int)'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:134: first defined here
/var/tmp/dist/mingw-w64/lib/gcc/x86_64-w64-mingw32/5.4.0/../../../../x86_64-w64-mingw32/lib/libstdc++.a(functexcept.o):/var/tmp/build/gcc/x86_64-w64-mingw32/libstdc++-v3/src/c++11/../../../../gcc-5.4.0/libstdc++-v3/src/c++11/functexcept.cc:139: multiple definition of `std::__throw_bad_function_call()'
../misc/TimeStamp.o:/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/dist/include/mozilla/throw_gcc.h:68: first defined here
collect2: error: ld returned 1 exit status
make[5]: *** [mozglue.dll] Error 1
make[5]: Leaving directory `/var/tmp/build/firefox-af0ca6a886c7/obj-mingw/mozglue/build'
make[4]: *** [mozglue/build/target] Error 2

comment:3 Changed 4 months ago by cypherpunks

Summary: Error in STL wrappers when building firefox for Windows 64Error in STL wrappers when building Firefox 64-bit for Windows
Type: taskdefect

for Windows 64

"Windows 10 is the last version of Windows" (c) M$ ;)

comment:4 Changed 4 months ago by gk

This is https://bugzilla.mozilla.org/show_bug.cgi?id=1392604. boklm: Could you test whether a fix along the idea glandium had is working for us?

comment:5 Changed 3 months ago by gk

Sponsor: Sponsor4

comment:6 Changed 3 months ago by gk

Keywords: TorBrowserTeam201709 added

comment:7 Changed 3 months ago by boklm

I tried a build with this, however it didn't fix the build issue:
https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug_23231_v2

comment:8 Changed 3 months ago by cypherpunks

There are too much issues, so just random thoughts:
First of all, https://dxr.mozilla.org/mozilla-esr52/source/config/gcc-stl-wrapper.template.h should be updated with all the fixes as msvc- one.
Do we need https://hg.mozilla.org/mozilla-central/rev/491c4ae1ea4a?
But, generally, read https://bugzilla.mozilla.org/show_bug.cgi?id=427107 - they almost don't test paths without jemalloc :(
Also, there is

// MinGW doesn't appropriately inline these functions in debug builds,
// so we need to do some extra coercion for it to do so. Bug 1332747

instead of reading https://gcc.gnu.org/onlinedocs/gcc-4.9.0/gcc/Inline.html (it's short)
There is an assumption that they didn't take into consideration mingw-w64 when they did https://bugzilla.mozilla.org/show_bug.cgi?id=868814.
But this error is about visibility (MOZ_EXPORT) and not inlining (but -fno-keep-inline-dllexport may affect this).

comment:9 Changed 3 months ago by gk

Keywords: TorBrowserTeam201710 added; TorBrowserTeam201709 removed

Items for October 2017

comment:10 Changed 6 weeks ago by gk

Keywords: TorBrowserTeam201711 added; TorBrowserTeam201710 removed

Moving tickets over to November.

comment:11 Changed 6 weeks ago by gk

Priority: MediumVery High

Changing prio to reflect sponsor deadline

comment:12 Changed 6 weeks ago by boklm

Keywords: TorBrowserTeam201711R added; TorBrowserTeam201711 removed
Status: newneeds_review

I attached a patch reverting the change from bug 1269251. I think we could take this patch in our git branch as a workaround until https://bugzilla.mozilla.org/show_bug.cgi?id=1392604 is fixed. Or we could store it as a patch file in tor-browser-build/projects/firefox if we want to apply it only to the Windows 64 build as it is not necessary for the 32bit one.

comment:13 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201711 added; TorBrowserTeam201711R removed
Parent ID: #23229

Okay, I took the patch file road and added a respective commit in tor-browser-build (commit b66d7da8eb4989593792381a8f3ac40c1ad38fde) on master. That should be enough as a workaround for now. Leaving this ticket open for a proper fix, though.

comment:14 Changed 5 weeks ago by gk

Keywords: TorBrowserTeam201712 added; TorBrowserTeam201711 removed

Moving win64 tickets to December.

Note: See TracTickets for help on using tickets.