Is there a way to compile the GNU toolchain for Android (making it possible to compile c code directly on the phone using gcc and binutils)?
I tried using the ANDROID-NDK to compile a simple c hello world program (no app) outside of Eclipse, using the prebuilt GCC ARM compiler. But I failed, got different errors spitted at me. I will have to read more about how to use the NDK.
But to the reason of this thread. Is this even possible? Will the toolchain libraries be too big for the phone memory if I compile them statically? And that's what I have to do right? Can Android run dynamically linked binaries?
Sent from my GT-I9100 using Tapatalk
Does anyone know how to do this?
Google it: "agcc" or "gcc android"
Probably will help you.
Really bad answer. I'm looking for info on how to make GCC run on the phone.
If you don't know don't post.
colapro said:
Is there a way to compile the GNU toolchain for Android (making it possible to compile c code directly on the phone using gcc and binutils)?
I tried using the ANDROID-NDK to compile a simple c hello world program (no app) outside of Eclipse, using the prebuilt GCC ARM compiler. But I failed, got different errors spitted at me. I will have to read more about how to use the NDK.
But to the reason of this thread. Is this even possible? Will the toolchain libraries be too big for the phone memory if I compile them statically? And that's what I have to do right? Can Android run dynamically linked binaries?
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Check into side booting linux off of your sdcard... That seems like the only way possible to me... There is a market app that will get you all set up with ubuntu. All you need is a device that has a kernel with loop support in it... http://www.xda-developers.com/android/load-ubuntu-on-your-android-device-with-ease/
Sent from my PG06100
Also, according to drob311 post, you can use Linux Installer by Geloula that's available from Google Play (Market)
If your phone and it's kernel supports booting Ubuntu or another form of Linux (BackTrack is awesome), then that's probably your best bet. You'd probably have more luck running just the terminal part, and not using the GUI (it's quite awful if you don't have enough free RAM). Considering cross compiling is needed on x86 or 64 bit machines and it takes quite long and makes the computer heat up really badly, I'm not sure how much you would really want to try it on ARM, especially since most phones nowadays only have 1GB of RAM. Could be faster and simpler since its ARM on ARM, or maybe your phone/tablet will blow up in your hand. If you really want it though, try it. Eclipse is also available for ARM Linux, if you'd want that.
Thanks for your replies!
I was looking for something more like how to build GCC to make it run on Android and to let it use the Android C lib. I was experimenting with os deving a while ago and to do that I had to build a GCC cross-compiler (tutorial on osdev.org wiki). It's something similar to this that I want, but it should:
* Run on Android.
* Produce code for Android.
Should probably look for build parameters for GCC and binutils.
I can't seem to find a prebuilt binary of GCC that runs on Android.
Sent from my GT-I9100 using Tapatalk
AIDE will let you write/compile/run Java code for Android apks on your device. It seems to work well.
I haven't tried it, but C4droid claims to do the same for C, and also has an available GCC Plugin. Might be worth a look.
This could be interesting for you. theGanymedes -> Linux in Android! DesirAPT is at Beta Test! [9 Feb]
I've searched for Cross-compiling Linux Apps to Android to, but got stuck with resolving the dependencies of the Linux App i tried to port to Android. :/
Download gcc plugin for c4droid.apk
Open apk file,you will find gcc.zip in assets folder
Extract gcc.zip to your internal storage
Add gcc path to path variable
Code:
export PATH=$PATH:path-to-extracted gcc/bin
Rename androideabi-gcc to gcc
Run command gcc
This should work even without root in some versions of android
colapro said:
Is there a way to compile the GNU toolchain for Android (making it possible to compile c code directly on the phone using gcc and binutils)?
I tried using the ANDROID-NDK to compile a simple c hello world program (no app) outside of Eclipse, using the prebuilt GCC ARM compiler. But I failed, got different errors spitted at me. I will have to read more about how to use the NDK.
But to the reason of this thread. Is this even possible? Will the toolchain libraries be too big for the phone memory if I compile them statically? And that's what I have to do right? Can Android run dynamically linked binaries?
Sent from my GT-I9100 using Tapatalk
Click to expand...
Click to collapse
Q1. Is this even possible?
it is possible, i did it today and compiled pcre library and the silver searcher app which uses it. Used ndk and juice ssh to dev and test. Requires root as far as i know because most areas are mounted as noexec and accessing /data/local needed root. Theres some loop method on sdcard which is foreign to me, but MAYBE doesnt require root.
Q2. Will the toolchain libraries be too big for the phone memory if I compile them statically? And
Didnt try static yet, but will assume no problems. also depends on your phone, the one that i ran has 4GB of RAM and 64GB of flash storage.
Q3. that's what I have to do right?
this q is unclear to me.
Q4. Can Android run dynamically linked binaries?
yes, this was how i linked with libc and libgcc with licpcre and with the ag app.
Plan to write out the steps in the next week or two.
Related
I'm not sure if this is the right forum, but XDA is really the only place I can figure to ask.
I've been looking for a way to compile linux applications to run on the command line, for instance nano or lynx. I've found the "agcc hello.c -o hello
" method, but the builds I'm trying for are defendant on ./configure.
I've got a working toolchain, and can even compile android itself, and I've got agcc working. I just can't figure out how to get them all working together.
Any help?
In the ./configure, you need to point it to your compiler (i.e. "agcc").
Try "./configure --help" to see the options it is looking for to make this configuration.
I think you have to set up an arm-eabi cross compiler.
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
maxisma said:
I think you have to set up an arm-eabi cross compiler.
Click to expand...
Click to collapse
He did.... agcc is a script that runs it.
RoboPhred said:
You can try the android native development kit:
http://developer.android.com/sdk/ndk/1.5_r1/index.html
I think this is designed to make native components for the normal dalvik android apps, but it may have useful information.
Click to expand...
Click to collapse
NDK creates libraries that can be called from within native apps (i.e. shared objects). It does not create native executables.
This should help?
http://forum.xda-developers.com/showthread.php?t=431329
I've made a wee bit of progress.
My current set up is this:
Step 1: Download this
Step 2: Push it to /system/sd/usr
Step 3: Remount system AND root partitions, then symlink /system/sd/usr to /usr. Then, mkdir /tmp.
Step 4: Push sources to /system/sd. Change working directory to your extracted source file, then run ./configure --host=armv6l-unknown-linux-gnueabi --with-build-cc=/bin/gcc
Step 5: ????
Step 6: Profit
I'm still working out the bugs here, and I'll report back when I've got something working. Currently, I'm trying to compile GNU Make for Android.
check the apps section i think i rememeber somone already compiling nano for android...
i wanted to compile sshfs but then again there is a lot of things i wanna do... LOL
Hey all,
So here's what I've got / am thinking. I have a rooted Motorola Xoom 3g model, and I can access the command line. Now, I realize that Apps can only be written in / run with Java in the Dalvik VM. What I fail to understand is, that things like busybox, and even Backtrack 5 has an "arm" version that you can easily install side by side with Honeycomb. So, what I'm trying to figure out is, how can I (or why can I not) write apps in C or C++ that are system based daemon's, that are Not Apps per se for the honeycomb system, but simple *nix based programs?
So, I didn't see a good way to mark this thread as solved, but I figured it out. You need to use an ARM cross-compiler (gcc/g++ has one, or you can use Code Sourcery's compiler, which I did). It was a breeze to build a simple program on my *nix box, compile it with that (arm-none-linux-gnueabi-gcc -static hello.c -o hello) and adb push it to the Xoom!
sovereign_313 said:
So, I didn't see a good way to mark this thread as solved, but I figured it out. You need to use an ARM cross-compiler (gcc/g++ has one, or you can use Code Sourcery's compiler, which I did). It was a breeze to build a simple program on my *nix box, compile it with that (arm-none-linux-gnueabi-gcc -static hello.c -o hello) and adb push it to the Xoom!
Click to expand...
Click to collapse
The way to mark a thread as [SOLVED] is to edit the first post in advanced mode and change the title.
I realize people gave up slightly on the whole kexec thing over radio worries, but I now have the module compiling and inserting without error into the Droid2/DroidX gingerbread kernel. Next comes cross compiling the kexec-tools for userspace, to allow us to attempt inserting a different kernel.
To build, you'll need a compiled DroidX kernel from source, as well as the android NDK.
To build, make sure you have downloaded the DroidX GB kernel source and compiled it. There are guides everywhere on how to build Android kernels. Just make sure you use the proper cross compiler.
http://sourceforge.n....l.tgz/download
When you build, make sure to use
Code:
make mapphone_defconfig
Once the kernel is built, clone my repo and edit envsetup.sh to reflect the correct paths to your kernel source directory and the android NDK.
https://github.com/i...kexec-mod-d2-dx
Then, source it:
Code:
source envsetup.sh
Then, just run
Code:
make
and cross your fingers. You should then have a fresh kexec_load.ko file!
To see if it loads, you'll need to copy it to your sdcard, and then on the phone, using a console, do the following:
Code:
su (click allow)
insmod /sdcard/path/to/kexec_load.ko
If you don't get any errors, it inserted! Now, of course, to actually use it, we'd need the kexec-tools built, which I haven't gotten ready yet...but they're coming! To remove the module (no reason to leave it in memory for now):
Code:
rmmod kexec_load
Happy hacking, and help is always appreciated!
This looks great! If you need any help just ask
Thanks! I probably could actually use some. I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there.
I'm looking at eternity project's git repos now, and am trying to figure out how they managed to get atags working, with the whole procfs thing...still scratching my head there, though I do have an atags module working, except it doesn't do anything without atags in the procfs (http://lists.infradead.org/pipermail/kexec/2011-January/004795.html).
kexec-tools:
https://github.com/i...xec-tools-dx-d2
To build, see the README.
Then, copy the binaries from /build/sbin/* to your device, and the move them to the /system/bin directory, and chmod them 770 to make them executable.
mod-atags:
https://github.com/i...mod-atags-d2-dx
Now, if I/we can just get atags and procfs stuff taken care of, we'll be able to go to the next step. I already have atags compiling as a module, but it won't stay inserted because we have no atags in the procfs. Note I can't just trace through code like this and know what everything is doing, but I know enough to hack at it and be dangerous
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
calebcoverdale said:
I know this is kind of off topic, but would this help us people with Motorola Atrix 2? Does it use the same radio?
Click to expand...
Click to collapse
No idea. I haven't even gotten the kernel to change yet, so I haven't gotten to mess with radio yet. The method itself should/would work though, but radio will require reverse engineering...perhaps find a similar phone with an open bootloader and disassemble and attempt to clone it's modules.
The latest change I made may or may not work, it was an attempt to remove atags from the kexec module based on an old patch I found, which added the functionality. This at leaset made kexec -l zImage work, but when I run kexec -e, the kexec binary complains about atags not being there...hrmmmph.
I may have to revert it (and will if we can get atags somehow) ...but if we can get the kexec bin to ignore /proc/atags or just find a way to rip them out of the running kernel, we'll be in business.
The commit: https://github.com/ilikenwf/kexec-mod-d2-dx/commit/12dffe0ea286be0fe9ab0303a5a35ed92be4ee2c
I'm also looking into 2ndboot.
I like where this is going! Keep working!
Sent from my DROID2 using xda premium
Okies, so, I emailed aliasxerog (original kexec-mod writer), and I hope he'll get back to me. Even though his twitter says he's a "former android developer," maybe he'll be willing to give me some hints so I can pick up where he left off.
I also got the froyo version of the module building properly based on his module, yet again, (all after SBF'ing my phone back down to motoblur froyo - yech!) but neither currently work... (note there's a gingerbread and a froyo branch on my repo): https://github.com/i...kexec-mod-d2-dx
The froyo one throws the following error, which stops me dead in the water:
Code:
Could not find a free area of memory of 3007dc bytes...
The gingerbread one loads the kernel into memory but won't execute it due to our not having atags.
We've moved our git repos to an organization for easier collaboration:
https://github.com/organizations/D2-DX-Customboot
links are imcomplete.
use URL lable pls.
Cross compiler version ?
hello,
Sorry but I am not able to use the sourceforge link that you provided to download kernel source .. Also please share what cross compiler version is to be used....
Thanks in advance.
e2fstools package, statically built for arm64 devices from Google's googlecode.com Oreo branch
NOTE: These will support ANY version of android's filesystems that use ext2 or ext3 or ext4. I built them from oreo branch as that one was the closest to compiling without any editing of the Makefiles. Don't let the name throw you off
I needed to run a modern fsck on a rooted device I have that I have been doing some hacking on.
The filesystem was in bad shape and the on-device e2fsck absolutely refused to check it while it was even mounted, even with the force option. Out of part desperation part determination I decided I would just build one myself. So I went and dug up the sources from googlecode.com, transfered them to my linux workstation, and after much fighting with gcc for cross compilation, finding a place in the google git repo where they actually build (hence going with orero), and having to tweak the c code even in a few places (mostly fixing includes and whatnot, no actual coding on my part), I succeeded.
As it says in the title, these are all the e2fstools binaries built from Google's googlecode.com source tree in their Oreo release branch. They are also compiled statically (no libraries are needed for them to function) so they should work absolutely fine on any device that has a 64bit arm (aarch64) processor. I have tested a handfull of them and they work perfectly fine on my Samsung Galaxy s8. In fact I used the fsck.ext4 binary to repair my system partition which it did perfectly.
https://www.dropbox.com/s/owb76hohnjzjdwe/e2fstools-oreo-aarch64-static.tar.gz?dl=0
Hope they come in as handy to someone else as they did me.
List of files follows:
Code:
[email protected]:~> tar tzf e2fstools-oreo-aarch64-static.tar.gz
e2fsbin/
e2fsbin/e2undo
e2fsbin/e2image
e2fsbin/badblocks
e2fsbin/mkfs.ext3
e2fsbin/fsck.ext4dev
e2fsbin/e2initrd_helper
e2fsbin/fsck.ext3
e2fsbin/e4crypt
e2fsbin/e4defrag
e2fsbin/mke2fs
e2fsbin/e2fsck
e2fsbin/fsck.ext4
e2fsbin/filefrag
e2fsbin/tune2fs
e2fsbin/e2freefrag
e2fsbin/uuidd
e2fsbin/e2label
e2fsbin/mkfs.ext2
e2fsbin/blkid
e2fsbin/logsave
e2fsbin/lsattr
e2fsbin/uuidgen
e2fsbin/findfs
e2fsbin/mklost+found
e2fsbin/dumpe2fs
e2fsbin/mkfs.ext4
e2fsbin/debugfs
e2fsbin/fsck.ext2
e2fsbin/mkfs.ext4dev
e2fsbin/resize2fs
e2fsbin/chattr
e2fsbin/fsck
PS: Now that I have a working arm64 cross compilation system setup, if anyone else desperately needs a working static binary for anything relatively simple to build (as in not 50 million dependencies for me to track down and install) and can send me or link me the sources for it and its dependencies, I would be happy to oblige.
Unfortunately, my device is armv7
buengeut said:
Unfortunately, my device is armv7
Click to expand...
Click to collapse
I forget, is that 32bit? If so i could fairly easily build new ones that are 32bit. Did you try them and they didnt work? If its 64bit they may work anyway, as these dont use any fancy instructions, and i did not build them even with -O1. I thought the main differences between the different "v"s of the same arch (32v64) was in libc and friends, of which these dont use as they are completely static so libc is built in.
I was even thinking of making this a flashable zip, but i hadnt bothered as no one replied to my initial post so i didnt think anyone cared ?️
partcyborg said:
I forget, is that 32bit? If so i could fairly easily build new ones that are 32bit. Did you try them and they didnt work? If its 64bit they may work anyway, as these dont use any fancy instructions, and i did not build them even with -O1. I thought the main differences between the different "v"s of the same arch (32v64) was in libc and friends, of which these dont use as they are completely static so libc is built in.
I was even thinking of making this a flashable zip, but i hadnt bothered as no one replied to my initial post so i didnt think anyone cared ?️
Click to expand...
Click to collapse
ARMv7 is ARM 32bit, 64bit program will not work on a 32bit system.
Can you build e2fstools for ARMv7.
Sadly your link is down.
would you care to reupload?
LNQ said:
Sadly your link is down.
would you care to reupload?
Click to expand...
Click to collapse
Sure. I'll even make it flashable this time ?
Thanks alot, good sir!
Legend! I'd been dealing with not being able to repair my /data errors for the past few days since my Oreo update. The current TWRP (3.2.3.4) still has an ancient e2fsck that doesn't support the ext4 quota option that LG formats their Oreo data partition with. The updated version in /system/bin works while the OS is running which is why I knew I had errors, but I couldn't get it to run in TWRP to fix them because of the incompatible library files.
I was all set to reinstall my Android SDK and compile another version with inbuilt libraries when I decided to do one last search and found this thread where you'd already done it. So thanks for saving me a few hours of downloading/installing/remembering how to compile for Android all over again
I guess I can also vouch for it working on an LG V20. I don't know if it's just LG's version of Oreo that needs the later e2fsck or others too, but anyone who can't repair errors on their ext4 partitions in TWRP due to needing a newer e2fsck version should be able to use this version. I just copied the file fsck.ext4dev to /cache and ran it from there on my data partition.
Your link is dropbox banned...
Any chance you could attach the zip here...?
quotient said:
Your link is dropbox banned...
Any chance you could attach the zip here...?
Click to expand...
Click to collapse
Seconded!
@partcyborg
Any chance you could put this file somewhere else? The above link is banned.
Thanks!
Hi,
I have a Oneplus 3 that after 3 years of use became sluggish as hell at file system access.
After reading thus document https://www.usenix.org/system/files/conference/hotstorage16/hotstorage16_ji.pdf
I would give a try to your e2fstools build.
Can you repost a link to download?
Thanks in advance
partcyborg said:
I forget, is that 32bit? If so i could fairly easily build new ones that are 32bit. Did you try them and they didnt work? If its 64bit they may work anyway, as these dont use any fancy instructions, and i did not build them even with -O1. I thought the main differences between the different "v"s of the same arch (32v64) was in libc and friends, of which these dont use as they are completely static so libc is built in.
I was even thinking of making this a flashable zip, but i hadnt bothered as no one replied to my initial post so i didnt think anyone cared ?️
Click to expand...
Click to collapse
Late to this thread, great work!
I have the exact same problem.
Could you please post flashable zip and/or instructions how to load this into android?
Thank you
I found a binary on website, tested on Nexus 5 (ARMv7L 32bits)
GitHub - FerryAr/e2fsprogs-arm: Static build of e2fsprogs for Android Magisk Module
Static build of e2fsprogs for Android Magisk Module - GitHub - FerryAr/e2fsprogs-arm: Static build of e2fsprogs for Android Magisk Module
github.com
partcyborg said:
e2fstools package, statically built for arm64 devices from Google's googlecode.com Oreo branch
NOTE: These will support ANY version of android's filesystems that use ext2 or ext3 or ext4. I built them from oreo branch as that one was the closest to compiling without any editing of the Makefiles. Don't let the name throw you off
I needed to run a modern fsck on a rooted device I have that I have been doing some hacking on.
The filesystem was in bad shape and the on-device e2fsck absolutely refused to check it while it was even mounted, even with the force option. Out of part desperation part determination I decided I would just build one myself. So I went and dug up the sources from googlecode.com, transfered them to my linux workstation, and after much fighting with gcc for cross compilation, finding a place in the google git repo where they actually build (hence going with orero), and having to tweak the c code even in a few places (mostly fixing includes and whatnot, no actual coding on my part), I succeeded.
As it says in the title, these are all the e2fstools binaries built from Google's googlecode.com source tree in their Oreo release branch. They are also compiled statically (no libraries are needed for them to function) so they should work absolutely fine on any device that has a 64bit arm (aarch64) processor. I have tested a handfull of them and they work perfectly fine on my Samsung Galaxy s8. In fact I used the fsck.ext4 binary to repair my system partition which it did perfectly.
https://www.dropbox.com/s/owb76hohnjzjdwe/e2fstools-oreo-aarch64-static.tar.gz?dl=0
Hope they come in as handy to someone else as they did me.
List of files follows:
Code:
[email protected]:~> tar tzf e2fstools-oreo-aarch64-static.tar.gz
e2fsbin/
e2fsbin/e2undo
e2fsbin/e2image
e2fsbin/badblocks
e2fsbin/mkfs.ext3
e2fsbin/fsck.ext4dev
e2fsbin/e2initrd_helper
e2fsbin/fsck.ext3
e2fsbin/e4crypt
e2fsbin/e4defrag
e2fsbin/mke2fs
e2fsbin/e2fsck
e2fsbin/fsck.ext4
e2fsbin/filefrag
e2fsbin/tune2fs
e2fsbin/e2freefrag
e2fsbin/uuidd
e2fsbin/e2label
e2fsbin/mkfs.ext2
e2fsbin/blkid
e2fsbin/logsave
e2fsbin/lsattr
e2fsbin/uuidgen
e2fsbin/findfs
e2fsbin/mklost+found
e2fsbin/dumpe2fs
e2fsbin/mkfs.ext4
e2fsbin/debugfs
e2fsbin/fsck.ext2
e2fsbin/mkfs.ext4dev
e2fsbin/resize2fs
e2fsbin/chattr
e2fsbin/fsck
PS: Now that I have a working arm64 cross compilation system setup, if anyone else desperately needs a working static binary for anything relatively simple to build (as in not 50 million dependencies for me to track down and install) and can send me or link me the sources for it and its dependencies, I would be happy to oblige.
Click to expand...
Click to collapse
Hi nice compilation job! I know it's not always easy to compile these binaries from source...
Can you please reupload you archive here as attachment? Thanks!
lebigmac said:
Hi nice compilation job! I know it's not always easy to compile these binaries from source...
Can you please reupload you archive here as attachment? Thanks!
Click to expand...
Click to collapse
There's a Magisk module that does cross-compilation specifically, you should get it.
By the way, the link for that drop box is dead.
I'm not sure if many are aware, but LG TVs running webos (under webos 2.x here) probably contain a *full* installation of Qt ( in my case full Qt 5.2.1 is installed). When I said full, I mean that all Qt quick, declarative, webKit, gui, network, OpenGL, etc. Qt libraries are available .
So far I've managed to successfully test/run the following:
-simple OpenGL ES applications (webos uses the Wayland architecture, see https://wayland.freedesktop.org for details ); I can actually compile and run any client included in Weston 1.2.0, see https://wayland.freedesktop.org/releases/ for what is available.
- Qt QML, Qt GUI applications also with WebKit can all be compiled and run on the TV.
- Kernel modules: compiled CIFS module and I'm able to moutn SMBA shares under SmartShare. Recording to Samba shares not possible unfortunately....
- getevent android tool ported to linux (see https://github.com/ndyer/getevent). Very useful for finding various key events. I used it to write my own 'daemon' to listen to Magic Remote key presses and start other applications.
- I've managed to also compile qemu-i386 (from qemu-stable 2.4) so that I can run the native sopcast linux i386 client (sp-sc-auth) on the TV itself. This in combination with a custom-made Qt application for choosing sop streams and SS IPTV means that I can watch sopcast streams on my TV at the push of a remote button.
- Custom-made ambilight. I capture screen, decode produced jpeg file, do led color computations and spit them via usb (libusb available on the TV) to an arduino controlling the LEDS.
====
Needless to say, but as prerequisites you need a rooted TV, access to TV via telnet and/or ssh/sftp, extracted rootfs from your TV, toolchain and kernel sources (if you need compile additional modules). Toolchain and kernel sources are available for my TV, from the LG open-source website.
If other people are interesting I can post some more details.
I was trying to do the same thing, I compile several sources with curl library after extracting the file system , can you give me more info on the Qt library?
thanks
y=fx said:
I was trying to do the same thing, I compile several sources with curl library after extracting the file system , can you give me more info on the Qt library?
thanks
Click to expand...
Click to collapse
Well, I think that the Qt library version installed on your TV may not be the same with mine; probably it depends on the webos version. On my TV I have Qt 5.2.1 (easy to tell from the file extension,; for instance I have Qt lib files with names such as libQt5Core.so.5.2.1, etc.) By luck I'm running Kubuntu 14.04 which uses, by default, the same Qt version. So this means that I've already had all Qt headers installed under /usr/include.
In your case, you'll need to download all Qt dev library packages matching the libs. from your tv, and extract them manually somewhere. Once you have that generate makefiles using qmake, then modify them to point to your libs. and headers.
Let me know how it goes for you.
xtreme_protector said:
Well, I think that the Qt library version installed on your TV may not be the same with mine; probably it depends on the webos version. On my TV I have Qt 5.2.1 (easy to tell from the file extension,; for instance I have Qt lib files with names such as libQt5Core.so.5.2.1, etc.) By luck I'm running Kubuntu 14.04 which uses, by default, the same Qt version. So this means that I've already had all Qt headers installed under /usr/include.
In your case, you'll need to download all Qt dev library packages matching the libs. from your tv, and extract them manually somewhere. Once you have that generate makefiles using qmake, then modify them to point to your libs. and headers.
Let me know how it goes for you.
Click to expand...
Click to collapse
I did it this way for the sdl2 library, but I had to copy the whole file system and mount it to make a chroot . The problem I encountered for the QT library (the version in use on my TV is 5.4.1) it's with the compiler. I do not have a compiler that supports c++11 , I only found version 4.2.3 of gcc/g++ as a working ipk package ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/gcc_4.2.3-1_arm.ipk
Code:
Target: arm-none-linux-gnueabi
Configured with: ../gcc-4.2/configure --build=i386-pc-linux-gnu --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --prefix=/opt --disable-nls --disable-static --with-as=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-as --with-ld=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-ld --enable-languages=c,c++ --disable-multilib --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --enable-shared --enable-symvers=gnu --enable-__cxa_atexit
Thread model: posix
gcc version 4.2.3
edit: ok I was able to fill out a small program correctly
y=fx said:
I did it this way for the sdl2 library, but I had to copy the whole file system and mount it to make a chroot . The problem I encountered for the QT library (the version in use on my TV is 5.4.1) it's with the compiler. I do not have a compiler that supports c++11 , I only found version 4.2.3 of gcc/g++ as a working ipk package ipkg.nslu2-linux.org/feeds/optware/cs08q1armel/cross/unstable/gcc_4.2.3-1_arm.ipk
Code:
Target: arm-none-linux-gnueabi
Configured with: ../gcc-4.2/configure --build=i386-pc-linux-gnu --host=arm-none-linux-gnueabi --target=arm-none-linux-gnueabi --prefix=/opt --disable-nls --disable-static --with-as=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-as --with-ld=/home/slug/optware/cs08q1armel/toolchain/arm-2008q1/bin/arm-none-linux-gnueabi-ld --enable-languages=c,c++ --disable-multilib --enable-threads --disable-libmudflap --disable-libssp --disable-libgomp --disable-libstdcxx-pch --enable-shared --enable-symvers=gnu --enable-__cxa_atexit
Thread model: posix
gcc version 4.2.3
how did you fill out the qt sources ? does the qt source you compiled work?
Click to expand...
Click to collapse
I did not recompile Qt. I simply used all libs from the TV (rootfs) and local additional header files. As I said, I generate makefiles using qmake, modify them to point them to the TV libraries and then compile whatever I need... Btw. I cross-compiled my Qt programs.
Regarding the toolchain, I have version 4.6.4 (dated 20120731).
xtreme_protector said:
I did not recompile Qt. I simply used all libs from the TV (rootfs) and local additional header files. As I said, I generate makefiles using qmake, modify them to point them to the TV libraries and then compile whatever I need... Btw. I cross-compiled my Qt programs.
Regarding the toolchain, I have version 4.6.4 (dated 20120731).
Click to expand...
Click to collapse
I have always used the dynamic libraries present, however I managed to compile and package a test program. Now the next step is to do some porting, eg kodi .
good news www.cnx-software.com/2018/03/19/lg-releases-webos-open-source-edition-optimized-for-raspberry-pi-3/
y=fx said:
I have always used the dynamic libraries present, however I managed to compile and package a test program. Now the next step is to do some porting, eg kodi .
good news www.cnx-software.com/2018/03/19/lg-releases-webos-open-source-edition-optimized-for-raspberry-pi-3/
Click to expand...
Click to collapse
Regarding kodi, I've already started . I've started with Jarvis since it has support for wayland. Unfortunately even this requires g++ 4.7.x or better. Not sure if teh standard arm gcc toolchain (4.7 on ubuntu 14.0.4) produces runnable executables. Will try this evening, though.
Edit: The arm cross-compiler installed by default in ubuntu 14.0.4 works. So, most likely any " arm-linux-gnueabi" will work for you. I'm using now "arm-linux-gnueabi-gcc (Ubuntu/Linaro 4.7.3-12ubuntu1) 4.7.3"
If you have ideas regarding kodi porting, let me know. It would be just great to have it running on our TVs.
===
Also the link you posted regarding webos on RPI looks promising, indeed. Question is what is inside .
Edit: kodi already starts but cannot create the window system. I know what happened: the modified configure script failed to enable building the wayland back end. Will try again, although my TV uses really old wayland ( version1.1.0). I'll keep you posted...
Well, regarding kodi, I enabled wayland, libraries load fine, but now I get a "Illegal instruction" error. This is a tough one since without proper tools (gdb, strace), it's difficult to figure out what's going on.
If anyone could help figuring this one out, let me know.
Hi this morning I ported a small application. I posted the app on github https://github.com/Sputkin/uMario_Jakowski .
xtreme_protector said:
Well, regarding kodi, I enabled wayland, libraries load fine, but now I get a "Illegal instruction" error. This is a tough one since without proper tools (gdb, strace), it's difficult to figure out what's going on.
If anyone could help figuring this one out, let me know.
Click to expand...
Click to collapse
How are you connecting dynamic libraries ? how you have configured the project
y=fx said:
Hi this morning I ported a small application. I posted the app on github https://github.com/Sputkin/uMario_Jakowski .
Click to expand...
Click to collapse
Nice, will have a look. How did you manage to pack it as an ipk ? Where does it install ? Is a native app, i..e, does it appear in the webos start menu ?
y=fx said:
How are you connecting dynamic libraries ? how you have configured the project
Click to expand...
Click to collapse
Right, so it's a mix of existing libs from TV (rootfs) and my own compiled ones. The process was as follows:
- configure kodi for wayland, cross-compilation, arm arch, etc. Of course the configure script would stop in some missing library.
- Whenever the above happens, patch/modify the configure script to skip checking for the installed lib. If the library exists in the rootfs, nothing to do.
- Else, download source of the library, cross-compile it for arm, install it in some dir.
- In the end, the configure script finishes...
- Trying then to make kodi, the linking process stops for missing libraries (on my TV the libs. names end in libxxx.so.ver.subver_etc.so, so no way for the patched build system to find the proper name for the *.so file). In this case, I've manually modified the Makefile to point to the library (using -l:libxxx.so.ver.subver_etc.so). It's a very cumbersome process, but hey, for now it's good enough...
===
I could upload my configure file for kodi Jarvis. Also, the main modified Makefile might help, to get you an idea about what I mean...
My point is that I;m just trying to see if kodi 'can' work, without lots of source code modifications. If this succeeds, of course, we need to take a step back and build a sound build system for the webos.
One more update regarding kodi: I now have gdb and strace running on the TV, and i can trace where the "illegal instruction" happens. Unfortunately it is in the boost library, in function try_lock() (which has different implementations for different architectures). I'm going to try to bypass the error by forcing to use the pthread library. Let's see what comes out .
xtreme_protector said:
Nice, will have a look. How did you manage to pack it as an ipk ? Where does it install ? Is a native app, i..e, does it appear in the webos start menu ?
Click to expand...
Click to collapse
I used the tools provided in the sdk, ares-package ares-install ..... etc . here you can find my template https://github.com/Sputkin/uMario_Jakowski/tree/master/webos_ipk
if you can, upload the configuration file for jarvis branch
Well, kodi starts now !!!
Let's see what works .
Well, no 'magic remote' input, so cannot tell ....
y=fx said:
I used the tools provided in the sdk, ares-package ares-install ..... etc . here you can find my template https://github.com/Sputkin/uMario_Jakowski/tree/master/webos_ipk
if you can, upload the configuration file for jarvis branch
Click to expand...
Click to collapse
Please see my prev. questions. How did you pack it ? What it uses (SDL maybe ???). Up to my head in the kodi stuff. I need to get them 'magic mote'' working, just to see where the next crash is....
you can connect an HID device
---------- Post added at 06:51 PM ---------- Previous post was at 06:40 PM ----------
xtreme_protector said:
Please see my prev. questions. How did you pack it ? What it uses (SDL maybe ???). Up to my head in the kodi stuff. I need to get them 'magic mote'' working, just to see where the next crash is....
Click to expand...
Click to collapse
uses the SDL2 library entirely so it should work on any version with this library . To package, you must use the ares-package script provided in the LG SDK , copy the appinfo.json file and the images in the folder where you have compiled kodi , change the name of the executable in the appinfo.json file and then exec
Code:
ares-package .
Ok, clear, thanks. Will try.
===
Now, any idea how to get some 'input' into kodi ?
Edit: How could I force kodi to use the magic mote (which I suppose/hope is some touch/mouse interface) ??? Is there a kodi setting ?
xtreme_protector said:
Ok, clear, thanks. Will try.
===
Now, any idea how to get some 'input' into kodi ?
Edit: How could I force kodi to use the magic mote (which I suppose/hope is some touch/mouse interface) ??? Is there a kodi setting ?
Click to expand...
Click to collapse
...
Even with a usb keyboard connected, I cannot get kodi to respond to keys (no crashes though ...
What's going on ? Ideas ?
xtreme_protector said:
Even with a usb keyboard connected, I cannot get kodi to respond to keys (no crashes though ...
What's going on ? Ideas ?
Click to expand...
Click to collapse
please upload the configuration file so that I can test it directly
y=fx said:
please upload the configuration file so that I can test it directly
Click to expand...
Click to collapse
That's not going to be so simple I mean I did not have to modify only the configure script but lots other places. I'll update the whole sheebag; will bet back with the link.