Page 1 of 4
[HELP] ARM Cross Compilation Toolchain
Posted: Fri Dec 21, 2012 10:34 pm
by E3V3A
Hi,
I need some help to understand, setup and use the cross-compilation tool-chain for the ES-series T-MST10PDEUC based kernels and code.
The results will be published in the ES-series Wiki over
HERE.
First, I have tried to follow
THIS Wiki entry for the MIPS based C/D series, using a pre-compiled tool-chain provided by "
VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz" but it's not working as expected...
Perhaps it was made for a Linux distro? (I'm using a Windows+Cygwin combo, that have always worked flawless...until now.)
Second I tried using the CodeSourcery
CodeBench Lite (for Windows):
arm-2012.09-64-arm-none-linux-gnueabi.exe. That installed fine and even runs, but not quite as expected, or simply I just don't know what compiler flags to use. Eg.
Code: Select all
$ arm-none-linux-gnueabi-gcc.exe -mglibc -march=armv7 hellow.c -o hellocs
hellow.c:1:0: error: target CPU does not support ARM mode
$ arm-none-linux-gnueabi-gcc.exe -mglibc -mcpu=arm7 hellow.c -o hellocs
C:\cygwin\tmp\ccWziuA7.s: Assembler messages:
C:\cygwin\tmp\ccWziuA7.s:36: Error: selected processor does not support ARM mode `bx lr'
$ arm-none-linux-gnueabi-gcc.exe -mglibc -march=armv5 hellow.c -o hellocs
[OK]
I tested this on TV and ran fine. But I'm confused that arc is armv5 since
/proc/cpuinfo shows:
Code: Select all
Processor : ARMv7 Processor rev 0 (v7l)
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x3
CPU part : 0xc09
CPU revision : 0
Hardware : amber3
Clearly "Hello World" is only dependent on stdio.h, but I'd like to compile something more advanced and useful, like Busybox, ssh etc... So how can I do that?
Also, is there a way I can use the Samsung supplied VDLinux toolchain with Windows?
Re: [REF] ARM Cross Compilation Toolchain
Posted: Wed Dec 26, 2012 5:35 pm
by Denny
E3V3A wrote:
Clearly "Hello World" is only dependent on stdio.h, but I'd like to compile something more advanced and useful, like Busybox, ssh etc... So how can I do that?
Simple compile it with Sam?s VDLinux compiler , there is no problem use it.(except u need SDL,X etc... then you need to prebuild librarys and to install it into toolchain dir?s)
E3V3A wrote:
Also, is there a way I can use the Samsung supplied VDLinux toolchain with Windows?
Sure.
Install VMWare (or player) , Install some Linux Distro (or google for alredy preinstalled VMWare images), extract VDLinux into /opt directory, export toolchain path or "CC" variable , compile whatever you want there is no need go complicated way.
Re: [REF] ARM Cross Compilation Toolchain
Posted: Wed Dec 26, 2012 9:02 pm
by E3V3A
Denny wrote:
Simple compile it with Sam?s VDLinux compiler , there is no problem use it.(except u need SDL,X etc... then you need to prebuild librarys and to install it into toolchain dir?s)...
Sorry, but that is not helpful either, as it is lacking all forms of practical instructions...
But no problem, I have already resolved most issues and I'm working on an extensive Wiki entry.
I reserved a few post here, but it seem that they have been mysteriously removed??
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Wed Dec 26, 2012 9:09 pm
by juusso
ah, mod logs showed someone was not really accurate by moderating topic...
Re: [REF] ARM Cross Compilation Toolchain
Posted: Thu Dec 27, 2012 11:21 am
by arris69
E3V3A wrote:Denny wrote:
Simple compile it with Sam?s VDLinux compiler , there is no problem use it.(except u need SDL,X etc... then you need to prebuild librarys and to install it into toolchain dir?s)...
Sorry, but that is not helpful either, as it is lacking all forms of practical instructions...
the question is that is really required, we started with openembedded 3 years ago (just 3 people used/improved it).
and it's also endless documented on internet how to crosscompile for arm architecture...
But no problem, I have already resolved most issues and I'm working on an extensive Wiki entry.
I reserved a few post here, but it seem that they have been mysteriously removed??
just my 0,02 ?
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Fri Jan 04, 2013 4:20 am
by E3V3A
So I have spent waaaay too much time this holiday trying to do something useful with the Samsung sources. But it's all in a state of misery.
1. CodeSourcery (CS) compiler works great and is very easy to use to install and compile "HelloWorld" program.
2. Samsung VDLinux toolchain is completely useless in Cygwin environment...
3. Trying to use CS + Cygwin (Windows) to compile a HelloWorld kernel
module has failed big time. I just have no idea what the hell is so messed up!? It seem that the Samsung sources (UExxES6xxx.zip) seem FUBAR and simple shit like make fails miserably... This is where I have wasted all my time... They have hardcoded weird shit into the Makefile.
At this point I have not managed to produce a single module using make and the Samsung sources! :( I'm quite sure I've been following most standards procedures for doing it. I have read hundreds of pages on this the last few days. In theory this should be close to trivial...
What I'm trying to do is just compiling the hello world kernel module: hellok1.c
Code: Select all
#include <linux/module.h> /* Needed by all modules */
#include <linux/kernel.h> /* Needed for KERN_ALERT */
MODULE_LICENSE("GPL");
MODULE_AUTHOR("E:V:A 2013");
MODULE_DESCRIPTION("Demo kernel module for MST-X10P (ARM Cortex A9)");
int init_module(void) {
printk(KERN_ALERT "E:V:A is in the Kernel!\n");
return 0;
}
void cleanup_module(void) {
printk(KERN_ALERT "Goodbye TV Kernel!\n");
}
using this Makefile:
Code: Select all
ifneq ($(KERNELRELEASE),)
# Kbuild part
obj-m += hellok1.o
else
PWD := $(shell pwd)
KERNELDIR := /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11
MOREHEADS := /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/include
EXTRA_CFLAGS += -march=armv7-a -mcpu=cortex-a9 -marm -mlittle-endian -mglibc -static -I$(MOREHEADS)
default:
$(MAKE) -C $(KERNELDIR) M=$(PWD) O=$(PWD) modules
endif
Then after having edited in/out all sort of garbage the top level Makefile, referring directly to faulty $CC links, VDLinux toolchains, and crappy ARCH detection code. I get this:
Code: Select all
$ make -w V=1
make: Entering directory `/cygdrive/d/zarm/myarm/kernel_modules'
make -C /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11 M=/cygdrive/d/zarm/myarm/kernel_modules O=/cygdrive/d/zarm/myarm/kernel_modules modules
make[1]: Entering directory `/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11'
make -C /cygdrive/d/zarm/myarm/kernel_modules \
KBUILD_SRC=/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11 \
KBUILD_EXTMOD="/cygdrive/d/zarm/myarm/kernel_modules" -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Makefile modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || ( \
echo; \
echo " ERROR: Kernel configuration is invalid."; \
echo " include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo " Run 'make oldconfig && make prepare' on kernel src to fix it."; \
echo; \
/bin/false)
ERROR: Kernel configuration is invalid.
include/generated/autoconf.h or include/config/auto.conf are missing.
Run 'make oldconfig && make prepare' on kernel src to fix it.
mkdir -p /cygdrive/d/zarm/myarm/kernel_modules/.tmp_versions ; rm -f /cygdrive/d/zarm/myarm/kernel_modules/.tmp_version
s/*
WARNING: Symbol version dump /cygdrive/d/zarm/myarm/kernel_modules/Module.symvers
is missing; modules will have no dependencies and modversions.
make -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.build obj=/cygdrive/d/zarm/myarm/kernel_modul
es
(cat /dev/null; ) > /cygdrive/d/zarm/myarm/kernel_modules/modules.order
make -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.modpost
scripts/mod/modpost -i /cygdrive/d/zarm/myarm/kernel_modules/Module.sym
vers -I /cygdrive/d/zarm/myarm/kernel_modules/Module.symvers -o /cygdrive/d/zarm/myarm/kernel_modules/Module.
symvers -S -w -s
/bin/sh: scripts/mod/modpost: No such file or directory
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.modpost:91: recipe for target `__modpost' failed
make[3]: *** [__modpost] Error 127
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Makefile:1351: recipe for target `modules' failed
make[2]: *** [modules] Error 2
Makefile:126: recipe for target `sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory `/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11'
Makefile:91: recipe for target `default' failed
make: *** [default] Error 2
make: Leaving directory `/cygdrive/d/zarm/myarm/kernel_modules'
The ERROR and WARNING above seem FUBAR as all those files ARE present.
I also tried to put the include directory in my local (hellok1.c) directory. No go!
So could someone please send me:
1. a correct local Makefile for a working compilation of the hellok1.c module above?
2. some instruction of what files (config, Makefile etc) that need changing.
3. A short description of the compilation procedure... - I.e. What files goes where? etc. The instructions provided in "HOW_TO_BUILD_X9X10.txt" obviously doesn't work!
Cheers!
PS. This will be part of the Wiki entry...
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Fri Jan 04, 2013 4:29 am
by E3V3A
PS2: Also please don't bother to try to make me use this on a Linux distro. I won't. Why? Because it is fundamentally time consuming and involves too much "hacking" for the average user. I have compiled much more complicated stuff for Android on the same processor, and many other stuff as well, so I simply see no reason (other than POS Samsung sources) why it should not work also in Cygwin.
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Fri Jan 04, 2013 8:14 am
by juusso
None forces you to use linux. Use whatever you want, you`re used to work with

If you like to compile on windows, not problem at all. Just you have to know, we`re using toolchains, provided by samsung and recommend this if anyone asks about how to compile stuff for samsung tv, because this is easiest way to get ready to use compiler.
You`re almost first since three years i`m here who wants to compile on windows and hates linux. Here is no how to about windows+cygwin, you have less chance for support, but if you make such a manual, might anyone finds it useful and more user-friendly than toolchain on linux.
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Fri Jan 04, 2013 8:35 pm
by E3V3A
Hi! Thanks for encouragement. I don't hate linux at all, I'm actually a Linux advocate, but I also realize that the "average user" (what the hell is that) is using a windows PC and doesn't wanna bother with setting up a VM environment, install Linux + all required tools + all required configurations. We need more people working on this (TV firmware hacking etc), so allowing them a fast and easy way to get started, will hopefully help with this.
Actually I have changed my mind. I'd like to try the Linux-on-VM to set this up. Then I can figure out what need to be changed to make it compatible with a Cygwin installation. Is there any preferred Virtual Box VM's that I can use?
Re: [HELP] ARM Cross Compilation Toolchain
Posted: Fri Jan 04, 2013 8:42 pm
by juusso
Actually nope. Preferred by samsung is Centos 5.0, but runs well on debian too.