#25832 closed defect (fixed)

Enable pthread support for mingw-w64

Reported by: gk Owned by: tbb-team
Priority: Medium Milestone:
Component: Applications/Tor Browser Version:
Severity: Normal Keywords: tbb-rbm, ff60-esr, GeorgKoppen201804, TorBrowserTeam201806R
Cc: Actual Points:
Parent ID: #24631 Points:
Reviewer: Sponsor:

Description

https://bugzilla.mozilla.org/show_bug.cgi?id=1406542 starts to use pthread support for mingw-w64. We need to adapt our mingw-w64 build script for that.

Child Tickets

Change History (12)

comment:1 Changed 15 months ago by gk

Keywords: TorBrowserTeam201804 GeorgKoppen201804 added

I believe this bug is behind my build failure on my Linux boxes:

1:34.88 In file included from /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/decoder/onyxd_int.h:18:0,
 1:34.88                  from /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/decoder/decodeframe.c:14:
 1:34.90 /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/common/threading.h:76:23: fatal error: semaphore.h: Datei oder Verzeichnis nicht gefunden
 1:34.91  #include <semaphore.h>
 1:34.91   

I am currently verifying that theory and am testing a potential fix.

comment:2 Changed 15 months ago by gk

Keywords: tbb-rbm added

comment:3 in reply to:  1 ; Changed 15 months ago by gk

Keywords: TorBrowserTeam201804R added; TorBrowserTeam201804 removed
Status: newneeds_review

Replying to gk:

I believe this bug is behind my build failure on my Linux boxes:

1:34.88 In file included from /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/decoder/onyxd_int.h:18:0,
 1:34.88                  from /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/decoder/decodeframe.c:14:
 1:34.90 /home/thomas/win60/tor-browser/media/libvpx/libvpx/vp8/common/threading.h:76:23: fatal error: semaphore.h: Datei oder Verzeichnis nicht gefunden
 1:34.91  #include <semaphore.h>
 1:34.91   

I am currently verifying that theory and am testing a potential fix.

Yes, I was right. bug_25832 (https://gitweb.torproject.org/user/gk/tor-browser-build.git/commit/?h=bug_25832&id=9ed4019319aec225d8b2bd163d0be5adea5d4573) has a potential fix that allows me to basically compile everything. (The Firefox is still not running for different reasons on Windows 7 and 8, which is interesting but different tickets).

This should be reviewed once we switched to an ESR60-based tor-browser branch.

comment:4 in reply to:  3 ; Changed 15 months ago by boklm

Replying to gk:

This should be reviewed once we switched to an ESR60-based tor-browser branch.

Is this something we could merge before switching to ESR60, or would this cause some issues with the ESR52 build?

comment:5 in reply to:  4 Changed 15 months ago by gk

Replying to boklm:

Replying to gk:

This should be reviewed once we switched to an ESR60-based tor-browser branch.

Is this something we could merge before switching to ESR60, or would this cause some issues with the ESR52 build?

I doubt it would cause issues. I think I just don't want to have this in the next alpha (to avoid surprises) assuming this is the last one ESR52-based. Once it is out next week. I am fine merging this patch even though we might not directly switch to ESR60 then.

comment:6 Changed 15 months ago by tom

Been talking to a cypherpunk a bit lately; they tipped me off to file https://bugzilla.mozilla.org/show_bug.cgi?id=1456575

I don't know if mingw-clang needs either of these things though....

comment:7 Changed 15 months ago by gk

Keywords: TorBrowserTeam201805R added; TorBrowserTeam201804R removed

Moving review tickets to May.

comment:8 Changed 14 months ago by boklm

After building using this patch, and firefox 52.8, I have the following error:

/var/tmp/dist/mingw-w64/helpers/i686-w64-mingw32-g++ -std=gnu++11 -mwindows -o Unified_cpp_media_libstagefright1.o -c -I/var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dis
t/stl_wrappers  -DNDEBUG=1 -DTRIMMED=1 -DANDROID_SMP=0 -DLOG_NDEBUG=1 -DHAVE_MS_C_RUNTIME -D__PRETTY_FUNCTION__=__FUNCTION__ -DFAKE_LOG_DEVICE -DSTATIC_EXPORTABLE_JS_API
 -DMOZ_HAS_MOZGLUE -DMOZILLA_INTERNAL_API -DIMPL_LIBXUL -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright -I/var/tmp/build/firefox-f8f42fea2af3/obj-mingw/media/
libstagefright -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/ports/win32/include -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/binding/include
-I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/frameworks/av/include -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/frameworks/av/include/media/s
tagefright/foundation -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/frameworks/av/media/libstagefright -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagef
right/stubs/empty -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/stubs/include -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/stubs/include/media
/stagefright/foundation -I/var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/system/core/include -I/var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include  -I/v
ar/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/nspr -I/var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/nss         -DMOZILLA_CLIENT -include /var/tmp
/build/firefox-f8f42fea2af3/obj-mingw/mozilla-config.h -MD -MP -MF .deps/Unified_cpp_media_libstagefright1.o.pp  -Wall -Wc++11-compat -Wempty-body -Wignored-qualifiers -
Woverloaded-virtual -Wpointer-arith -Wsign-compare -Wtype-limits -Wunreachable-code -Wwrite-strings -Wno-invalid-offsetof -Wc++14-compat -Wno-error=maybe-uninitialized -
Wno-error=deprecated-declarations -Wno-error=array-bounds -Wno-format -fno-lifetime-dse -fno-exceptions -fno-strict-aliasing -mms-bitfields -mstackrealign -fno-keep-inli
ne-dllexport -fno-rtti -fno-exceptions -fno-math-errno -pthread -pipe  -g -O -fno-omit-frame-pointer  -Wno-format -Wno-format-security -Wno-multichar -Wno-sign-compare -
Wno-unused  /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/media/libstagefright/Unified_cpp_media_libstagefright1.cpp
In file included from /var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr.h:148:0,
                 from /var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/ext/atomicity.h:35,
                 from /var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/bits/ios_base.h:39,
                 from /var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/ios:42,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/stl_wrappers/ios:44,
                 from /var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/ostream:38,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/stl_wrappers/ostream:44,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/mozilla/gfx/BasePoint.h:10,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/mozilla/gfx/Point.h:13,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/nsSize.h:11,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/dist/include/MediaData.h:11,
                 from /var/tmp/build/firefox-f8f42fea2af3/media/libstagefright/binding/Adts.cpp:6,
                 from /var/tmp/build/firefox-f8f42fea2af3/obj-mingw/media/libstagefright/Unified_cpp_media_libstagefright0.cpp:2:
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:47:9: error: 'pthread_t' does not name a type
 typedef pthread_t __gthread_t;
         ^~~~~~~~~
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:48:9: error: 'pthread_key_t' does not name a type
 typedef pthread_key_t __gthread_key_t;
         ^~~~~~~~~~~~~
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:49:9: error: 'pthread_once_t' does not name a type
 typedef pthread_once_t __gthread_once_t;
         ^~~~~~~~~~~~~~
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:50:9: error: 'pthread_mutex_t' does not name a type
 typedef pthread_mutex_t __gthread_mutex_t;
         ^~~~~~~~~~~~~~~
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:51:9: error: 'pthread_mutex_t' does not name a type
 typedef pthread_mutex_t __gthread_recursive_mutex_t;
         ^~~~~~~~~~~~~~~
/var/tmp/dist/mingw-w64/i686-w64-mingw32/include/c++/6.4.0/i686-w64-mingw32/bits/gthr-default.h:52:9: error: 'pthread_cond_t' does not name a type
 typedef pthread_cond_t __gthread_cond_t;
[...]

So it looks like something we want to merge at the same time as switching to ESR60.

comment:9 in reply to:  8 Changed 14 months ago by gk

Replying to boklm:

So it looks like something we want to merge at the same time as switching to ESR60.

Yes, that's what I said in comment:3. It seems I've been a bit too optimistic in comment:5, though. :)

comment:10 Changed 14 months ago by boklm

This patch looks good to me. I rebased it on master in my branch bug_25832_v2:
https://gitweb.torproject.org/user/boklm/tor-browser-build.git/commit/?h=bug_25832_v2&id=9af1ea49a225b3a8582be29172cc3f25ef5c215b

And I am now trying a build of #25894.

comment:11 Changed 14 months ago by gk

Keywords: TorBrowserTeam201806R added; TorBrowserTeam201805R removed

Moving review tickets to June.

comment:12 Changed 14 months ago by boklm

Resolution: fixed
Status: needs_reviewclosed

I pushed this patch to master as commit 9af1ea49a225b3a8582be29172cc3f25ef5c215b.

Note: See TracTickets for help on using tickets.