Opened 15 months ago

Closed 5 months ago

#23231 closed defect (fixed)

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

Reported by: boklm Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: ff60-esr, TorBrowserTeam201806R
Cc: tbb-team, tom, sukhbir Actual Points:
Parent ID: #26203 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 13 months ago.

Download all attachments as: .zip

Change History (34)

comment:1 Changed 15 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 15 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 15 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 15 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 15 months ago by gk

Sponsor: Sponsor4

comment:6 Changed 15 months ago by gk

Keywords: TorBrowserTeam201709 added

comment:7 Changed 15 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 14 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 14 months ago by gk

Keywords: TorBrowserTeam201710 added; TorBrowserTeam201709 removed

Items for October 2017

comment:10 Changed 13 months ago by gk

Keywords: TorBrowserTeam201711 added; TorBrowserTeam201710 removed

Moving tickets over to November.

comment:11 Changed 13 months ago by gk

Priority: MediumVery High

Changing prio to reflect sponsor deadline

comment:12 Changed 13 months 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 13 months 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 12 months ago by gk

Keywords: TorBrowserTeam201712 added; TorBrowserTeam201711 removed

Moving win64 tickets to December.

comment:15 Changed 10 months ago by gk

Status: needs_reviewnew

comment:16 Changed 10 months ago by gk

Keywords: TorBrowserTeam201801 added; TorBrowserTeam201712 removed

Moving tickets to 2018.

comment:17 Changed 10 months ago by gk

Keywords: TorBrowserTeam201802 added; TorBrowserTeam201801 removed

Moving tickets to Feb

comment:18 Changed 9 months ago by gk

Keywords: TorBrowserTeam201803 added; TorBrowserTeam201802 removed

Adding to our March plate.

comment:19 Changed 7 months ago by gk

Keywords: TorBrowserTeam201804 added; TorBrowserTeam201803 removed

Moving our tickets to April.

comment:20 Changed 7 months ago by gk

Priority: Very HighMedium

comment:21 Changed 7 months ago by gk

Cc: tom added

Note, that Tom does not seem to have a problem with this issue while building for 64bit. I am not sure why that's the case but we should figure it out and close https://bugzilla.mozilla.org/show_bug.cgi?id=1392604 once we know what's up. Marking this tentatively as ff60-esr-will-have.

Interestingly, I recall that I still needed that when I worked on the Stylo bug, which means with a pretty recent m-c tree. Adding Tom as he might have some insight in this.

comment:22 Changed 7 months ago by gk

Keywords: ff60-esr-will-have added

comment:23 Changed 7 months ago by tom

Sorry, no insight. I kept the tab open expecting to eventually need this but never did.

comment:24 in reply to:  21 ; Changed 7 months ago by cypherpunks

Replying to gk:

Interestingly, I recall that I still needed that when I worked on the Stylo bug, which means with a pretty recent m-c tree.

(As you're not polite and don't think it's good form to reply to useful comments, this comment was reduced.)
https://bugzilla.mozilla.org/show_bug.cgi?id=1257501

comment:25 in reply to:  24 ; Changed 7 months ago by gk

Replying to cypherpunks:

Replying to gk:

Interestingly, I recall that I still needed that when I worked on the Stylo bug, which means with a pretty recent m-c tree.

(As you're not polite and don't think it's good form to reply to useful comments, this comment was reduced.)
https://bugzilla.mozilla.org/show_bug.cgi?id=1257501

The bug you want is https://bugzilla.mozilla.org/show_bug.cgi?id=1443823 (see my comment 8). The patch in the bug you are linking to is just concerned with the 32bit cross-compilation, which is not the problem we are facing in this ticket: only when cross-compiling for 64bit Windows are we hitting the STL wrapper related compiler error.

comment:26 in reply to:  25 Changed 7 months ago by cypherpunks

Replying to gk:

Replying to cypherpunks:

Replying to gk:

Interestingly, I recall that I still needed that when I worked on the Stylo bug, which means with a pretty recent m-c tree.

(As you're not polite and don't think it's good form to reply to useful comments, this comment was reduced.)
https://bugzilla.mozilla.org/show_bug.cgi?id=1257501

The bug you want is https://bugzilla.mozilla.org/show_bug.cgi?id=1443823 (see my comment 8).

Who wants?

The patch in the bug you are linking to is just concerned with the 32bit cross-compilation, which is not the problem we are facing in this ticket: only when cross-compiling for 64bit Windows are we hitting the STL wrapper related compiler error.

Forbid the usage of -fno-keep-inline-dllexport optimization option entirely and recheck.

comment:27 Changed 7 months ago by gk

Keywords: ff60-esr added; ff60-esr-will-have removed

Actually, we need to have at least a patch to remove the workaround in tor-browser-build, so let's move that again on our radar for ESR60.

comment:28 Changed 7 months ago by gk

Keywords: TorBrowserTeam201805 added; TorBrowserTeam201804 removed

Moving remaining tickets to May.

comment:29 Changed 6 months ago by gk

Cc: sukhe added
Parent ID: #26203

comment:30 Changed 6 months ago by gk

Cc: sukhbir added; sukhe removed

CCing the real sukhe

comment:31 Changed 5 months ago by gk

Keywords: TorBrowserTeam201806 added; TorBrowserTeam201805 removed

Moving our tickets to June 2018

comment:32 Changed 5 months ago by gk

Keywords: TorBrowserTeam201806R added; TorBrowserTeam201806 removed
Status: newneeds_review

comment:33 Changed 5 months ago by boklm

Resolution: fixed
Status: needs_reviewclosed

This looks good to me. I merged it to master with commit 5e72f5077d7c974e30c9f48f2c554ded6e8358d1.

Note: See TracTickets for help on using tickets.