User forums > General (but related to Code::Blocks)

Mystery of the executable size

<< < (2/3) > >>

nenin:

--- Quote from: ollydbg on July 04, 2023, 03:02:52 am ---If I remember correctly, the libwinpthread-1.dll (thread library) is only allowed to be linked dynamically. I guess you are using mingw64 based gcc? maybe the gcc inside msys2/mingw64.

--- End quote ---
It is correct, but if standard libs are linked statically and project does not require pthreads libwinpthread-1.dll is not necessary and should not appears in dependencies.

ollydbg:

--- Quote from: nenin on July 04, 2023, 08:31:15 am ---
--- Quote from: ollydbg on July 04, 2023, 03:02:52 am ---If I remember correctly, the libwinpthread-1.dll (thread library) is only allowed to be linked dynamically. I guess you are using mingw64 based gcc? maybe the gcc inside msys2/mingw64.

--- End quote ---
It is correct, but if standard libs are linked statically and project does not require pthreads libwinpthread-1.dll is not necessary and should not appears in dependencies.

--- End quote ---

In my memory, I think lib winpthread is a hard dependency that you can't remove. You can ask mingw64 devs for further question.  :)

stahta01:

--- Quote from: ollydbg on July 04, 2023, 09:36:17 am ---In my memory, I think lib winpthread is a hard dependency that you can't remove. You can ask mingw64 devs for further question.  :)

--- End quote ---

It is a hard requirement when building GCC when several libs are built.

The OP might try the new MINGW GCC using non posix threads and see if the exe is smaller.

Edit: Add link https://winlibs.com/ See the ones with MCF threads

Tim S.

nenin:

--- Quote from: ollydbg on July 04, 2023, 09:36:17 am ---In my memory, I think lib winpthread is a hard dependency that you can't remove. You can ask mingw64 devs for further question.  :)

--- End quote ---
Standard libs are under authority of the GNU, not MinGW64-w. It is why winpthread appeared actually.
Now it looks like this (see attach)

nenin:

--- Quote from: stahta01 on July 04, 2023, 05:13:06 pm ---The OP might try the new MINGW GCC using non posix threads and see if the exe is smaller.

--- End quote ---
exe size is not pumped by thread libs, actually they all are compact.  I suppose bloating  is the result of the implementation of the C++ std functionality.  Even with dynamic linking a lot of stuff is in-lined and generated a solid footprint.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version