rizsotto / Bear

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

bear not work #552

Closed zxx1234 closed 8 months ago

zxx1234 commented 9 months ago

Describe the bug A clear and concise description of what the bug is.

To Reproduce Steps to reproduce the behavior:

Expected behavior A clear and concise description of what you expected to happen.

Environment:

Additional context

Before you send...

zxx1234 commented 9 months ago

1.get bear source and compile. cmake ../Bear-2.4.3/ -DCMAKE_C_COMPILER_ARG1="-m32"; VERBOSE=1 make all; cmake ../Bear-2.4.3/ -DCMAKE_C_COMPILER_ARG1="-m64"; VERBOSE=1 make all;

2.compile ok and check the libear.so. (dir 64-- 64bit , dir 32--32bit) xxxx@ubuntu:~/workspace/tools/64/libear$ file libear.so libear.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, BuildID[sha1]=60bcee5e81fab27ba1e7c08abad2cf8550a54d4f, not stripped

xxxx@ubuntu:~/workspace/tools/32/libear$ file libear.so libear.so: ELF 32-bit LSB shared object, Intel 80386, version 1 (SYSV), dynamically linked, BuildID[sha1]=e8db844222fb7ac596c657af5fec11f1f44696dc, not stripped

3.use bear to make,but fail xxxx@ubuntu:~/workspace$ bear --libear /home/workspace/tools/32/libear/libear.so make ERROR: ld.so: object '/home/workspace/tools/32/libear/libear.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.

xxxx@ubuntu:~/workspace$ bear --libear /home/workspace/tools/64/libear/libear.so make ERROR: ld.so: object '/home/workspace/tools/64/libear/libear.so' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS64): ignored.

how to fix it .thanks.

rizsotto commented 8 months ago

Hey @zxx1234 ,

The multilib issue is documented on the wiki. You probably want to have a look at it. And I would also recommend to read man ld.so page, "Dynamic string token" section.

But since the multilib is not tested in CI, it might be broken. Sorry for that!