miticollo/miticollo.github.io

frida-gum/meson.build:1:0: ERROR: 'c' compiler binary not defined in cross or native file

Closed this issue ยท 4 comments

I based on the frida build solution you provided. https://gist.github.com/miticollo/6e65b59d83b17bacc00523a0f9d41c11
The build can be done with arm64e and arm64 via m1 mac

make build/frida-ios-{arm64e,arm64,arm64eoabi}/usr/lib/pkgconfig/frida-core-1.0.pc

But there is a problem when the build program runs to arm64eoabi
meson-log.txt

make build/frida-ios-arm64eoabi/usr/lib/pkgconfig/frida-core-1.0.pc
. build/frida-env-ios-arm64eoabi.rc; \
	builddir=build/tmp-ios-arm64eoabi/frida-gum; \
	if [ ! -f $builddir/build.ninja ]; then \
				meson_args="--native-file build/frida-macos-arm64.txt"; if [ ios-arm64eoabi != macos-arm64 ]; then meson_args="$meson_args --cross-file build/frida-ios-arm64eoabi.txt"; fi; python3 /Users/rootme/Desktop/C/frida/releng/meson/meson.py setup $meson_args \
			--prefix /usr \
			--default-library static -Doptimization=s -Db_ndebug=true --strip -Djailbreak=auto -Dgumpp=enabled -Dgumjs=enabled -Dv8=auto -Ddatabase=enabled -Dfrida_objc_bridge=auto -Dfrida_swift_bridge=auto -Dfrida_java_bridge=auto -Dtests=enabled  \
			frida-gum $builddir || exit 1; \
	fi \
		&& python3 /Users/rootme/Desktop/C/frida/releng/meson/meson.py compile -C $builddir \
		&& DESTDIR="/Users/rootme/Desktop/C/frida/build/frida-ios-arm64eoabi" python3 /Users/rootme/Desktop/C/frida/releng/meson/meson.py install -C $builddir
The Meson build system
Version: 0.64.0.rc2
Source dir: /Users/rootme/Desktop/C/frida/frida-gum
Build dir: `/Users/rootme/Desktop/C/frida/build/tmp-ios-arm64eoabi/frida-gum`
Build type: cross build
Project name: frida-gum
Project version: 1.0.0

frida-gum/meson.build:1:0: ERROR: 'c' compiler binary not defined in cross or native file

A full log can be found at /Users/rootme/Desktop/C/frida/build/tmp-ios-arm64eoabi/frida-gum/meson-logs/meson-log.txt
make[1]: *** [build/frida-ios-arm64eoabi/usr/lib/pkgconfig/frida-gum-1.0.pc] Error 1
make: *** [build/frida-ios-arm64eoabi/usr/lib/pkgconfig/frida-core-1.0.pc] Error 2

I think the source of the problem is from the file: frida/build/frida-ios-arm64eoabi.txt


[constants]
common_flags = ['-target', 'arm64e-apple-ios8.0', '-isysroot', '']
c_like_flags = ['-include', '/Users/rootme/Desktop/C/frida/build/frida-version.h']
linker_flags = ['-Wl,-dead_strip']
cxx_like_flags = ['-nostdinc++', '-isystem/Users/rootme/Desktop/C/frida/build/sdk-ios-arm64eoabi/include/c++']
cxx_link_flags = ['-nostdlib++', '-L/Users/rootme/Desktop/C/frida/build/sdk-ios-arm64eoabi/lib/c++', '-lc++', '-lc++abi']

[binaries]
c = [''] + common_flags       // here
cpp = ['', '-stdlib=libc++'] + common_flags
objc = [''] + common_flags
objcpp = ['', '-stdlib=libc++'] + common_flags
vala = ['/Users/rootme/Desktop/C/frida/build/toolchain-macos-arm64/bin/valac-0.58', '--target-glib=2.56', '--vapidir=/Users/rootme/Desktop/C/frida/build/frida-ios-arm64eoabi/usr/share/vala/vapi', '--vapidir=/Users/rootme/Desktop/C/frida/build/sdk-ios-arm64eoabi/share/vala/vapi', '--vapidir=/Users/rootme/Desktop/C/frida/build/toolchain-macos-arm64/share/vala-0.58/vapi']
ar = ['']
nm = ['']
ranlib = ['']
strip = ['', '-Sx']
libtool = ['']
install_name_tool = ['']
otool = ['']
codesign = ['']
lipo = ['']
pkgconfig = '/Users/rootme/Desktop/C/frida/build/frida-ios-arm64eoabi-pkg-config'

[built-in options]
c_args = c_like_flags
cpp_args = c_like_flags + cxx_like_flags
c_link_args = linker_flags
cpp_link_args = linker_flags + cxx_link_flags
b_lundef = true

[properties]
needs_exe_wrapper = true


[host_machine]
system = 'darwin'
cpu_family = 'aarch64'
cpu = 'aarch64'
endian = 'little'

I can't fix this error
just only this arm64eoabi ,HELP!!!!

  • Are you sure that you installed Xcode (not only Command Line Tool)?
  • Did you try to set export DEVELOPER_DIR=...?

Because this is a strange error. It seems that for target arm64eoabi meson doesn't find a C compiler (like clang). But it finds the compiler for the other two targets: arm64 and arm64e.

  • I made sure that Xcode was installed on my m1mac.Xcode version 14.1

  • execute echo $DEVELOPER_DIR, the path is right

echo $DEVELOPER_DIR
/Applications/Xcode14.app/Contents/Developer

The same problem occurs in macOS in VMware, but when I start Xcode 11.7 it works, which is a very strange problem.
image

DEVELOPER_DIR must be Xcode11.7?

No.

At least the problem is meson.build + M1. Because to compile it I always use an Hanckintosh with Intel i7.

I know where the problem is.

https://gist.github.com/miticollo/6e65b59d83b17bacc00523a0f9d41c11#build

  • 3.Once downloaded, opening the .xip archive will begin extracting it. After extraction, rename the app to avoid conflicting with your primary installation of Xcode and move it to (e.g., )./Applications/mv Xcode.app /Applications/Xcode-11.7.app

I did not rename for xcode11.7

before is : /Applications/Xcode11.app

after is : /Applications/Xcode-11.7.app

eef57936730d7fc0520c549fe1fb6ae

I have completed the build task of make build/frida-ios-{arm64e,arm64,arm64eoabi}/usr/lib/pkgconfig/frida-core-1.0.pc

Now my M1 can also build deb like you do

๐Ÿ‘ Thanks for your reply and help ๐Ÿ‘