rizsotto / Bear

Bear is a tool that generates a compilation database for clang tooling.
GNU General Public License v3.0
4.66k stars 308 forks source link

build error with xt-clang #490

Open lenghonglin opened 1 year ago

lenghonglin commented 1 year ago

Describe the bug

image

i use xt-clang to make, but it seem glib_version is not right

image

To Reproduce 100%

Environment: OS name: arch linux Bear version: 3.0.20 Bear install method: pacman xt-clang version: image

rizsotto commented 1 year ago

Hey @lenghonglin , thanks for the report. That's an interesting one... You installed Bear from Arch's package (which was probably compiled against the default libstdc++.so). And now you are running a process (xt-clang), which has its own version of that library. And because the libexec.so library is loaded into the xt-clang process memory, they are forced to share the symbols.

Could you try to run Bear in a wrapper mode? (Need to pass --force-wrapper flag. And make sure your build is support compiler from the CC or CXX environments.) This way the libexec.so is not loaded into the same process, and probably will work around this problem.

nokia-git commented 1 year ago

I have the same issue. Before i use the force wrapper flag, the make flow finished, and the compile_commands.json seems "correct". After use the force wrapper flag, there are not any warning or error msg, but i got a empty compile_commands.json ...

rizsotto commented 1 year ago

@nokia-git , for empty compilation database, there is a section on the troubleshooting guide which gives you hint what can cause it.