Skip to content

compile under mingw-64/gcc-15.2+toolchain #18

Description

@sazanka-lab

こんにちは。
shtsumeを試してみました。
当方mingw-w64下(mingw-64-X86_64_gcc 15.2)でbuildして動作を確認しました。
lddでexeを拝見するとlibwintphread-1.dllが確かに外部参照で残っていますね。
取敢えずMakefileのcflagとldflagに-staticを付けてrebuildするとmingwには依存しなくなります。

$ ldd shtsume
	ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffe522c0000)
	KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffe50740000)
	KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffe4f570000)
	msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffe50640000)
	libwinpthread-1.dll => /mingw64/bin/libwinpthread-1.dll (0x7ffe46d80000)

..
cat Makefile
...
CXXFLAGS = -static -std=c11 -Wall -O3
LDFLAGS = -static -lpthread
...(make clean:make)

$ ldd shtsume
	ntdll.dll => /c/WINDOWS/SYSTEM32/ntdll.dll (0x7ffe522c0000)
	KERNEL32.DLL => /c/WINDOWS/System32/KERNEL32.DLL (0x7ffe50740000)
	KERNELBASE.dll => /c/WINDOWS/System32/KERNELBASE.dll (0x7ffe4f570000)
	msvcrt.dll => /c/WINDOWS/System32/msvcrt.dll (0x7ffe50640000)

もしやmingwインストールが敷居になってinstallを躊躇ってる方もいるかもしれないので…ご報告しておきます。
以上、宜しくお願いします。

//また、プロセッサと環境に依りますが、-march=native -Ofastでcompileすると若干高速になるようです。(skylake-sp)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions