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

fatal error: 'MemoryAllocator/CodeBuffer/code_buffer_x64.h' file not found #257

Open
trueToastedCode opened this issue Feb 6, 2024 · 2 comments

Comments

@trueToastedCode
Copy link

trueToastedCode commented Feb 6, 2024

lennard@MacBook-Air Dobby % python3 scripts/platform_builder.py --platform=macos --arch=all
/Users/lennard/Desktop/Dobby/scripts/platform_builder.py:2: DeprecationWarning: 'pipes' is deprecated and slated for removal in Python 3.13
  import pipes
2024-02-06 20:38:34,273 - INFO - project dir: /Users/lennard/Desktop/Dobby
2024-02-06 20:38:34,273 - INFO - build platform: macos, archs: ['x86_64', 'arm64', 'arm64e']
2024-02-06 20:38:34,281 - INFO - build platform: macos, arch: x86_64, cmake_build_dir: /Users/lennard/Desktop/Dobby/build/cmake-build-macos-x86_64, output_dir: /Users/lennard/Desktop/Dobby/build/macos/x86_64
cmake -S /Users/lennard/Desktop/Dobby -B /Users/lennard/Desktop/Dobby/build/cmake-build-macos-x86_64 -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_BUILD_TYPE=Release -DCMAKE_OSX_ARCHITECTURES=x86_64 -DCMAKE_SYSTEM_PROCESSOR=x86_64 -DCMAKE_SYSTEM_NAME=Darwin -DCMAKE_OSX_SYSROOT=/Applications/Xcode-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX14.0.sdk
-- The C compiler identification is Clang 17.0.6
-- The CXX compiler identification is Clang 17.0.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /opt/homebrew/opt/llvm/bin/clang - 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: /opt/homebrew/opt/llvm/bin/clang++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- The ASM compiler identification is Clang with GNU-like command-line
-- Found assembler: /opt/homebrew/opt/llvm/bin/clang
-- 
-- ********* build environment check ***********
-- 	Compiler: 	 Clang
-- 	Processor:	 x86_64
-- 	System:   	 macOS
-- ***************************************
-- 
-- CMAKE_C_COMPILER: /opt/homebrew/opt/llvm/bin/clang
-- CMAKE_CXX_COMPILER: /opt/homebrew/opt/llvm/bin/clang++
-- CMAKE_C_FLAGS:  -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -O3 -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden
-- CMAKE_CXX_FLAGS:  -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -O3 -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden 
-- CMAKE_SHARED_LINKER_FLAGS: 
-- [Dobby] CMAKE_BUILD_TYPE: Release
-- [Dobby] DOBBY_DEBUG: OFF
-- [Dobby] NearBranch: ON
-- [Dobby] FullFloatingPointRegisterPack: OFF
-- [Dobby] Plugin.SymbolResolver: ON
-- [Dobby] Plugin.ImportTableReplace: OFF
-- [Dobby] Plugin.Android.BionicLinkerUtil: OFF
-- [Dobby] DOBBY_BUILD_EXAMPLE: OFF
-- [Dobby] DOBBY_BUILD_TEST: OFF
-- [Dobby] DOBBY_BUILD_KERNEL_MODE: OFF
-- [Dobby] Private.Obfuscation: OFF
-- [Dobby] Dobby-20240206-809f8ca
-- Configuring done (0.4s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/lennard/Desktop/Dobby/build/cmake-build-macos-x86_64
-- 
-- ********* build environment check ***********
-- 	Compiler: 	 Clang
-- 	Processor:	 x86_64
-- 	System:   	 macOS
-- ***************************************
-- 
-- CMAKE_C_COMPILER: /opt/homebrew/opt/llvm/bin/clang
-- CMAKE_CXX_COMPILER: /opt/homebrew/opt/llvm/bin/clang++
-- CMAKE_C_FLAGS:  -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -O3 -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden
-- CMAKE_CXX_FLAGS:  -fvisibility=hidden -fPIC -fno-stack-check -fno-stack-protector -fno-exceptions -fno-rtti -fno-common -fno-zero-initialized-in-bss -O3 -fno-rtti -fvisibility=hidden -fvisibility-inlines-hidden 
-- CMAKE_SHARED_LINKER_FLAGS: 
-- [Dobby] CMAKE_BUILD_TYPE: Release
-- [Dobby] DOBBY_DEBUG: OFF
-- [Dobby] NearBranch: ON
-- [Dobby] FullFloatingPointRegisterPack: OFF
-- [Dobby] Plugin.SymbolResolver: ON
-- [Dobby] Plugin.ImportTableReplace: OFF
-- [Dobby] Plugin.Android.BionicLinkerUtil: OFF
-- [Dobby] DOBBY_BUILD_EXAMPLE: OFF
-- [Dobby] DOBBY_BUILD_TEST: OFF
-- [Dobby] DOBBY_BUILD_KERNEL_MODE: OFF
-- [Dobby] Private.Obfuscation: OFF
-- [Dobby] Dobby-20240206-809f8ca
-- Configuring done (0.0s)
-- Generating done (0.0s)
-- Build files have been written to: /Users/lennard/Desktop/Dobby/build/cmake-build-macos-x86_64
[  6%] Building CXX object CMakeFiles/dobby.dir/source/core/assembler/assembler-ia32.cc.o
[  6%] Building CXX object CMakeFiles/dobby.dir/source/InstructionRelocation/arm/InstructionRelocationARM.cc.o
[  6%] Building CXX object CMakeFiles/dobby.dir/source/core/codegen/codegen-arm.cc.o
[  6%] Building CXX object CMakeFiles/dobby.dir/source/core/assembler/assembler-x64.cc.o
[  6%] Building CXX object CMakeFiles/dobby.dir/source/core/assembler/assembler-arm.cc.o
[ 10%] Building CXX object CMakeFiles/dobby.dir/source/core/codegen/codegen-x64.cc.o
[ 13%] Building CXX object CMakeFiles/dobby.dir/source/core/codegen/codegen-ia32.cc.o
[ 16%] Building CXX object CMakeFiles/dobby.dir/source/InstructionRelocation/arm64/InstructionRelocationARM64.cc.o
[ 20%] Building CXX object CMakeFiles/dobby.dir/source/InstructionRelocation/x86/InstructionRelocationX86.cc.o
[ 20%] Building CXX object CMakeFiles/dobby.dir/source/InstructionRelocation/x64/InstructionRelocationX64.cc.o
[ 23%] Building CXX object CMakeFiles/dobby.dir/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc.o
[ 26%] Building C object CMakeFiles/dobby.dir/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c.o
[ 30%] Building CXX object CMakeFiles/dobby.dir/source/InterceptRouting/InstrumentRouting/instrument_routing_handler.cpp.o
[ 30%] Building CXX object CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_arm.cc.o
In file included from /Users/lennard/Desktop/Dobby/source/core/codegen/codegen-x64.cc:4:
In file included from /Users/lennard/Desktop/Dobby/./source/core/codegen/codegen-x64.h:6:
/Users/lennard/Desktop/Dobby/./source/core/assembler/assembler-x64.h:8:10: fatal error: 'MemoryAllocator/CodeBuffer/code_buffer_x64.h' file not found
    8 | #include "MemoryAllocator/CodeBuffer/code_buffer_x64.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
[ 33%] Building CXX object CMakeFiles/dobby.dir/source/TrampolineBridge/Trampoline/trampoline_arm64.cc.o
make[3]: *** [CMakeFiles/dobby.dir/source/core/codegen/codegen-x64.cc.o] Error 1
make[3]: *** Waiting for unfinished jobs....
In file included from /Users/lennard/Desktop/Dobby/source/core/assembler/assembler-x64.cc:4:
/Users/lennard/Desktop/Dobby/./source/core/assembler/assembler-x64.h:8:10: fatal error: 'MemoryAllocator/CodeBuffer/code_buffer_x64.h' file not found
    8 | #include "MemoryAllocator/CodeBuffer/code_buffer_x64.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
make[3]: *** [CMakeFiles/dobby.dir/source/core/assembler/assembler-x64.cc.o] Error 1
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c:4:
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.h:5:
In file included from /Users/lennard/Desktop/Dobby/./source/dobby/common.h:12:
In file included from /Users/lennard/Desktop/Dobby/./common/os_arch_features.h:5:
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:11:1: error: unknown type name 'template'
   11 | template <typename T> static inline T pac_strip(T &addr, bool keep = false) {
      | ^
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:11:10: error: expected identifier or '('
   11 | template <typename T> static inline T pac_strip(T &addr, bool keep = false) {
      |          ^
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:26:1: error: unknown type name 'template'
   26 | template <typename T> static inline T pac_sign(T &addr, bool keep = false) {
      | ^
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:26:10: error: expected identifier or '('
   26 | template <typename T> static inline T pac_sign(T &addr, bool keep = false) {
      |          ^
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:41:1: error: unknown type name 'template'
   41 | template <typename T> static inline T pac_strip_and_sign(T &addr) {
      | ^
/Users/lennard/Desktop/Dobby/./common/pac_kit.h:41:10: error: expected identifier or '('
   41 | template <typename T> static inline T pac_strip_and_sign(T &addr) {
      |          ^
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c:4:
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.h:5:
In file included from /Users/lennard/Desktop/Dobby/./source/dobby/common.h:12:
In file included from /Users/lennard/Desktop/Dobby/./common/os_arch_features.h:7:
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:5:1: error: unknown type name 'namespace'
    5 | namespace base {
      | ^
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:5:15: error: expected ';' after top level declarator
    5 | namespace base {
      |               ^
      |               ;
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:53:17: error: expected identifier or '('
   53 | struct OSThread : base::ThreadInterface, base::ThreadInterface::Delegate {
      |                 ^
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:71:1: error: unknown type name 'class'
   71 | class OSMemory {
      | ^
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:71:15: error: expected ';' after top level declarator
   71 | class OSMemory {
      |               ^
      |               ;
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:86:1: error: unknown type name 'class'
   86 | class OSPrint {
      | ^
/Users/lennard/Desktop/Dobby/./source/PlatformUnifiedInterface/platform.h:86:14: error: expected ';' after top level declarator
   86 | class OSPrint {
      |              ^
      |              ;
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c:4:
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.h:5:
In file included from /Users/lennard/Desktop/Dobby/./source/dobby/common.h:12:
/Users/lennard/Desktop/Dobby/./common/os_arch_features.h:13:1: error: unknown type name 'namespace'
   13 | namespace features {
      | ^
/Users/lennard/Desktop/Dobby/./common/os_arch_features.h:13:19: error: expected ';' after top level declarator
   13 | namespace features {
      |                   ^
      |                   ;
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x64/InstructionRelocationX64.cc:7:
In file included from /Users/lennard/Desktop/Dobby/./source/InstructionRelocation/x64/InstructionRelocationX64.h:9:
/Users/lennard/Desktop/Dobby/./source/InstructionRelocation/x86/InstructionRelocationX86Shared.h:16:30: error: unknown type name 'CodeBufferBase'
   16 |                              CodeBufferBase *code_buffer, x86_insn_decode_t &insn, int8_t mode);
      |                              ^
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x64/InstructionRelocationX64.cc:11:
/Users/lennard/Desktop/Dobby/./source/core/assembler/assembler-x64.h:8:10: fatal error: 'MemoryAllocator/CodeBuffer/code_buffer_x64.h' file not found
    8 | #include "MemoryAllocator/CodeBuffer/code_buffer_x64.h"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:7:
In file included from /Users/lennard/Desktop/Dobby/./source/InstructionRelocation/x86/InstructionRelocationX86.h:9:
/Users/lennard/Desktop/Dobby/./source/InstructionRelocation/x86/InstructionRelocationX86Shared.h:16:30: error: unknown type name 'CodeBufferBase'
   16 |                              CodeBufferBase *code_buffer, x86_insn_decode_t &insn, int8_t mode);
      |                              ^
2 errors generated.
make[3]: *** [CMakeFiles/dobby.dir/source/InstructionRelocation/x64/InstructionRelocationX64.cc.o] Error 1
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:14:43: error: unknown type name 'CodeBufferBase'
   14 | inline void codegen_x64_jmp_absolute_addr(CodeBufferBase *buffer, addr_t target) {
      |                                           ^
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:24:30: error: unknown type name 'CodeBufferBase'
   24 | inline void emit_rel32_label(CodeBufferBase *buffer, uint32_t last_offset, addr_t curr_relo_ip, addr_t orig_dst_ip) {
      |                              ^
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:33:30: error: unknown type name 'CodeBufferBase'
   33 |                              CodeBufferBase *code_buffer, x86_insn_decode_t &insn, int8_t mode) {
      |                              ^
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:92:66: error: no member named 'allocateNearExecMemory' in 'NearMemoryAllocator'
   92 |       auto rip_insn_seq = (addr_t)NearMemoryAllocator::Shared()->allocateNearExecMemory(
      |                                   ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  ^
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:107:34: error: use of undeclared identifier 'CodeBufferBase'
  107 |       auto rip_insn_seq_buffer = CodeBufferBase();
      |                                  ^
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:200:19: error: reference to non-static member function must be called; did you mean to call it with no arguments?
  200 |   if (!relocated->addr) {
      |        ~~~~~~~~~~~^~~~
      |                       ()
/Users/lennard/Desktop/Dobby/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc:201:43: error: no member named 'SharedAllocator' in 'MemoryAllocator'
  201 |     auto relocated_mem = MemoryAllocator::SharedAllocator()->allocateExecMemory(expected_relocated_mem_size);
      |                          ~~~~~~~~~~~~~~~~~^
8 errors generated.
15 errors generated.
make[3]: *** [CMakeFiles/dobby.dir/source/InstructionRelocation/x86/InstructionRelocationX86Shared.cc.o] Error 1
make[3]: *** [CMakeFiles/dobby.dir/source/InstructionRelocation/x86/x86_insn_decode/x86_insn_decode.c.o] Error 1
make[2]: *** [CMakeFiles/dobby.dir/all] Error 2
make[1]: *** [CMakeFiles/dobby.dir/rule] Error 2
make: *** [dobby] Error 2
Traceback (most recent call last):
  File "/Users/lennard/Desktop/Dobby/scripts/platform_builder.py", line 243, in <module>
    builder.build()
  File "/Users/lennard/Desktop/Dobby/scripts/platform_builder.py", line 75, in build
    subprocess.run("cmake --build . --clean-first --target dobby --target dobby_static -- -j8", cwd=self.cmake_build_dir, shell=True, check=True)
  File "/opt/homebrew/Cellar/[email protected]/3.11.7/Frameworks/Python.framework/Versions/3.11/lib/python3.11/subprocess.py", line 571, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command 'cmake --build . --clean-first --target dobby --target dobby_static -- -j8' returned non-zero exit status 2.
@trueToastedCode trueToastedCode changed the title Impossible to compile, please improve documentation fatal error: 'MemoryAllocator/CodeBuffer/code_buffer_x64.h' file not found Feb 6, 2024
@trueToastedCode
Copy link
Author

0932d69 is the last commit, i can compile.

@tcc0lin
Copy link

tcc0lin commented Feb 26, 2024

0932d69 is the last commit, i can compile.

yes. it can run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants