capstone icon indicating copy to clipboard operation
capstone copied to clipboard

fix a top directory build ld error

Open fanfuqiang opened this issue 7 years ago • 5 comments

When in the top source directory use: cmake . & cmake --build . will cause a linker error : /usr/bin/ld: fatal error: cstool: open: Is a directory It's caused because build will generate a binary named cstool and we also have a directory with exactly the same name. This will cause some overwrite make liker confused and cause a mystical bug.

So my proposal is to change the directory cstool to cstool-src or something else diff with the cstool.

fanfuqiang avatar Dec 05 '18 00:12 fanfuqiang

call cmake generate capstone/Makefile first, please.

fanfuqiang avatar Dec 05 '18 00:12 fanfuqiang

interesting, but this breaks CI, because you havent updated Makefile yet.

aquynh avatar Dec 06 '18 15:12 aquynh

another issue with your way of building from root dir is that cmake will overwrite original Makefile. so you better create a directory, and compile from there, like recommended.

$ mkdir build
$ cd build
$ ../make.sh

aquynh avatar Dec 07 '18 02:12 aquynh

So how to describe the relations between CMakeLists.txt and the Makefile of the root directory? Is it come from cmake generate? If not, what's the purpose of CMakeLists.txt?

Of course, I have known to create a new clean directory to build the capstone. But for me, the intuitive chose is what uses the cmake.

fanfuqiang avatar Dec 09 '18 12:12 fanfuqiang

Makefile is for "make". We support "cmake" at the same time.

aquynh avatar Dec 11 '18 02:12 aquynh

Thank you for the PR! I closed it because it is out of date. With the new auto-sync update for v6 we made many changes to some main architectures and will do also to others. This also changed the requirements we have now for new PRs.

If you still want to merge the changes, please rebase your fix onto the newest next branch and open a new PR.

Rot127 avatar Mar 20 '24 09:03 Rot127