View Single Post
Old 9th November 2019, 00:51   #83  |  Link
qyot27
...?
 
qyot27's Avatar
 
Join Date: Nov 2005
Location: Florida
Posts: 1,420
-DCMAKE_EXE_LINKER_FLAGS="-static-libstdc++ -static -pthread" when configuring resolves it with vanilla MSys2 with default repo packages.

Comparison with ldd:
'plain' build without the additional linker flags:
Code:
$ ldd tsmuxer-plain.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7fff09500000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7fff09400000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7fff065f0000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7fff07910000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7fff072f0000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7fff07350000)
        zlib1.dll => /mingw64/bin/zlib1.dll (0x62e80000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7fff08d10000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7fff07510000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7fff06490000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7fff07b40000)
        gdiplus.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.418_none_17b1a56c6d9fd02b/gdiplus.dll (0x7ffed5a00000)
        libgcc_s_seh-1.dll => /mingw64/bin/libgcc_s_seh-1.dll (0x61440000)
        libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x64940000)
        libstdc++-6.dll => /mingw64/bin/libstdc++-6.dll (0x6fc40000)
        combase.dll => /c/WINDOWS/System32/combase.dll (0x7fff089d0000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7fff08000000)
        bcryptPrimitives.dll => /c/WINDOWS/System32/bcryptPrimitives.dll (0x7fff06af0000)
With the linker flags given above:
Code:
$ ldd tsmuxer.exe
        ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7fff09500000)
        KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7fff09400000)
        KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7fff065f0000)
        GDI32.dll => /c/WINDOWS/System32/GDI32.dll (0x7fff07910000)
        win32u.dll => /c/WINDOWS/System32/win32u.dll (0x7fff072f0000)
        gdi32full.dll => /c/WINDOWS/System32/gdi32full.dll (0x7fff07350000)
        msvcp_win.dll => /c/WINDOWS/System32/msvcp_win.dll (0x7fff07510000)
        ucrtbase.dll => /c/WINDOWS/System32/ucrtbase.dll (0x7fff06490000)
        USER32.dll => /c/WINDOWS/System32/USER32.dll (0x7fff07b40000)
        msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7fff08d10000)
        gdiplus.dll => /c/WINDOWS/WinSxS/amd64_microsoft.windows.gdiplus_6595b64144ccf1df_1.1.18362.418_none_17b1a56c6d9fd02b/gdiplus.dll (0x7ffed5a00000)
        combase.dll => /c/WINDOWS/System32/combase.dll (0x7fff089d0000)
        RPCRT4.dll => /c/WINDOWS/System32/RPCRT4.dll (0x7fff08000000)
        bcryptPrimitives.dll => /c/WINDOWS/System32/bcryptPrimitives.dll (0x7fff06af0000)
The actual filesizes also corroborate this; the binary using the above linker flags is a whole 3MB larger (before stripping).
qyot27 is offline   Reply With Quote