[tbb-bugs] #23561 [Applications/Tor Browser]: Fix nsis builds for Windows 64

Tor Bug Tracker & Wiki blackhole at torproject.org
Mon Sep 18 17:04:34 UTC 2017

#23561: Fix nsis builds for Windows 64
 Reporter:  boklm                          |          Owner:  boklm
     Type:  task                           |         Status:  assigned
 Priority:  Medium                         |      Milestone:
Component:  Applications/Tor Browser       |        Version:
 Severity:  Normal                         |     Resolution:
 Keywords:  TorBrowserTeam201709, tbb-rbm  |  Actual Points:
Parent ID:  #20636                         |         Points:
 Reviewer:                                 |        Sponsor:

Comment (by boklm):

 I tried a build with the following patch:
 diff --git a/projects/nsis/build b/projects/nsis/build
 index af19dd7..c75dced 100755
 --- a/projects/nsis/build
 +++ b/projects/nsis/build
 @@ -16,7 +16,7 @@ do
      [ -f debian/patches/$patch ] && patch -p1 < debian/patches/$patch
  [% SET scons_args = 'APPEND_CCFLAGS="-fgnu89-inline" VERSION=' _
 -        _ " SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=i686-w64-mingw32-"
 +        _ " SKIPUTILS='NSIS Menu' XGCC_W32_PREFIX=" _ c("arch") _
          _ ' PREFIX=/var/tmp/dist/nsis' -%]
  scons [% scons_args %]
  scons [% scons_args %] install

 Which failed with the following error:
 x86_64-w64-mingw32-g++ -s -mwindows -Wl,--file-alignment,512
 -Wl,-Map,build/release/Banner/Banner.map -static-libgcc -static-libstdc++
 -Wl,-e_DllMain at 12 -nostdlib -Wl,--
 exclude-libs,msvcrt.a -shared -o build/release/Banner/Banner.dll
 build/release/Banner/Banner.o -Lbuild/release/api/nsis -lpluginapi
 -lkernel32 -luser32 -Wl,--out-implib,
 build/release/Banner/libBanner.a -Wl,--output-
 warning: cannot find entry symbol _DllMain at 12; defaulting to 000000006cf0
 x86_64-w64-mingw32-g++ -o build/release/BgImage/BgImage.o -c
 -fgnu89-inline -Os -Wall -fno-strict-aliasing
 -DNSISCALL='__attribute__((__stdcall__))' -Ibuild/release/api
 cc1plus: warning: command line option '-fgnu89-inline' is valid for C/ObjC
 but not for C++
 Contrib/BgImage/BgImage.cpp: In function 'void SetBg(HWND, int, char*,
 stack_t**, extra_parameters*)':
 Contrib/BgImage/BgImage.cpp:134:21: warning: cast to pointer from integer
 of different size [-Wint-to-pointer-cast]
 Contrib/BgImage/BgImage.cpp:152:49: error: 'GWL_WNDPROC' was not declared
 in this scope
      oldProc = (void *)SetWindowLong(hwndParent, GWL_WNDPROC,
 Contrib/BgImage/BgImage.cpp:152:68: error: cast from 'LRESULT (*)(HWND,
 UINT, WPARAM, LPARAM) {aka long long int (*)(HWND__*, unsigned int, long
 long unsigned int, long
 long int)}' to 'long int' loses precision [-fpermissive]
      oldProc = (void *)SetWindowLong(hwndParent, GWL_WNDPROC,
 Contrib/BgImage/BgImage.cpp: In function 'void AddText(HWND, int, char*,
 stack_t**, extra_parameters*)':
 Contrib/BgImage/BgImage.cpp:296:39: warning: cast to pointer from integer
 of different size [-Wint-to-pointer-cast]
    newImg->hFont = (HFONT)myatoi(szTemp);
 Contrib/BgImage/BgImage.cpp: In function 'void Destroy(HWND, int, char*,
 stack_t**, extra_parameters*)':
 Contrib/BgImage/BgImage.cpp:348:31: error: 'GWL_WNDPROC' was not declared
 in this scope
      SetWindowLong(hwndParent, GWL_WNDPROC, (long)oldProc);
 Contrib/BgImage/BgImage.cpp:348:50: error: cast from 'void*' to 'long int'
 loses precision [-fpermissive]
      SetWindowLong(hwndParent, GWL_WNDPROC, (long)oldProc);
 Contrib/BgImage/BgImage.cpp: In function 'LRESULT WndProc(HWND, UINT,
 Contrib/BgImage/BgImage.cpp:394:5: error: invalid conversion from 'long
 int (*)(HWND, unsigned int, unsigned int, long int) {aka long int
 (*)(HWND__*, unsigned int, unsi
 gned int, long int)}' to 'WNDPROC {aka long long int (*)(HWND__*, unsigned
 int, long long unsigned int, long long int)}' [-fpermissive]
 In file included from
                  from Contrib/BgImage/BgImage.cpp:1:
 note:   initializing argument 1 of 'LRESULT CallWindowProcA(WNDPROC, HWND,
 hWnd, UINT Msg, WPARAM wParam, LPARAM lParam);
 scons: *** [build/release/BgImage/BgImage.o] Error 1
 scons: building terminated because of errors.

Ticket URL: <https://trac.torproject.org/projects/tor/ticket/23561#comment:1>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online

More information about the tbb-bugs mailing list