[HELP] ARM Cross Compilation Toolchain

Here is information about customize your E series firmware..:!:This forum is NOT FOR USER questions or problems but DEVELOPER.

E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

[HELP] ARM Cross Compilation Toolchain

Post 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:
SpoilerShow

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?
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
Denny
Official SamyGO Developer
Posts: 350
Joined: Thu Sep 30, 2010 12:18 pm
Location: Croatia

Re: [REF] ARM Cross Compilation Toolchain

Post 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.
Denny - 데니 - 丹尼 (card2000)
UE55C8000 UE55D8000 UE32D6510 BD-C9600 3xDM8000
Reversing HW Demux Drivers and API from Samsung´s TV
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [REF] ARM Cross Compilation Toolchain

Post 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??
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [HELP] ARM Cross Compilation Toolchain

Post by juusso »

ah, mod logs showed someone was not really accurate by moderating topic...:-(
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: [REF] ARM Cross Compilation Toolchain

Post 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 ?
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post 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
SpoilerShow

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:
SpoilerShow

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:
SpoilerShow

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...
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post 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.
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [HELP] ARM Cross Compilation Toolchain

Post 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.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post 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?
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: [HELP] ARM Cross Compilation Toolchain

Post by juusso »

Actually nope. Preferred by samsung is Centos 5.0, but runs well on debian too.
LE40B653T5W,UE40D6750,UE65Q8C
Have questions? Read SamyGO Wiki, Search on forum first!
FFB (v0.8), FFB for CI+ . Get root on: C series, D series, E series, F series, H series. rooting K series, exeDSP/exeTV patches[C/D/E/F/H]

DO NOT EVER INSTALL FIRMWARE UPGRADE

Post Reply

Return to “[E] Firmware”