Magisk 18.1 build environment issues - Magisk

Hi everyone, I'm having issues with compiling Magisk from a fresh environment. Has anyone had success building the latest Magisk, if so, what did your environment look like? Here is what I did...
Fresh Docker Ubuntu Instance
Installed Python3.7
Installed Android SDK Tools
Installed "ndk-bundle" "platform-tools" from sdkmanager
Downloaded/Extracted latest FrankeNDK
Set ANDROID_HOME to sdk path, and ANDROID_NDK_HOME to FrankeNDK path
Full clone w/submodule of Magisk Repo
Setup config.prop
python3 build.py -v binary
However this always produces the same linker error:
Code:
[armeabi-v7a] Executable : busybox
[armeabi-v7a] SharedLibrary : libsqlite.so
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/.[x86] SharedLibrary : libsqlite.so
./../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o:1:3: invalid character
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o:1:3: syntax error, unexpected $end
/root/dev/android/FrankeNDK/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: ./obj/local/armeabi-v7a/objs/sqlite/stubs/sqlite3_stub.o: not an object or archive
collect2: error: ld returned 1 exit status
make: *** [obj/local/armeabi-v7a/libsqlite.so] Error 1
make: *** Waiting for unfinished jobs....
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o:1:3: invalid character
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o:1:3: syntax error, unexpected $end
/root/dev/android/FrankeNDK/toolchains/x86-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/i686-linux-android/4.9.x/../../../../i686-linux-android/bin/ld: error: ./obj/local/x86/objs/sqlite/stubs/sqlite3_stub.o: not an object or archive
collect2: error: ld returned 1 exit status
make: *** [obj/local/x86/libsqlite.so] Error 1
make: Leaving directory `/root/dev/android/Magisk/native'
Build binary failed!
I opened an issue on GitHub:1167 and TJW indicated that the linker is missing flags -flto. However, I didn't mess with anything and the default file of /native/jni/Application.mk:APP_LDFLAGS := -flto contains those flags. Is there anything else I could try to get the build to work? Thanks

Related

[Q] Well, I'm stuck. Make errors...

I can't seem to catch a break...
I haven't been able to compile anything with my build environment. For at least a few weeks. I know it should work, because I compiled a build of WD40M0D prior to all my merging of source. I'm using a MacBookPro running OS X 10.5.8
When trying to build a kernel, I get errors on "bounds.s" and "prepare0":
Code:
sean-whitleys-macbook-pro:kernel-msm wdfowty$ make ARCH=arm CROSS_COMPILE=$CCOMPILER
scripts/kconfig/conf -s arch/arm/Kconfig
CHK include/linux/version.h
UPD include/linux/version.h
CHK include/generated/utsrelease.h
UPD include/generated/utsrelease.h
Generating include/generated/mach-types.h
CC kernel/bounds.s
cc1: error: invalid option ‘little-endian’
cc1: error: invalid option ‘abi=aapcs-linux’
cc1: error: invalid option ‘no-thumb-interwork’
kernel/bounds.c:1: error: bad value (armv5t) for -march= switch
kernel/bounds.c:1: error: bad value (armv5t) for -mtune= switch
make[1]: *** [kernel/bounds.s] Error 1
make: *** [prepare0] Error 2
My next error, if I skip the kernel, is in building libgps.so...It claims to not be able to find librpc.so, which to the best of my knowledge is where it's supposed to be (somewhere in the out directory).
Code:
#
/Users/wdfowty/bin/mydroid/prebuilt/darwin-x86/toolchain/arm-eabi-4.4.0/bin/../lib/gcc/arm-eabi/4.4.0/../../../../arm-eabi/bin/ld: warning: librpc.so, needed by out/target/product/passion/obj/lib/libgps.so, not found (try using -rpath or -rpath-link)
Some things I've noticed...
*Kernel error is constant across AOSP and CM source (could it be a bad .config?)
*Errors persist even after running "make clobber" or "make installclean"
I'm hoping someone can help, as I'm running on minimal knowledge and experience...Thank you in advance!
Here's the full librpc.so error on pastebin: http://pastebin.com/VBtAffE0

For devs .. compiling boot.img error

Hi Devs ,
i've been trying to build new LS nightly .. and im using this kernel https://github.com/LiquidSmooth-Devices/android_kernel_sony_msm8974 & device tree https://github.com/LiquidSmooth-Devices/android_device_sony_honami
so i got this error
Code:
DTB combiner:
Input directory: '/home/teamliquid/Ahmed/out/target/product/honami/obj/KERNEL_OBJ/arch/arm/boot/'
Output file: '/home/teamliquid/Ahmed/out/target/product/honami/dt.img'
=> Found 0 unique DTB(s)
error: could not load device tree image '/home/teamliquid/Ahmed/out/target/product/honami/dt.img'
make: *** [/home/teamliquid/Ahmed/out/target/product/honami/boot.img] Error 1
make: *** Waiting for unfinished jobs....
any ideas ?

[Q]Kinect Whit Raspberry Pi 2

I am trying to run my xbox360 kinect on my raspberry pi 2. I have followed this guide (https://github.com/xxorde/librekinect*)without errors but at the last command ( make load ) gives me this error:
[email protected]:/home/pi/librekinect-master# ls
gspca.c gspca.h kinect.c Makefile readme.md unload_drivers.sh
[email protected]:/home/pi/librekinect-master# make load
make unload_drivers
make[1]: Entering directory '/home/pi/librekinect-master'
sudo sh unload_drivers.sh
Error: Module kinect is not currently loaded
Error: Module gspca is not currently loaded
Error: Module gspca_main is in use by: gspca_kinect
Error: Module gspca_kinect is in use
Error: Module * is not currently loaded
make[1]: Leaving directory '/home/pi/librekinect-master'
sudo modprobe videodev
sudo insmod gspca.ko
Error: could not load module gspca.ko: No such file or directory
Makefile:42: recipe for target 'load' failed
make: *** [load] Error 1
[email protected]:/home/pi/librekinect-master#
nik012003 said:
I am trying to run my xbox360 kinect on my raspberry pi 2. I have followed this guide (https://github.com/xxorde/librekinect*)without errors but at the last command ( make load ) gives me this error:
[email protected]:/home/pi/librekinect-master# ls
gspca.c gspca.h kinect.c Makefile readme.md unload_drivers.sh
[email protected]:/home/pi/librekinect-master# make load
make unload_drivers
make[1]: Entering directory '/home/pi/librekinect-master'
sudo sh unload_drivers.sh
Error: Module kinect is not currently loaded
Error: Module gspca is not currently loaded
Error: Module gspca_main is in use by: gspca_kinect
Error: Module gspca_kinect is in use
Error: Module * is not currently loaded
make[1]: Leaving directory '/home/pi/librekinect-master'
sudo modprobe videodev
sudo insmod gspca.ko
Error: could not load module gspca.ko: No such file or directory
Makefile:42: recipe for target 'load' failed
make: *** [load] Error 1
[email protected]:/home/pi/librekinect-master#
Click to expand...
Click to collapse
Hello, just for refernce I've found this on the redme file in the repo:
"make load" fails
Is the kernel compatible to the sources you use? Compile a kernel and load it.
Are you sure you have compiled the kernel without any errors. This error tells me that something is wrong with kernel compilation
Code:
Error: could not load module gspca.ko: No such file or directory
root-expert said:
Hello, just for refernce I've found this on the redme file in the repo:
"make load" fails
Is the kernel compatible to the sources you use? Compile a kernel and load it.
Are you sure you have compiled the kernel without any errors. This error tells me that something is wrong with kernel compilation
Code:
Error: could not load module gspca.ko: No such file or directory
Click to expand...
Click to collapse
I have opened an issue on github with other info:
https://github.com/xxorde/librekinect/issues/25#issuecomment-95719253
nik012003 said:
I have opened an issue on github with other info:
https://github.com/xxorde/librekinect/issues/25#issuecomment-95719253
Click to expand...
Click to collapse
Did you update your makefile as he said. Run this on your raspberry pi 2:
Code:
uname -m
You should get something like armv7l.
root-expert said:
Did you update your makefile as he said. Run this on your raspberry pi 2:
Code:
uname -m
You should get something like armv7l.
Click to expand...
Click to collapse
Yes I have updated the file
I get armv7l

LineageOS and build error (kernel/gcc)

Hi,
I had my environment set up for building LineageOS (Ubuntu xenial) and it was working perfectly fine.
I haven't updated the machine since March 2017.
Now I did 'repo sync' and suddenly I'm getting the following errors during brunch hammerhead
Code:
LD drivers/video/msm/mdss/mdss-dsi.o
LD drivers/video/msm/mdss/built-in.o
LD drivers/video/msm/built-in.o
LD drivers/video/built-in.o
LD drivers/usb/gadget/g_android.o
LD drivers/usb/gadget/built-in.o
LD drivers/usb/built-in.o
LD drivers/built-in.o
LD vmlinux.o
MODPOST vmlinux.o
ERROR: modpost: Found 12 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
To build the kernel despite the mismatches, build with:
'make CONFIG_NO_ERROR_ON_MISMATCH=y'
(NOTE: This is not recommended)
/media/rawi/android/lineageos/kernel/lge/hammerhead/scripts/Makefile.modpost:98: recipe for target 'vmlinux.o' failed
make[2]: *** [vmlinux.o] Error 1
/media/rawi/android/lineageos/kernel/lge/hammerhead/Makefile:936: recipe for target 'vmlinux.o' failed
make[1]: *** [vmlinux.o] Error 2
Makefile:130: recipe for target 'sub-make' failed
make: *** [sub-make] Error 2
make: Leaving directory '/media/rawi/android/lineageos/kernel/lge/hammerhead'
[ 12% 4387/34154] target Java: android-support-compat-ics-mr1 (/media/rawi/android/lineageos/out/target/common/obj/JAVA_LIBRARIES/android-support-compat-ics-mr1_intermediates/classes)
ninja: build stopped: subcommand failed.
build/core/ninja.mk:151: recipe for target 'ninja_wrapper' failed
make: *** [ninja_wrapper] Error 1
make: Leaving directory '/media/rawi/android/lineageos'
#### make failed to build some targets (13:29 (mm:ss)) ####
What I've already googled is that it's probably wrong toolchain used but I'm using the one supplied with LineageOS which is arm-eabi-4.8.
I added (not sure if it's necessary) the following exports
Code:
export PATH="/media/rawi/android/lineageos/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin:$PATH"
export ARCH=arm
export SUBARCH=arm
export CROSS_COMPILE="/media/rawi/android/lineageos/prebuilts/gcc/linux-x86/arm/arm-eabi-4.8/bin/arm-eabi-"
I'd like to highlight that this environment was building LineageOS (cm-14.1 branch) in March perfectly fine
I know that I can add CONFIG_NO_ERROR_ON_MISMATCH=y to config but I assume this is not the right way to do.
Any help greatly appreciated
EDIT: solved... I was compiling CAF kernel with non-caf device
Thread closed as per OP request
-XDA Staff

How to compile Samsung S10 kernel for Exynos 9820?

I tried the following:
Download toolchain from https://android.googlesource.com/pl....9/+/e54105c9f893a376232e0fc539c0e7c01c829b1e
Download clang-4639204
sudo apt-get install -y build-essential kernel-package libncurses5-dev bzip2
sudo apt-get install flex bison
sudo apt-get install libelf-dev
export CROSS_COMPILE=/home/gilius/Desktop/tool/bin/aarch64-linux-android-
export ARCH=arm64
enter the 9820 directory
sudo -i
make xynos9820-beyond2lte_defconfig
make -j10
Am getting the following errors:
Code:
arch/arm64/Makefile:27: ld does not support --fix-cortex-a53-843419; kernel may be susceptible to erratum
arch/arm64/Makefile:57: Detected assembler with broken .inst; disassembly will be unreliable
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
CHK include/config/kernel.release
../PLATFORM/prebuilts/clang/host/linux-x86/clang-4639204/bin/clang.real: error while loading shared libraries: libtinfo.so.5: cannot open shared object file: No such file or directory
Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler
make: *** [Makefile:1244: prepare-compiler-check] Error 1
make: *** Waiting for unfinished jobs....
Hi,
for me : sudo ln -s /usr/lib/libtinfo.so /usr/lib/libtinfo.so.5 did the trick but I am now stuck with some assembly instructions "not existing" errors when compiling arch/arm64/kernel/vdso/gettimeofday.S
did you made any progress?
Update : linking libtinfo.so.6 to libtinfo.so.5 solved it but also failed with :
scripts/selinux/genheaders/genheaders.c:19:
./security/selinux/include/classmap.h:251:2: erreur: #error New address family defined, please update secclass_map.
251 | #error New address family defined, please update secclass_map.
| ^~~~~
make[3]: *** [scripts/Makefile.host:102: scripts/selinux/genheaders/genheaders] Error 1
make[2]: *** [scripts/Makefile.build:673: scripts/selinux/genheaders] Error 2
make[1]: *** [scripts/Makefile.build:673: scripts/selinux] Error 2
make: *** [Makefile:607: scripts] Error 2
I am currently trying it on archlinux and the ncurses5-compat-libs package didn't put a new library in my path I will try later on another distro see if it's just a library error.
Update 2 :
Compiled fine using rhel 8, I had to install ncurses compat libs and create a symbolic link from python2 to python in my $PATH.
Does it boot?
Does your kernel boot?
Mine, keep stuck at Samsung logo
Akugila said:
Does your kernel boot?
Mine, keep stuck at Samsung logo
Click to expand...
Click to collapse
Non, I can't even go further the unlocked warning screen, but my repacking of the image is wrong, my new image is always lighter than the original, I am using magiskboot to do it. How are you doing it ?
try AIK
shmsh9 said:
Non, I can't even go further the unlocked warning screen, but my repacking of the image is wrong, my new image is always lighter than the original, I am using magiskboot to do it. How are you doing it ?
Click to expand...
Click to collapse
Ahh, fool me. it's stuck at warning screen too (forgot there are another samsung logo during boot)
I use AIK [https://forum.xda-developers.com/showthread.php?t=2073775] for packing, the size is the same with original (I use "Image" file)
kernel build error: expected parameter declarator
Did you get these compilation errors?
In file included from kernel/bounds.c:10:
In file included from ./include/linux/page-flags.h:10:
In file included from ./include/linux/bug.h:5:
In file included from ./arch/arm64/include/asm/bug.h:37:
In file included from ./include/asm-generic/bug.h:16:
In file included from ./include/linux/kernel.h:14:
./include/linux/printk.h:149:24: error: expected parameter declarator
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:24: error: expected ')'
./include/linux/printk.h:149:23: note: to match this '('
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
static inline __printf(1, 2) __cold
^
void
./include/linux/printk.h:149:29: error: expected ';' after top level declarator
static inline __printf(1, 2) __cold
^
Linaro 4.9.4 aarch64-linux-gnu compiler tools for S10 5G kernel build
floor51 said:
Did you get these compilation errors?
In file included from kernel/bounds.c:10:
In file included from ./include/linux/page-flags.h:10:
In file included from ./include/linux/bug.h:5:
In file included from ./arch/arm64/include/asm/bug.h:37:
In file included from ./include/asm-generic/bug.h:16:
In file included from ./include/linux/kernel.h:14:
./include/linux/printk.h:149:24: error: expected parameter declarator
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:24: error: expected ')'
./include/linux/printk.h:149:23: note: to match this '('
static inline __printf(1, 2) __cold
^
./include/linux/printk.h:149:23: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
static inline __printf(1, 2) __cold
^
void
./include/linux/printk.h:149:29: error: expected ';' after top level declarator
static inline __printf(1, 2) __cold
^
Click to expand...
Click to collapse
I found that using the Linaro 4.9.4 aarch64-linux-gnu compiler tools solved this:
https://releases.linaro.org/compone...4.9.4-2017.01-x86_64_aarch64-linux-gnu.tar.xz
I was previously using the toolchain that is in ianmacd's github repo here:
https://github.com/ianmacd/beyond2l...p/gcc-cfp-jopp-only/aarch64-linux-android-4.9
I changed this:
#CROSS_COMPILE ?= $(srctree)/toolchain/gcc-cfp/gcc-cfp-jopp-only/aarch64-linux-android-4.9/bin/aarch64-linux-android-
...to:
CROSS_COMPILE ?= ~/dev/projects/android/kernel/gcc-linaro-4.9.4-2017.01-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu-
I also used Linaro for CLANG_TRIPLE.
And I used clang for CC:
CC = ~/dev/projects/android/kernel/clang-4639204/bin/clang
...from here:
https://android.googlesource.com/pl...archive/android-9.0.0_r1/clang-4639204.tar.gz
All that info would have helped me a lot anyway. Hope it helps someone. Not that I've tried the image on device yet.
Hey,
I have managed to build the kernel by following the instructions in the samsung readme.
Code:
$ export ANDROID_MAJOR_VERSION=p
$ make ARCH=arm64 exynos9820-d2s_defconfig
$ make ARCH=arm64
I end up with an Image file and Image.gz with the same Image file inside. I'm not sure if this has built correctly as people talk about being able to use Android kitchen or similar unpacker to unpack and repack the img file. With the Image file I receive it is incompatible with Android Kitchen and another Perl unpacker I have tried.
When you compile your kernel do you get an Image.img file? Or the same as me, just Image, and if so, how do you make it usable?
JPNZ4 said:
Hey,
I have managed to build the kernel by following the instructions in the samsung readme.
Code:
$ export ANDROID_MAJOR_VERSION=p
$ make ARCH=arm64 exynos9820-d2s_defconfig
$ make ARCH=arm64
I end up with an Image file and Image.gz with the same Image file inside. I'm not sure if this has built correctly as people talk about being able to use Android kitchen or similar unpacker to unpack and repack the img file. With the Image file I receive it is incompatible with Android Kitchen and another Perl unpacker I have tried.
When you compile your kernel do you get an Image.img file? Or the same as me, just Image, and if so, how do you make it usable?
Click to expand...
Click to collapse
glad to hear that you could build the kernel.
could you please elaborate which build env you used and which version?
make clean destroys my build env and i needed some patches to make it even compile in the first place.
could you run the kernel successfully on the device?

Categories

Resources