Skip to content

SymCC fails to compile with -DTARGET_32BIT=ON #159

Open
@PwnVerse

Description

@PwnVerse

Here are the steps to reproduce the issue. Note that I have already built z3 separately.

git clone [email protected]:eurecom-s3/symcc.git
cd symcc 
git submodule init
git submodule update
mkdir build && cd build
cmake -G Ninja -DQSYM_BACKEND=ON -DTARGET_32BIT=ON -DZ3_TRUST_SYSTEM_VERSION=ON ..
ninja check

Fails with -

[9/22] Performing configure step for 'SymRuntime32'
FAILED: SymRuntime32-prefix/src/SymRuntime32-stamp/SymRuntime32-configure /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-stamp/SymRuntime32-configure 
cd /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-build && /usr/bin/cmake -DCMAKE_AR=/usr/bin/ar -DCMAKE_C_COMPILER=/usr/bin/cc -DCMAKE_C_FLAGS= "-DCMAKE_C_FLAGS_INIT=  " -DCMAKE_CXX_COMPILER=/usr/bin/c++ -DCMAKE_CXX_FLAGS= "-DCMAKE_CXX_FLAGS_INIT=  " -DCMAKE_EXE_LINKER_FLAGS= "-DCMAKE_EXE_LINKER_FLAGS_INIT=  " -DCMAKE_MAKE_PROGRAM=/home/ritvik/.local/bin/ninja -DCMAKE_MODULE_LINKER_FLAGS= "-DCMAKE_MODULE_LINKER_FLAGS_INIT=  " -DCMAKE_SHARED_LINKER_FLAGS= "-DCMAKE_SHARED_LINKER_FLAGS_INIT=  " -DCMAKE_MODULE_PATH=/home/ritvik/Desktop/Files/test/symcc/cmake -DCMAKE_SYSROOT= -DQSYM_BACKEND=ON -DCMAKE_BUILD_TYPE= -DZ3_TRUST_SYSTEM_VERSION=ON "-DCMAKE_C_FLAGS=\" -m32\"" "-DCMAKE_CXX_FLAGS=\" -m32\"" -DZ3_DIR= -DLLVM_DIR= -GNinja /home/ritvik/Desktop/Files/test/symcc/runtime && /usr/bin/cmake -E touch /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-stamp/SymRuntime32-configure
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc - broken
CMake Error at /usr/share/cmake-3.22/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/bin/cc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-build/CMakeFiles/CMakeTmp
    
    Run Build Command(s):/home/ritvik/.local/bin/ninja cmTC_a5f77 && [1/2] Building C object CMakeFiles/cmTC_a5f77.dir/testCCompiler.c.o
    FAILED: CMakeFiles/cmTC_a5f77.dir/testCCompiler.c.o 
    /usr/bin/cc   " -m32" -o CMakeFiles/cmTC_a5f77.dir/testCCompiler.c.o -c /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-build/CMakeFiles/CMakeTmp/testCCompiler.c
    cc: warning:  -m32: linker input file unused because linking not done
    cc: error:  -m32: linker input file not found: No such file or directory
    ninja: build stopped: subcommand failed.
    
    

  

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:17 (project)


-- Configuring incomplete, errors occurred!
See also "/home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-build/CMakeFiles/CMakeOutput.log".
See also "/home/ritvik/Desktop/Files/test/symcc/build/SymRuntime32-prefix/src/SymRuntime32-build/CMakeFiles/CMakeError.log".
[12/22] Performing configure step for 'SymRuntime'
-- The C compiler identification is GNU 11.4.0
-- The CXX compiler identification is GNU 11.4.0
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Could NOT find Z3 (missing: Z3_DIR)
-- Looking for C++ include filesystem
-- Looking for C++ include filesystem - found
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED
-- Performing Test CXX_FILESYSTEM_NO_LINK_NEEDED - Success
-- Configuring done
-- Generating done
-- Build files have been written to: /home/ritvik/Desktop/Files/test/symcc/build/SymRuntime-prefix/src/SymRuntime-build
[14/22] Building CXX object CMakeFiles/Symbolize.dir/compiler/Pass.cpp.o
ninja: build stopped: subcommand failed.

The reason I see is that it's trying to use the -m32 flag as " -m32" in it's arguments. Please let me know if I'm missing something trivial.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions