frida / frida-swift

Frida Swift bindings
Other
139 stars 37 forks source link

meson.build:1:0: ERROR: Compiler #3

Closed klmitchell2 closed 4 years ago

klmitchell2 commented 4 years ago

Hello,

To start I can close this ticket in favor of making an issue within the Frida repo instead.

I am attempting to follow the install directions and I have encountered this error when running make core-macos

I have also followed the instructions outlined in here: https://github.com/frida/frida/blob/master/README.md#macos-and-ios

meson.build:1:0: ERROR: Compiler /Users/kevin/Desktop/frida/build/frida-macos-x86-clang can not compile programs.

A full log can be found at /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-logs/meson-log.txt make[1]: [build/frida-macos-x86/lib/pkgconfig/frida-gum-1.0.pc] Error 1 make: [core-macos] Error 2

Here is the output of meson-log.txt:

Build started at 2020-03-24T22:47:17.817773
Main binary: /Library/Frameworks/Python.framework/Versions/3.8/bin/python3
Python system: Darwin
The Meson build system
Version: 0.49.2
Source dir: /Users/kevin/Desktop/frida/frida-gum
Build dir: /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum
Build type: cross build
Project name: frida-gum
Project version: 1.0.0
Sanity testing C compiler: /Users/kevin/Desktop/frida/build/frida-macos-x86_64-clang
Is cross compiler: False.
Sanity check compiler command line: /Users/kevin/Desktop/frida/build/frida-macos-x86_64-clang /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-private/sanitycheckc.c -o /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-private/sanitycheckc.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:

-----
Running test binary command: /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-private/sanitycheckc.exe
Appending CFLAGS from environment: '-fPIC '
Appending LDFLAGS from environment: '-isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -arch x86_64 -Wl,-dead_strip -L/Users/kevin/Desktop/frida/build/frida-macos-x86_64/lib -L/Users/kevin/Desktop/frida/build/sdk-macos-x86_64/lib'
Appending CPPFLAGS from environment: '-include /Users/kevin/Desktop/frida/build/frida-version.h -mmacosx-version-min=10.9 -I/Users/kevin/Desktop/frida/build/frida-macos-x86_64/include -I/Users/kevin/Desktop/frida/build/sdk-macos-x86_64/include'
Sanity testing C compiler: /Users/kevin/Desktop/frida/build/frida-macos-x86-clang
Is cross compiler: True.
Sanity check compiler command line: /Users/kevin/Desktop/frida/build/frida-macos-x86-clang -mmacosx-version-min=10.9 -I/Users/kevin/Desktop/frida/build/frida-macos-x86/include -I/Users/kevin/Desktop/frida/build/sdk-macos-x86/include -include /Users/kevin/Desktop/frida/build/frida-version.h -mmacosx-version-min=10.9 -Wl,-dead_strip -L/Users/kevin/Desktop/frida/build/frida-macos-x86/lib -L/Users/kevin/Desktop/frida/build/sdk-macos-x86/lib /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-private/sanitycheckc.c -o /Users/kevin/Desktop/frida/build/tmp-macos-x86/frida-gum/meson-private/sanitycheckc_cross.exe
Sanity check compile stdout:

-----
Sanity check compile stderr:
ld: warning: The i386 architecture is deprecated for macOS (remove from the Xcode build setting: ARCHS)
ld: warning: ignoring file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd, missing required architecture i386 in file /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/usr/lib/libSystem.tbd
ld: dynamic main executables must link with libSystem.dylib for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)

-----

meson.build:1:0: ERROR:  Compiler /Users/kevin/Desktop/frida/build/frida-macos-x86-clang can not compile programs.

Thanks for any help that can be provided. I'd love to include this in my project, but just having a hard time getting set up.

oleavr commented 4 years ago

Hey,

Running make core-macos will build Frida with support for cross-architecture injection, to also be able to attach() to 32-bit x86 processes and not just 64-bit processes. However, Xcode 9 is the last version of Xcode that's able to build 32-bit macOS binaries. And, Xcode 9 doesn't run on Catalina (at least not without hacks), so you will need a Mojave system to run it on.

However, if you don't care about being able to attach to 32-bit processes, you can do make core-macos-thin and add -t when running devkit.py.

Cheers!

klmitchell2 commented 4 years ago

Thanks for the help with that, that seemed to work. I have the following output in my build folder now:

image

When running devkit.py I am unsure what I should include as arguments

README directions: ./releng/devkit.py -t frida-core macos-x86_64 ./frida-swift/CFrida/macos-x86_64/

Should macOS-x86_64 be a file that was generated in the /builds folder?

oleavr commented 4 years ago

When running devkit.py I am unsure what I should include as arguments

The example in the README is the way to go.

Should macOS-x86_64 be a file that was generated in the /builds folder?

No, not the whole name – it's just the <os>-<arch> part. It should be macos-x86_64.

klmitchell2 commented 4 years ago

Thanks for your help!