Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to Compile with "-DTARGET_32BIT=ON" #106

Open
UESuperGate opened this issue Aug 16, 2022 · 1 comment
Open

Failed to Compile with "-DTARGET_32BIT=ON" #106

UESuperGate opened this issue Aug 16, 2022 · 1 comment
Assignees
Labels
question Further information is requested

Comments

@UESuperGate
Copy link

According to the instructions from docs/32-bit.txt, I built up the environment as follow:

  1. Z3 version 4.8.3, compiled by cmake with CXX_FLAGS="-m32" C_FLAGS="-m32".
  2. LLVM version 12.0.0, compiled by cmake with CXX_FLAGS="-m32" C_FLAGS="-m32".
  3. Ubuntu 20.04.

I set up the compilation configuration of SymCC as follow:

cmake -DQSYM_BACKEND=ON -DTARGET_32BIT=ON -DLLVM_32BIT_DIR="/home1/qingyu/benchmark/llvm-project/build" -DZ3_32BIT_DIR="/home1/qingyu/benchmark/z3/install/lib/cmake/z3"  ..

And I got the failure messages:
image

And if I try to modify the cmake arguments like this:

cmake -DQSYM_BACKEND=ON -DTARGET_32BIT=ON -DLLVM_32BIT_DIR="/home1/qingyu/benchmark/llvm-project/build" -DZ3_32BIT_DIR="/home1/qingyu/benchmark/z3/install/lib/cmake/z3" -DZ3_TRUST_SYSTEM_VERSION=on  ..

It will still fail with the messages:

[100%] Linking CXX shared library ../libSymRuntime.so
/usr/bin/ld: CMakeFiles/SymRuntime.dir/Runtime.cpp.o: in function `_sym_initialize':
Runtime.cpp:(.text+0x8c8): warning: the use of `tmpnam' is dangerous, better use `mkstemp'
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ABIBreak.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(APInt.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Debug.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ErrorHandling.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(FoldingSet.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Hashing.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ManagedStatic.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(MemAlloc.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(SmallVector.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(StringRef.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Twine.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(raw_ostream.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Path.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Process.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Program.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Signals.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Threading.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(APFloat.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(circular_raw_ostream.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(CommandLine.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ConvertUTFWrapper.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(CrashRecoveryContext.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Error.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(FormatVariadic.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(MemoryBuffer.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(MD5.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(NativeFormatting.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(SmallPtrSet.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(StringExtras.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(StringMap.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(StringSaver.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Triple.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(VirtualFileSystem.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(YAMLParser.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Errno.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Host.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ThreadLocal.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ARMTargetParser.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(ConvertUTF.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(SourceMgr.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Unicode.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(WithColor.cpp.o)' is incompatible with i386:x86-64 output
/usr/bin/ld: i386 architecture of input file `/home1/qingyu/benchmark/llvm-project/build/lib/libLLVMSupport.a(Locale.cpp.o)' is incompatible with i386:x86-64 output
...
...
collect2: error: ld returned 1 exit status
make[5]: *** [qsym_backend/CMakeFiles/SymRuntime.dir/build.make:351: libSymRuntime.so] Error 1
make[4]: *** [CMakeFiles/Makefile2:94: qsym_backend/CMakeFiles/SymRuntime.dir/all] Error 2
make[3]: *** [Makefile:84: all] Error 2
make[2]: *** [CMakeFiles/SymRuntime.dir/build.make:112: SymRuntime-prefix/src/SymRuntime-stamp/SymRuntime-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:154: CMakeFiles/SymRuntime.dir/all] Error 2
make: *** [Makefile:84: all] Error 2
@sebastianpoeplau
Copy link
Collaborator

Sorry for the extremely late reply. The linker error suggests that your Z3 library is a 64-bit one.

Z3 version 4.8.3, compiled by cmake with CXX_FLAGS="-m32" C_FLAGS="-m32".

It should be CFLAGS and CXXFLAGS, no underscore. Can you check with file /path/to/your/binary/z3 whether Z3 is a 32-bit or 64-bit library?

@sebastianpoeplau sebastianpoeplau self-assigned this Nov 4, 2022
@sebastianpoeplau sebastianpoeplau added the question Further information is requested label Nov 4, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants