Impalabs / hyperpom

AArch64 fuzzer based on the Apple Silicon hypervisor
GNU General Public License v3.0
184 stars 15 forks source link

Unable to Compile Dependency: Capstone Engine #2

Closed impost0r closed 1 year ago

impost0r commented 1 year ago
  gmake[1]: warning: jobserver unavailable: using -j1.  Add '+' to parent make rule.
  In file included from /Users/jogn/.cargo/registry/src/github.com-1ecc6299db9ec823/keystone-engine-0.1.0/keystone/llvm/lib/Support/Memory.cpp:20:
  In file included from /Users/jogn/.cargo/registry/src/github.com-1ecc6299db9ec823/keystone-engine-0.1.0/keystone/llvm/lib/Support/Unix/Memory.inc:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/mach/mach.h:67:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/mach/mach_interface.h:48:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/mach/task.h:931:2: error: unknown type name 'kcdata_object_t'
          kcdata_object_t kcdata_object,
          ^
  In file included from /Users/jogn/.cargo/registry/src/github.com-1ecc6299db9ec823/keystone-engine-0.1.0/keystone/llvm/lib/Support/Memory.cpp:20:
  In file included from /Users/jogn/.cargo/registry/src/github.com-1ecc6299db9ec823/keystone-engine-0.1.0/keystone/llvm/lib/Support/Unix/Memory.inc:23:
  In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/mach/mach.h:70:
  /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX13.0.sdk/usr/include/mach/mach_host.h:154:2: error: unknown type name 'io_main_t'
          io_main_t *io_main
          ^
  2 errors generated.
  gmake[2]: *** [llvm/keystone/CMakeFiles/keystone.dir/build.make:776: llvm/keystone/CMakeFiles/keystone.dir/__/lib/Support/Memory.cpp.o] Error 1
  gmake[1]: *** [CMakeFiles/Makefile2:452: llvm/keystone/CMakeFiles/keystone.dir/all] Error 2
  gmake: *** [Makefile:156: all] Error 2
  thread 'main' panicked at '
  command did not execute successfully, got: exit status: 2
  build script failed, must exit now', /Users/jogn/.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.49/src/lib.rs:1104:5
  stack backtrace:
     0: rust_begin_unwind
               at /rustc/0416b1a6f6d5c42696494e1a3a33580fd3f669d8/library/std/src/panicking.rs:575:5
     1: core::panicking::panic_fmt
               at /rustc/0416b1a6f6d5c42696494e1a3a33580fd3f669d8/library/core/src/panicking.rs:64:14
     2: cmake::fail
     3: cmake::run
     4: cmake::Config::build
     5: build_script_build::build_keystone
     6: build_script_build::main
     7: core::ops::function::FnOnce::call_once
  note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Process finished with exit code 101

Looks like a macOS issue.

impost0r commented 1 year ago

Alternatively, this may be fixed by linking against Kernel.framework.

0xLyte commented 1 year ago

Hi,

Sorry for the delay, I realized my Github notifs weren't configured properly.

It seems like the issue is coming from https://github.com/Impalabs/keystone-bindings, at least from what I'm seeing in the logs you provided. I've tried compiling the examples from the Hyperpom and Keystone-bindings repos and haven't encountered any issue on my end. I'm running MacOS 13.2.1 and version 13.1 of the SDK.

If you still encounter this issue using the latest versions, and without linking against Kernel.framework, could you send me an example or instructions to reproduce it? Thanks!

impost0r commented 1 year ago

Hey there, Problem was I had configured my XCode for XNU Kernel compilation, which apparently breaks a lot of things. It was a user issue thing, closing the issue now.