Closed zivmc closed 4 years ago
How are you compiling this though? Only FrankeNDK is supported, and clearly builds for @topjohnwu and others without error.
How are you compiling this though? Only FrankeNDK is supported, and clearly builds for @topjohnwu and others without error.
I was compiling on Linux, actually Linux Mint 18.3 based on Ubuntu 16.04. The compilation command was:
./build.py all
It seems that it ran into the clean_elf
function:
def clean_elf():
if is_windows:
elf_cleaner = os.path.join('tools', 'elf-cleaner.exe')
else:
elf_cleaner = os.path.join('native', 'out', 'elf-cleaner')
if not os.path.exists(elf_cleaner):
execv(['g++', 'tools/termux-elf-cleaner/termux-elf-cleaner.cpp',
'-o', elf_cleaner])
args = [elf_cleaner]
args.extend(os.path.join('native', 'out', arch, 'magisk') for arch in archs + arch64)
execv(args)
and as the platform was not Windows, it went into the else clause and check the existence of the binary "native/out/elf-cleaner". The binary elf_cleaner
did not exist, so it tried to compile directly using g++
without passing a "-std=c++11" flag to the compiler.
All required environment variables were set correctly as specified in README.MD
of this project, and the FrankeNDK were used to build. After I modified the code and passed a "-std=c++11" flag to the compiler, the compilation succeeded.
Ah, sounds good then. Likely dependent on distro g++ version, but the additional flag should be okay for all I'd think.
Make a PR with the change and link it to this issue please.
Ah, sounds good then. Likely dependent on distro g++ version, but the additional flag should be okay for all I'd think.
Make a PR with the change and link it to this issue please.
Hi there, I have made a pull request, but I am not able to link the pull request to this issue.
Here is the link to the pull request: pr:2637
Bug
In clean_elf function of build.py, the command to compile the binary native/out/elf-cleaner missed necessary cxxflags:
Lacking of a "-std=c++11" flag caused the following compilation errors:
A possible fix is to add a "-std=c++11" flag to the compilation command: