-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Canadian cross toolchain for Windows depends on libwinpthread-1.dll #1869
Comments
Why not? |
Well, as usual I guess it makes sense to understand clearly why we need to do that [package some additional library]. And I don't like a lot such kind of explanation like "because this is needed by our built artifact". Especially when I know cases it might not be strictly needed. So why switching from native Win32 threads to Pthreads? |
std:thread requires pthread library on Windows. Don't know If GCC or any other tools (like GDB) require std::thread |
@abrodkin - have you tried removing I do understand and agree with your point about wanting to understand the reason for this change. 🙂 |
As a matter of fact, that's what we used to use for a long time. And a Windows cross-toolchain toolchain gets built, you may even try it - it's a part of ARC GNU IDE, see https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2022.09-rc1/arc_gnu_2022.09-rc1_ide_win_install.exe It has both C & C++ compilers for ARC processors. |
I think we should package |
Some background: we build re-distributable Windows cross-toolchain (Elf or bare-metal, i.e. not Linux) which is supposed to cross-compile for some embedded processors (in our case these are ARC processors, but that doesn't matter). We use Linux build infrastructure for building toolchains and so we utilize the following 2-stage approach:
CT_CANADIAN=y
&CT_HOST=i686-w64-mingw32
orCT_HOST=x86_64-w64-mingw32
).And the problem we recently bumped into was an additional dependency of Windows binaries on some
libwinpthread-1.dll
, see foss-for-synopsys-dwc-arc-processors/toolchain#495.Basically, cross GCC and G++ fail to start because of the missing dependency:
libwinpthread-1.dll
.Apparently, the reason for that additional dependency was
CT_THREADS_POSIX=y
set incrosstool-ng/samples/x86_64-w64-mingw32/crosstool.config
and now after a8d2c2e insamples/i686-w64-mingw32/crosstool.config
.And while I'm not an expert in Windows runtime, even after reading of https://stackoverflow.com/questions/17242516/mingw-w64-threads-posix-vs-win32 I don't quite understand which problems if at all there might be if we use "native" Win32 threads implentation in the MinGW toolchain, which only purpose is to build cross-toolchains for Windows in the canadian cross manner.
That said, this is more of a memo for myself and a heads-up for those who might be interested in building Windows cross-toolchains as well. And I'm not sure if there's a point in suggesting to remove
CT_THREADS_POSIX=y
from all MinGW "samples" here in Crosstool-NG.Interesting enough is @stilor did see a similar problem when he introduced that switch to Pthreads, see e082dd8 (which is a part of a bigger PR #484):
So, it's not clear what would be the best solution here. From @stilor's comment it seems like Pthreads solved some problem of building
x86_64-pc-linux-gnu
(but I'm yet to figure out what was that, unfortunately there's no description provided in the corresponding commit message), but at the same time it makes built toolchain not re-distributable unless we packagelibwinpthread-1.dll
in that toolchain, which I'm not sure if we really want to do.The text was updated successfully, but these errors were encountered: