WrapEarnPass left a comment (geany/geany#4620)
@nyamatongwe I owe you a **massive** apology. Out of sheer morbid obesity, I
tried building a main.cxx via geany's meson that did nothing but fork a bunch
of standard futures.
GTK has nothing to do with this problem. Meson is including/ignoring things
that an direct g++ invocation is providing for cross platform builds.
I am going to retract my pull request, but I would suggest to the maintainers
that that single thread fast path that you suggested get implemented. The fast
path is called like 399/400 times. That's a lot of threading for nothing.
My main.cxx
```
int main(int argc, char **argv)
{
std::cout <<"maincall" << std::endl;
std::vector<std::future<void>> futures;
std::atomic<size_t> nextIndex = 0;
for (size_t th = 0; th < 20; th++) {
std::future<void> fut =
std::async(std::launch::async,[&nextIndex](){
const size_t i = nextIndex.fetch_add(1,
std::memory_order_acq_rel);
std::cout <<"Thread number:" << i << std::endl;
});
futures.push_back(std::move(fut));
}
for (const std::future<void> &f : futures) {
f.wait();
}
return 0;
}
```
This is a direct invocation of g++ against my main.cxx.
```
COLLECT_GCC_OPTIONS='-o' 'main.exe' '-v' '-std=c++17' '-mcrtdll=ucrtbase'
'-march=x86-64-v2' '-mtune=generic' '-shared-libgcc' '-dumpdir' 'main.'
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/collect2 -plugin
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccqxsDHv.res -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lucrtbase
-plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lucrtbase -plugin-opt=-pass-through=-lkernel32 -m
i386pep -Bdynamic -o main.exe
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib/crt2.o
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtbegin.o
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib
/tmp/ccr0jLVY.o -Bstatic -lstdc++ -Bdynamic -lmingw32 -lgcc_s -lgcc -lmingwex
-lucrtbase -lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32
-lmingw32 -lgcc_s -lgcc -lmingwex -lucrtbase -lkernel32
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtend.o
COLLECT_GCC_OPTIONS='-o' 'main.exe' '-v' '-std=c++17' '-mcrtdll=ucrtbase'
'-march=x86-64-v2' '-mtune=generic' '-shared-libgcc' '-dumpdir' 'main.'
```
this main.exe works fine.
<img width="313" height="442" alt="Image"
src="https://github.com/user-attachments/assets/a37d5590-ff3c-4fa1-a31a-3ab13f7aaf5e"
/>
This is dropping my main.cxx into meson.build
```
COLLECT_GCC_OPTIONS='-o' 'geany.exe' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'geany.'
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/collect2 -plugin
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/liblto_plugin.so
-plugin-opt=/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/lto-wrapper
-plugin-opt=-fresolution=/tmp/cckSrvFd.res -plugin-opt=-pass-through=-lmingw32
-plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lmingwex -plugin-opt=-pass-through=-lmsvcrt
-plugin-opt=-pass-through=-lkernel32 -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-ladvapi32 -plugin-opt=-pass-through=-lshell32
-plugin-opt=-pass-through=-luser32 -plugin-opt=-pass-through=-lkernel32
-plugin-opt=-pass-through=-lmingw32 -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lmingwex
-plugin-opt=-pass-through=-lmsvcrt -plugin-opt=-pass-through=-lkernel32 -m
i386pep -Bdynamic -o geany.exe
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib/crt2.o
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtbegin.o
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15
-L/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/../../../../x86_64-w64-mingw32ucrt/lib
geany_private.rc_geany_private.o geany.exe.p/src_main.cxx.obj
--allow-shlib-undefined --start-group -lole32 -lws2_32 -lcomdlg32 --subsystem
windows -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -loleaut32 -luuid
-ladvapi32 --end-group -lstdc++ -lmingw32 -lgcc_s -lgcc -lmingwex -lmsvcrt
-lkernel32 -lpthread -ladvapi32 -lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s
-lgcc -lmingwex -lmsvcrt -lkernel32
/usr/lib/gcc/x86_64-w64-mingw32ucrt/15/crtend.o
COLLECT_GCC_OPTIONS='-o' 'geany.exe' '-v' '-shared-libgcc' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'geany.'
```
It is not passing mcrtdll at all, which leads to it linking against msvcrt.
Ucrtbase is nowhere to be found, even though this compiler only knows ucrt.
I have meson problems to fix.
--
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/issues/4620#issuecomment-5059909766
You are receiving this because you are subscribed to this thread.
Message ID: <geany/geany/issues/4620/[email protected]>