The International Simutrans Forum

 

Author Topic: Respect static  (Read 4677 times)

0 Members and 1 Guest are viewing this topic.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Respect static
« on: April 20, 2018, 08:01:23 PM »
The Makefile appear to be wanting to link pthread statically, but it is not happening with msys2+mingw64. After looking at verbose output from ld and a bit of trial and error, I've managed to get it to link statically. The required change looks a bit silly on the surface, but I think the underlying cause is that libstdc++ pulls in pthread implicitly somehow. Since libstdc++ is not linked explicitly, it, and pthread, is linked implicitly outside of the -Wl,-static scope.

Offline prissi

  • Developer
  • Administrator
  • *
  • Posts: 9309
  • Languages: De,EN,JP
Re: Respect static
« Reply #1 on: April 21, 2018, 02:10:52 PM »
I used the normal makefile in the mingw64 from Debian (which is ancient) and it works there. Must be a recent change.

Offline Ters

  • Coder/patcher
  • Devotee
  • *
  • Posts: 5368
  • Languages: EN, NO
Re: Respect static
« Reply #2 on: April 21, 2018, 05:58:35 PM »
It has been that way for as long as the mingw64 in msys2 has supported whichever C++ standard included threading stuff. However, if I remember correctly, the mingw64 that is available on Gentoo Linux is configured to use the win32 threading model, not the posix model that msys2's mingw64 builds are configured with, so its libstdc++ does not depend on libpthread.