New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Android ARM support #59
Comments
Hi David, Thanks for reporting the issue. I'll try to debug this in the next couple of days but can you please share the changes you made to the build system? Thanks, |
Here's a diff of my changes:
It's nothing more than adding |
It looks like this
No idea why the ARM toolchain is defining |
I've seen similar errors when integrating LKL with some existing app. |
The problem is that host includes do things like #define sa_handler _u._sa_handler and sa_handler is a member in a Linux/LKL structure and gets replaces by the above macro. The way I fixed these was to #undef them before including LKL headers, but in this case <sys/signal.h> is pulled from <stdint.h> which is pulled from lkl/linux/virtio_ring.h. I am going to try and define these in arch/lkl/include/uapi/syscalls.h to force a _lkl prefix by the install headers script in a couple of hours. This willl allow us to get rid of the undefs in the application code and make things cleaner overall. |
I just pushed a few changes that makes LKL compile with the arm-linux-androideabi- toolchain. However, when trying the test/boot on Android emulator (KitKat) I get a seg fault. I will continue to look into this. |
I will try to add a circle ci instance for the particular target. |
It also segfaults here using 5.1 NDK/5.1 device. As for virtio_ring.h, it seems fixed by my PR which has been merged. Edit: For my usecase, I can just use a standard ARM cross-compiler and staticly link, so I think I'll stick to that. |
@phhusson Where in the initialization process does it segfault? I know @stfairy dealt with a linker bug in |
Looks like it is the first place where it tries to access to rodata. I'll try adding code earlier accessing to data |
Yes, this is the same bug, it's a problem in the linker. As a workaround you might want to try commenting out that line (IIRC it's printing a startup message), or switching to a different linker. @stfairy can probably say more. |
Yes it's printing a startup message, but it most likely means there are other problems. I added -fuse-ld=bfd, and it didn't change a thing?!? (the file size is the same and I still have got the same crash) FIY, my changes are, in tools/lkl/Makefile: |
I have a fix at hand but I still don't fully understand it. My best guess is that The fix is else if (!lv_in->is_section_symbol())
{
// This is not a section symbol. We can determine
// the final value now.
lv_out->set_output_value(
os->output_address(this, shndx, lv_in->input_value()) - os->address());
} |
now you will see a (the?) seg fault in circleci. https://circleci.com/gh/lkl/linux/328 I again disabled 3rd instance for anrdoid build and test until we will be ready. |
may I ask what you are using lkl for inside Android apps? sounds like an interesting usecase. |
The various ideas I had (but I couldn't find the time for it):
|
@M1cha I was working on an app to capture Wi-Fi packets using USB adapters that supported monitor mode and had hoped LKL would let me re-use Linux's ieee80211 stack + USB drivers. Haven't had a chance to try it again. |
From my practice, you need to set |
@stfairy , I tried the latest Unfortunately, the code changes you mentioned here are not included. Do you have any prebuilt toolchains with your code changes, or do you have any guides to build the toolchain from stretch? Thank you. |
is using bfd linker an option for you? That's how we get around this issue. but we are not building it for arm |
I managed to build the binutils with the above code change, but there's one error when linking, like this:
I checked the configuration options, cannot find one for |
@liuyuan10 No,
Can you help to figure out the missing options? Thanks. |
@liuyuan10 finally, I got one workaround. In the beginning, using the patched |
Great !! Is |
@thehajime |
@mxi1 looking forward to your PR ! |
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
Initial attempt to run an application with hijack library on Android platform. Tested mostly on Android 6.x and 7.x. The build process assumes that the android ndk toolchain is installed in a host system. arm32 build is required to use alternate linker in order to avoid a link issue during the build (described in *1). *1 lkl#59 (comment) Signed-off-by: Hajime Tazaki <thehajime@gmail.com>
I would like to use LKL in an Android app, so I added
elf32-littlearm
as a supported POSIX output format in the Makefiles and attempted to build with a standalonearm-linux-androideabi
toolchain, but I get this:I'm not a kernel developer at all, so I don't really know where to go from here.
The text was updated successfully, but these errors were encountered: