Open AmesianX opened 6 months ago
Adding that I too am running into this issue on Ubuntu 22.04 despite me trying
./config --host=linux-X86_64
I get an error saying I don't have a C compiler but when I type gcc
it is very much there
`/home/s0nlx/tools/frida/deps/sdk-linux-x86_64/share/vala/vapi']", '-Dbuild.vala_link_args=[]', '-Dfrida-python:build.c_std=none', '-Dfrida-tools:build.c_std=none', PosixPath('/home/s0nlx/tools/frida/build/subprojects/frida-core/compat/arch-support.bundle.p/x86')]' returned non-zero exit status 1. Output: | The Meson build system | Version: 1.4.99 | Source dir: /home/s0nlx/tools/frida/subprojects/frida-core | Build dir: /home/s0nlx/tools/frida/build/subprojects/frida-core/compat/arch-support.bundle.p/x86 | Build type: cross build | Program python3 found: YES (/usr/bin/python3) | Project name: frida-core | Project version: 16.5.3-dev.8 | C compiler for the host machine: /usr/bin/cc -m32 -march=pentium4 (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0") | C linker for the host machine: /usr/bin/cc -m32 -march=pentium4 ld.bfd 2.38 |
---|---|---|---|---|---|---|---|---|---|---|
meson.build:1:0: ERROR: Compiler /usr/bin/c++ -m32 -march=pentium4 cannot compile programs. | ||||||||||
A full log can be found at /home/s0nlx/tools/frida/build/subprojects/frida-core/compat/arch-support.bundle.p/x86/meson-logs/meson-log.txt |
[122/302] Generating subprojects/frida...js/gumjs-runtime with a custom command
ninja: build stopped: subcommand failed.
Trying gcc on it's own...
gcc
gcc: fatal error: no input files
compilation terminated.`
I built a binary for Frida from the source code, but I wasted a lot of time because of some ridiculous bugs. For most people who try to build Frida natively in a Windows environment, the build process will be almost impossible.
The reason why developers maintaining Frida's source code did not notice this bug was likely because the build was cached. Developers who modified the source code probably did so after several builds. If you generate incorrect code after one or more successful builds, your changes will not be reflected due to cache issues.
Developers should take this into account when modifying the build scripts. To check if I had written the code incorrectly, I confirmed that it was not applied even after using the "ninja -t clean" command to clear the cache.
When modifying the build scripts, you must retrieve the source code from scratch and then test it. This ensures that no cached builds interfere with the changes and that the build process works correctly for everyone.
I opened an x64 build environment console window for msbuild to build in a 64-bit environment, but it is not being applied. It is being recognized as x86, and parsing is not working properly.
If the user reading this post is not an English speaker, they should enter the command "chcp 65001" before starting the build.
source code : frida-core\releng\env_generic.py
source code : frida-core\releng\env_generic.py
I was able to build it temporarily by hard-coding it like this: (Additionally, when hardcoding, make sure to match the SDK version number to your version. Also, ensure that you are building in a way that matches your environment, such as building x64 on an x64 host.)
source code : frida-core\releng\env_generic.py
P.S: FYI, using Pickle from a computer security perspective is a very poor coding practice.