Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] Crossdev with non-Gentoo toolchain?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sat Jul 13, 2013 10:10 am    Post subject: [SOLVED] Crossdev with non-Gentoo toolchain? Reply with quote

I just got a Cherry Mobility M-1007 from my cousin to play with. I did a firmware upgrade, and rooted the tablet. Also the manufacturer made the kernel source code, and the toolchain available... My Gentoo pavlov reaction says: COMPILING!!!
Code:
$ ls gpl_release/kernel
Android.mk  COPYING  Documentation  fs       ipc      kernel       Makefile  README          scripts   tools
arch        CREDITS  drivers        include  Kbuild   lib          mm        REPORTING-BUGS  security  usr
block       crypto   firmware       init     Kconfig  MAINTAINERS  net       samples         sound     virt

$ ls gpl_release/toolchain/*
gpl_release/toolchain/arm-eabi-4.2.1:
arm-eabi  bin  info  lib  libexec  man  MODULE_LICENSE_LGPL_AND_GPL  NOTICE  NOTICE.LIB  PREBUILT  share

gpl_release/toolchain/arm-eabi-4.3.1:
arm-eabi  bin  info  lib  libexec  man  share

gpl_release/toolchain/arm-eabi-4.4.0:
arm-eabi  bin  info  lib  lib32  libexec  man  share

gpl_release/toolchain/arm-eabi-4.4.3:
arm-eabi  bin  include  info  lib  lib32  libexec  man  share

gpl_release/toolchain/arm-linux-androideabi-4.4.x:
arm-linux-androideabi  bin  include  info  lib  libexec  man  share  SOURCES

gpl_release/toolchain/i686-android-linux-4.4.3:
bin  build-toolchain.sh  COPYING  COPYING.LIB  i686-android-linux  lib  libexec  SOURCES

gpl_release/toolchain/i686-linux-glibc2.7-4.4.3:
bin  build-hardy-toolchain.sh  i686-linux  include  lib  libexec  PACKAGE_SOURCES  sysroot  TOOLCHAIN_SOURCES

gpl_release/toolchain/i686-unknown-linux-gnu-4.2.1:
bin  i686-unknown-linux-gnu  include  info  lib  libexec  man  share

gpl_release/toolchain/sh-4.3.3:
bin  lib  libexec  sh-linux-gnu


Is it possible to mix the kernel code and toolchain into the Gentoo embedded handbook procedures, and start making binaries for the tablet? Or is it not that easy... :?:
http://www.gentoo.org/proj/en/base/embedded/handbook/index.xml

For instance, I like to get NFS working. It needs the userspace tools, as NFS support is already in the running kernel. But I also like to have JFS support in the kernel. Maybe in the end: http://plasma-active.org/ .

Thanks!


Update: Marking it "Solved" for now. Maybe re-open it later, or post the progress. Changed subject to match the contents.


Last edited by lost+found on Tue Jul 16, 2013 7:14 am; edited 3 times in total
Back to top
View user's profile Send private message
Hu
Moderator
Moderator


Joined: 06 Mar 2007
Posts: 21607

PostPosted: Sat Jul 13, 2013 3:27 pm    Post subject: Reply with quote

First check if the released tools will allow you to build and run even trivial programs. If a "Hello, world" program works, then you can begin work on integrating it into the Gentoo package manager.
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Sat Jul 13, 2013 5:30 pm    Post subject: Reply with quote

@Hu

Thanks for the advice! I was afraid to hear "no", but maybe it's possible more or less. I think I better start finding out. First target: get "Hello, world!" up and running.

To Be Continued...


Update: Marking the thread "solved" for now.

The first test, trying to compile "int main(){return 0;}", gives some wrong built-in defaults/paths/missing libraries. I see now, that my toolchain isn't even there. A dmesg on the tablet shows 4.5.1 (Sourcery G++ Lite), probably due to the firmware upgrade. Kernel version is the same though and still usable. No, this is not the way to go. I'll proceed with letting crossdev build the toolchain...
Back to top
View user's profile Send private message
lost+found
Guru
Guru


Joined: 15 Nov 2004
Posts: 509
Location: North~Sea~Coa~s~~t~~~

PostPosted: Wed Jul 17, 2013 7:10 pm    Post subject: Reply with quote

Maybe useful info for some people searching the forums.

I decided to search for "Sourcery G++ Lite", that dmesg on the tablet listed in the kernel line. It's a complete toolchain, and has it's own ebuild in Portage (although it seems to be an abandoned package): dev-embedded/sgpp-lite-arm-linux-bin. I expect less problems using this package, when building a kernel/modules from the provided sources.

This is how I mixed it into crossdev. It looks a bit ugly, and maybe it's not 100% perfect, but it seems to work well enough to build working packages.

I followed the Gentoo embedded handbook, and made some symlinks to the Sourcery binary package:
Code:
(chroot) # ln -s ../opt/sgpp-lite-arm-linux-bin-2010.09.50/arm-none-linux-gnueabi /usr/arm-none-linux-gnueabi
(chroot) # cp -a /usr/arm-unknown-linux-gnueabi/etc /usr/arm-none-linux-gnueabi/
(chroot) # nano -w /usr/arm-none-linux-gnueabi/etc/portage/make.conf: arm-none-linux-gnueabi
(chroot) # ln -s /usr/portage/profiles/default/linux/arm/13.0 /usr/arm-none-linux-gnueabi/etc/make.profile

<SYMLINKS TO THE BINARIES>
(chroot) # cd /usr/bin
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-ar arm-none-linux-gnueabi-ar
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-as arm-none-linux-gnueabi-as
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-c++ arm-none-linux-gnueabi-c++
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-c++filt arm-none-linux-gnueabi-c++filt
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-cpp arm-none-linux-gnueabi-cpp
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-elfedit arm-none-linux-gnueabi-elfedit
(chroot) # ln -s cross-emerge arm-none-linux-gnueabi-emerge
(chroot) # ln -s cross-fix-root arm-none-linux-gnueabi-fix-root
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-g++ arm-none-linux-gnueabi-g++
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-gcc arm-none-linux-gnueabi-gcc
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-gcov arm-none-linux-gnueabi-gcov
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-gdb arm-none-linux-gnueabi-gdb
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-gdbtui arm-none-linux-gnueabi-gdbtui
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-gprof arm-none-linux-gnueabi-gprof
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-ld arm-none-linux-gnueabi-ld
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-nm arm-none-linux-gnueabi-nm
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-objcopy arm-none-linux-gnueabi-objcopy
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-objdump arm-none-linux-gnueabi-objdump
(chroot) # ln -s cross-pkg-config arm-none-linux-gnueabi-pkg-config
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-ranlib arm-none-linux-gnueabi-ranlib
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-readelf arm-none-linux-gnueabi-readelf
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-size arm-none-linux-gnueabi-size
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-strings arm-none-linux-gnueabi-strings
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-sprite arm-none-linux-gnueabi-sprite
(chroot) # ln -s /opt/sgpp-lite-arm-linux-bin-2010.09.50/bin/arm-none-linux-gnueabi-strip arm-none-linux-gnueabi-strip
</SYMLINKS TO THE BINARIES>

(chroot) # emerge-wrapper --init --target arm-none-linux-gnueabi
(chroot) # arm-none-linux-gnueabi-emerge -pv busybox


Good luck, and please post your improvements! :)
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum