lifting-bits / remill

Library for lifting machine code to LLVM bitcode
Apache License 2.0
1.22k stars 143 forks source link

remill build failure with freestanding mode #707

Closed archercreat closed 2 months ago

archercreat commented 2 months ago

I'm using clean ubuntu 24.04 server VM with packages listed in README description.

$ lsb_release -a
Distributor ID: Ubuntu
Description:    Ubuntu 24.04 LTS
Release:        24.04
Codename:       noble

The errors I get:

In file included from /usr/lib/gcc/i686-linux-gnu/14/../../../../include/c++/14/bits/specfun.h:50:
/usr/lib/gcc/i686-linux-gnu/14/../../../../include/c++/14/tr1/ell_integral.tcc:84:14: error: no member named '__throw_domain_error' in namespace 'std'; did you mean '__throw_runtime_error'

and

In file included from /usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/cmath:41:
/usr/lib/gcc/x86_64-linux-gnu/13/../../../../include/c++/13/bits/requires_hosted.h:34:4: error: "This header is not available in freestanding mode."

I've tried to build cxx-common from source and pre-built versions. I've tried using gcc 13 (from build-essentials) and clang-18. I get the same error all the time.

my cmake cmdline:

CC=clang-18 CXX=clang++-18 cmake -DCMAKE_INSTALL_PREFIX=../remill-install -DCMAKE_TOOLCHAIN_FILE=/home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-linux-rel ..

cmake logs:

-- ccache: enabled with '/usr/bin/ccache'. The cache folder is located here: '/home/archer/.ccache'
-- The C compiler identification is Clang 18.1.3
-- The CXX compiler identification is Clang 18.1.3
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /usr/bin/clang-18
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/clang-18 - 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/clang++-18 - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Install prefix: /home/archer/remill/remill-install
CMake Deprecation Warning at cmake/utils.cmake:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.
Call Stack (most recent call first):
  CMakeLists.txt:24 (include)

-- Compiler ID is Clang
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success
-- Found Threads: TRUE
-- Found ZLIB: /home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/installed/x64-linux-rel/lib/libz.a (found version "1.3.0")
-- Found zstd: /home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/installed/x64-linux-rel/lib/libzstd.a
-- Found Z3: z3::libz3 (found suitable version "4.12.1", minimum required is "4.7.1")
-- LLVM Libraries: LLVMSupport;LLVMCore;LLVMIRReader;LLVMBitReader;LLVMBitWriter;LLVMPasses;LLVMAsmPrinter;LLVMAArch64Info;LLVMAArch64Desc;LLVMAArch64CodeGen;LLVMAArch64AsmParser;LLVMARMCodeGen;LLVMARMAsmParser;LLVMInterpreter;LLVMMCJIT;LLVMNVPTXDesc;LLVMX86Info;LLVMX86CodeGen;LLVMX86AsmParser;LLVMSparcCodeGen;LLVMSparcAsmParser;LLVMWebAssemblyDesc
-- Found LLVM 17.0.6
-- Using LLVMConfig.cmake in: /home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/installed/x64-linux-rel/share/llvm
Remill llvm version: 17
-- The following compiler has been selected to compile the bitcode: /home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/installed/x64-linux-rel/bin/clang-17
-- The following linker has been selected to link the bitcode: /home/archer/vcpkg_ubuntu-22.04_llvm-17-liftingbits-llvm_amd64/installed/x64-linux-rel/bin/llvm-link
-- Found Git: /usr/bin/git (found version "2.43.0")
-- Using Ghidra version 10.3 at git ref 80ccdad
-- Populating ghidrasource
-- Configuring done (0.1s)
-- Generating done (0.0s)
archercreat commented 2 months ago

Okay, my bad. The 24.04 is not supported.