Open ribose-jeffreylau opened 2 years ago
You install ninja so cmake uses ninja generator by default. There is build.ninja file that is essentially a makefile.
If you call
cmake --build .
it will select correct build system that matches configure step
You can also do
cmake .. -G "Unix Makefiles"
in order to get Makefile and not build.ninja
There is a problem here: https://github.com/riboseinc/libnereon/blob/master/src/CMakeLists.txt
LIBNEREON_LIBRARY is not defined as CMake target at all. Unix and MacOS versions of cmake somehow manage to create correct build sequence, but MSYS version fails. So the fix is required at libneron source.
Then there is an issue with RTLD_NEXT flag which is a bedrock of retrace technology. It is not POSIX and MSYS compilation with default settings considers it undefined
Probably
#define _GNU_SOURCE
#include <dlfcn.h>
can help but it needs to be tested as well
If msys (=unix) environment is used for compilation it is essentially cygwin that does not support GNU extensions to dlsysm So hooking with RTLD_NEXT does not compile and I did not find any port or extension
If mingw (=windows) environment is used for compilation, there is a package that pretends that it implements RTLD_NEXT -- https://packages.msys2.org/base/mingw-w64-dlfcn.
However, mingw lacks queue (https://man7.org/linux/man-pages/man7/queue.7.html) and may be some other GNU extensions.
So the only approach I see is to use mingw and adopt queue.h (I think it can be just dropped in).
I have to say that I am not MSYS expert so that all may be wrong.
So the only approach I see is to use mingw and adopt queue.h (I think it can be just dropped in).
Sounds like we can probably create a separate GitHub Action workflow for mingw to test this out, too.
I do not know, can make assumptions only. Now windows build looks like full scale project that requires some upfront experiments and research
Libnereon build fixed is here: https://github.com/riboseinc/retrace/pull/427
So the only approach I see is to use mingw and adopt queue.h (I think it can be just dropped in).
Sounds like we can probably create a separate GitHub Action workflow for mingw to test this out, too.
I made some tests locally. Mingw build fails fast because Windows SDK doeds not have Queue.h
Thanks @maxirmx ! This is good progress. I'll merge whatever we have now and figure the rest later.
https://github.com/riboseinc/retrace/runs/4656054619?check_suite_focus=true#step:5:384
Makefile
has not been generated at all.