[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

Re: [HELP] ARM Cross Compilation Toolchain

Post by E3V3A »

Ok, so the "good" news is that I installed xubuntu and ran the same stuff using the VDLinx tools chain. I get the same errors!!
Why is this good? Because it means that my cygwin + CodeSourcery tool chain is working, but we're missing something to make it compile my modules...

These are the errors:

Code: Select all

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/mods modules
make[1]: Entering directory `/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11'

  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.


  WARNING: Symbol version dump /cygdrive/d/zarm/myarm/kernel_modules/mods/Module.symvers
           is missing; modules will have no dependencies and modversions.

  Building modules, stage 2.
  MODPOST 0 modules
/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:134: recipe for target `default' failed
make: *** [default] Error 2
I tried "make all" using VDLtoolchain, and copied Module.symver to ..../mods/. That resolved the "WARNING" message...
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: [HELP] ARM Cross Compilation Toolchain

Post by arris69 »

here one exercise for free, normally i'll take 1300? + vat per head for it. feel free to wikifi it.

get cygwin setup.exe http://cygwin.com/setup.exe
######## my setup selection #######
1. Root Directory: E:\cygwin (install for all users)
2. local package directory: E:\cygwin_download
3. direct connect to internet
4. mirror: http://ftp.gwdg.de

select: gcc4 make libncurses-devel (from devel section, use the install-utility's search function)
wget (section Web) unzip (section Archive) vim (section Editors)
let them install depencies too...

start cygwin (doubleclick desktop shortcut)

check free diskspace with df command:

Code: Select all

df
SpoilerShow
Dateisystem 1K-Bl?cke Benutzt Verf?gbar Verw% Eingeh?ngt auf
E:/cygwin/bin 10229984 6533416 3696568 64% /usr/bin
E:/cygwin/lib 10229984 6533416 3696568 64% /usr/lib
E:/cygwin 10229984 6533416 3696568 64% /
C: 116984828 108619752 8365076 93% /cygdrive/c
E: 10229984 6533416 3696568 64% /cygdrive/e
create workspace:

Code: Select all

mkdir SELP
cd SELP
get packages: toolchain and kernel sources (ca. 400MB).
http://opensource.samsung.com/ search for toolchain, result -> VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz (for e-series)
VDLinux-armv7a8-toolchain-lite_20100630.tgz (for c,d arm based)
toolchain_LN52A650.zip (for a-series)
toolchain_mips24ke_nfp_be.tgz (for mips c-series)
VDLinux-mips34kc-toolchain-lite-20100223.tgz (for mips d-series)
search for UNxxES8xxx.zip and put the stuff into SELP directory.
[privat server start]
wget "http://hiddenserver/UNxxES8xxx%283%29.zip" -O UNxxES8xxx.zip
wget http://hiddenserver/VDLinux-ARMv7-4.4-2 ... 110630.tgz
[privat server end]

Code: Select all

date
SpoilerShow
Sa, 5. Jan 2013 18:48:06

Code: Select all

md5sum *
SpoilerShow
6464028bf166cf48692e909d1de885e4 *UNxxES8xxx.zip
63bd3f271683f383f59b754c6daaf4c7 *VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz

Code: Select all

ls -l
SpoilerShow
insgesamt 417648
-rw-r--r-- 1 arris69 None 247788490 5. Jan 12:31 UNxxES8xxx.zip
-rw-r--r-- 1 arris69 None 179874293 5. Jan 12:25 VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz

Code: Select all

unzip -t UNxxES8xxx.zip
SpoilerShow
Archive: UNxxES8xxx.zip
testing: alsa-lib-1.0.23.tgz OK
...
testing: xfsprogs-3.1.5.tgz OK
No errors detected in compressed data of UNxxES8xxx.zip.
extract kernel sources:

Code: Select all

unzip UNxxES8xxx.zip VDLinux_2.6.35.11.tgz
tar xvzf VDLinux_2.6.35.11.tgz
(now kernel sources are in: ~/SELP/VDLinux_2.6.35.11/linux-2.6.35.11)

extract toolchain:

Code: Select all

tar xvzf VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz
!!!!!!!!!!!!! big problem is that my partition not support symlinks !!!!!!!!!!!!!!!!!!!!
!!!!!!!!!!!!! expect troubles on kernel compile !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

make life easier with some enviroment variables:

Code: Select all

export PATH=$PATH:~/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin
export ARCH=arm
export CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi-
let see if we have all host tools what we need for kernel compile:

Code: Select all

cd ~/SELP/VDLinux_2.6.35.11/linux-2.6.35.11
cp arch/arm/configs/Echo.P_defconfig_release .config
make menuconfig
you should see funny linux configuration menu, btw. just exit from it (don't save or mess around here...)

now we try to compile one module:

Code: Select all

make SUBDIRS=fs/rfs modules
oha, error ->
SpoilerShow
make: arm-v7a8v2r2-linux-gnueabi-gcc: Kommando nicht gefunden
1. maybe due missing symlinks?
check it:

Code: Select all

ls -l ~/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc*
SpoilerShow
-rw-r--r-- 1 arris69 None 448920 28. Jun 2011 /home/arris69/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc-4.4.1
not so funny, it has version in name and it's not executable, lol never use FAT32 for such things...

so we move to NTFS partition on c: drive:

Code: Select all

cd ~
mv SELP /cygdrive/c/
and fix PATH enviroment variable:

Code: Select all

export PATH=$PATH:/cygdrive/c/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin
and go to new directory:

Code: Select all

cd /cygdrive/c/SELP
we make a cleanup there and extract packages again, maybe we can save troubles with symlinks easy.:

Code: Select all

rm -rf VDLinux_2.6.35.11 VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630 
and you can remember what we did before? than again (you can use cursor up button to get prev. commands...):

Code: Select all

tar xvzf VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630.tgz
we check for symlinks and executable flag:

Code: Select all

ls -l VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc*
SpoilerShow
-rwxr-xr-x 2 arris69 None 448920 28. Jun 2011 VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc
-rwxr-xr-x 2 arris69 None 448920 28. Jun 2011 VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc-4.4.1
oha, like easter-egg...

extract and check kernel sources again:

Code: Select all

tar xvzf VDLinux_2.6.35.11.tgz
cd VDLinux_2.6.35.11/linux-2.6.35.11
cp arch/arm/configs/Echo.P_defconfig_release .config
make menuconfig (then just exit again, btw. you'll see some warnings, don't care.)
make SUBDIRS=fs/rfs modules
urgh..., error again...
SpoilerShow
/cygdrive/c/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc: /cygdrive/c/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc: Kann die Datei nicht ausf?hren.
strange, it's there and axecutable.... let's check dark magic:

Code: Select all

file  /cygdrive/c/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc
SpoilerShow
/cygdrive/c/SELP/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin/arm-v7a8v2r2-linux-gnueabi-gcc: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.9, not stripped

Code: Select all

file /bin/ls
SpoilerShow
/bin/ls: PE32 executable (console) Intel 80386 (stripped to external PDB), for MS Windows
ok we try toolchain from: http://sourceforge.net/projects/armlinu ... es/2010q1/

Code: Select all

cd -
wget "http://downloads.sourceforge.net/project/armlinux4cygwin/2010q1/arm-linux-toolchain-cygwin-2010q1.tar.bz2?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Farmlinux4cygwin%2Ffiles%2F2010q1%2F&ts=1357391966&use_mirror=ignum" -O arm-linux-toolchain-cygwin-2010q1.tar.bz2
extract it:

Code: Select all

tar xvjf arm-linux-toolchain-cygwin-2010q1.tar.bz2
remove samsung toolchain -> it's unusable for cygwin:

Code: Select all

rm -rf VDLinux-ARMv7-4.4-202-toolchain-v2r2-*
let fix us enviroment variables for the new toolchain (you can also use Ctr-r and start to type export CR, see the magic):

Code: Select all

export CROSS_COMPILE=arm-linux-
export PATH=$PATH:${PWD}/arm-linux/bin
(oha, we use here other variable PWD. nice, isn't it?)

little enviroment check:

Code: Select all

which ${CROSS_COMPILE}gcc
SpoilerShow
/cygdrive/c/SELP/arm-linux/bin/arm-linux-gcc
we start check again to compile a kernel module, but keep in mind we use a different cross-toolchain!!!

Code: Select all

cd VDLinux_2.6.35.11/linux-2.6.35.11

make SUBDIRS=fs/rfs modules
SpoilerShow
make: arm-v7a8v2r2-linux-gnueabi-gcc: Kommando nicht gefunden
so seems samsung had it hardcoded, but the kernel buildsystem is more powerfull..

Code: Select all

grep arm-v7a8v2r2-linux-gnueabi * .*
SpoilerShow
.config:CONFIG_CROSS_COMPILE="arm-v7a8v2r2-linux-gnueabi-"
aha, it's set in .config, we can change it with "make menuconfig", but let us try the force of kernel-buildsystem:

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} SUBDIRS=fs/rfs modules
uh, some errors:
SpoilerShow
arm-linux-ld: failed to merge target specific data of file fs/rfs/base/ess_bitmap.o
arm-linux-ld: fs/rfs/rfs_glue.o: Unknown mandatory EABI object attribute 44
we need a toolchain what better match the samsung's version (more exactly the binutils)
before we search the web like stupid we build our own version.
samsung use binutils 2.19, on toolchain from sourceforge we have 2.20.
hm, we build the latest one (just for fun):

Code: Select all

cd -
wget http://ftp.gnu.org/gnu/binutils/binutils-2.23.tar.gz
tar xvzf binutils-2.23.tar.gz
mkdir BUILD_binutils
cd BUILD_binutils
../binutils-2.23/configure --prefix=/cygdrive/c/SELP/arm-linux --target=armv7-a-linux-gnueabi --disable-doc --disable-nls --program-prefix=arm-linux- --enable-install-libiberty
make
install it, save install-logfile if you like to inspect it later:

Code: Select all

make install > my.log 2>&1
check the version of ld command:

Code: Select all

arm-linux-ld -v
SpoilerShow
GNU ld (GNU Binutils) 2.23
so we start again with virgin samsung kernel-sources:

Code: Select all

cd ..
rm -rf VDLinux_2.6.35.11
tar xvzf VDLinux_2.6.35.11.tgz
cd VDLinux_2.6.35.11/linux-2.6.35.11
cp arch/arm/configs/Echo.P_defconfig_release .config
time to change the mental level ;-)
if someone (in this case samsung) shipps precompiled object files with the kernel sources, it has to be suffixed as _shipped.
now we fix this (at least for rfs):

Code: Select all

for obj in $(find fs/rfs/ -name "*.o" | grep -v -E "(.mod.|built-in)") ; do mv -vf $obj ${obj}_shipped ; done
instead of make menuconfig we use magic command. kernel need some little helpers...:

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} prepare scripts
and try to compile rfs module (again...):

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} M=fs/rfs modules
:cry: , erros again:
SpoilerShow
arm-linux-ld: error: Source object fs/rfs/rfs_fat.mod.o has EABI version 0, but target fs/rfs/rfs_fat.ko has EABI version 5
arm-linux-ld: failed to merge target specific data of file fs/rfs/rfs_fat.mod.o
/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11/scripts/Makefile.modpost:124: recipe for target `fs/rfs/rfs_fat.ko' failed
make[1]: *** [fs/rfs/rfs_fat.ko] Error 1
Makefile:1326: recipe for target `modules' failed
make: *** [modules] Error 2
more cleanup:

Code: Select all

find fs/rfs/ -name "*.o" | grep -E "(.mod.|built-in)" | xargs rm -fv

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} M=fs/rfs modules
SpoilerShow
WARNING: Symbol version dump /cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11/Module.symvers
is missing; modules will have no dependencies and modversions.

LD [M] fs/rfs/rfs_glue.o
LD [M] fs/rfs/rfs_fat.o
Building modules, stage 2.
MODPOST 2 modules
CC fs/rfs/rfs_fat.mod.o
LD [M] fs/rfs/rfs_fat.ko
arm-linux-ld: error: Source object fs/rfs/rfs_fat.mod.o has EABI version 0, but target fs/rfs/rfs_fat.ko has EABI version 5
arm-linux-ld: failed to merge target specific data of file fs/rfs/rfs_fat.mod.o
/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11/scripts/Makefile.modpost:124: recipe for target `fs/rfs/rfs_fat.ko' failed
make[1]: *** [fs/rfs/rfs_fat.ko] Error 1
Makefile:1326: recipe for target `modules' failed
make: *** [modules] Error 2
what the hell, little check on a linux system:

Code: Select all

export PATH=$PATH:/usr/src/OpenEmbedded/SamsungDTV-SELP/Prebuild/Toolchains/VDLinux-ARMv7-4.4-202-toolchain-v2r2-20110630/bin
make ARCH=arm CONFIG_CROSS_COMPILE=arm-v7a8v2r2-linux-gnueabi- M=fs/rfs modules                                                 
SpoilerShow
Building modules, stage 2.
MODPOST 2 modules
CC fs/rfs/rfs_fat.mod.o
LD [M] fs/rfs/rfs_fat.ko
CC fs/rfs/rfs_glue.mod.o
LD [M] fs/rfs/rfs_glue.ko
so now we know why people cross compile on linux and not on windows...
we go back to our cygwin and try to build all modules:

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} modules
SpoilerShow
CHK include/linux/version.h
CHK include/generated/utsrelease.h
make[1]: ?include/generated/mach-types.h? ist bereits aktualisiert.
CALL scripts/checksyscalls.sh
CC [M] arch/arm/plat-ccep/sdp_mac.o
....
CC fs/rfs/rfs_fat.mod.o
LD [M] fs/rfs/rfs_fat.ko
arm-linux-ld: error: Source object fs/rfs/rfs_fat.mod.o has EABI version 0, but target fs/rfs/rfs_fat.ko has EABI version 5
arm-linux-ld: failed to merge target specific data of file fs/rfs/rfs_fat.mod.o
/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11/scripts/Makefile.modpost:124: recipe for target `fs/rfs/rfs_fat.ko' failed
make[1]: *** [fs/rfs/rfs_fat.ko] Error 1
Makefile:1053: recipe for target `modules' failed
make: *** [modules] Error 2
oha, we failed again on the rfs module, but others looks good -> lesson learned don't mix object files around different architectures and compilers...

just for fun we try to build the kernel:

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} Image
SpoilerShow
.....
LD vmlinux.o
MODPOST vmlinux.o
WARNING: modpost: Found 1 section mismatch(es).
To see full details build your kernel with:
'make CONFIG_DEBUG_SECTION_MISMATCH=y'
GEN .version
CHK include/generated/compile.h
UPD include/generated/compile.h
CC init/version.o
LD init/built-in.o
LD vmlinux
SYSMAP System.map
OBJCOPY arch/arm/boot/Image
Kernel: arch/arm/boot/Image is ready
hm, no modutils for cygwin???

Code: Select all

wget http://www.kernel.org/pub/linux/utils/kernel/module-init-tools/module-init-tools-3.7.tar.gz
tar xvzf module-init-tools-3.7.tar.gz
mkdir BUILD_modutils
cd BUILD_modutils
DOCBOOKTOMAN=true ../module-init-tools-3.7/configure --prefix=/usr
SpoilerShow
....
configure: error: Linux only, dude!
just fun today!!!

but we can use other tools ;-):

Code: Select all

strings drivers/usb/storage/usb-storage.ko | grep -i -E "(depe|verm)"
SpoilerShow
depends=usbcore
vermagic=0079, release SMP preempt mod_unload ARMv7
last exercise for today, own kernel module build outside of kernel dir.
let's take this one: viewtopic.php?f=50&t=5230#p38377

one line command sample:

Code: Select all

cd /cygdrive/c/SELP ; mkdir testmod && cd testmod
vi hellok1.c -> and insert code from forum
vi Makefile -> insert following code:

Code: Select all

ifneq ($(KERNELRELEASE),)
obj-m += hellok1.o
else
KERNELDIR = /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11
all:
        $(MAKE) -C $(KERNELDIR) M=$(PWD) modules
endif

Code: Select all

make CONFIG_CROSS_COMPILE=${CROSS_COMPILE} KERNELDIR=/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11
SpoilerShow
make -C /cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11 M=/cygdrive/c/SELP/testmod modules
make[1]: Entering directory `/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11'
CC [M] /cygdrive/c/SELP/testmod/hellok1.o
Building modules, stage 2.
MODPOST 1 modules
CC /cygdrive/c/SELP/testmod/hellok1.mod.o
LD [M] /cygdrive/c/SELP/testmod/hellok1.ko
make[1]: Leaving directory `/cygdrive/c/SELP/VDLinux_2.6.35.11/linux-2.6.35.11'
check the resulting file:

Code: Select all

file hellok1.ko
SpoilerShow
hellok1.ko: ELF 32-bit LSB relocatable, ARM, version 1, BuildID[sha1]=0xc3f3c07f14a498a29f665d74cf2ee334ecde3e35, not stripped

Code: Select all

strings hellok1.ko | grep -i -E "(depe|verm)"
SpoilerShow
depends=
vermagic=0079, release SMP preempt mod_unload ARMv7
end of lesson, no need to mess around in kernel sources and kill kernels build-system or change anything in kernels Makefile
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post by E3V3A »

The make error 127 means that the file cannot not be found. But the file IS in where it should be, which make me believe that the error is in the shell interpretation of the Makefile...

The Error:

Code: Select all

...
/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:1354: recipe for target `modules' failed
...
(What does modpost do?)

with more debug on:

Code: Select all

...
make -f /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/Makefile.build obj=/cygdrive/d/zarm/myarm/kernel_modules
(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/mods/Module.symvers -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
...
I think this originates from here (in the Makefile):

Code: Select all

...
PHONY += modules
modules: $(vmlinux-dirs) $(if $(KBUILD_BUILTIN),vmlinux) modules.builtin
	$(Q)$(AWK) '!x[$$0]++' $(vmlinux-dirs:%=$(objtree)/%/modules.order) > $(objtree)/modules.order
	@$(kecho) '  Building modules, stage 2.';
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost
	$(Q)$(MAKE) -f $(srctree)/scripts/Makefile.fwinst obj=firmware __fw_modbuild

modules.builtin: $(vmlinux-dirs:%=%/modules.builtin)
	$(Q)$(AWK) '!x[$$0]++' $^ > $(objtree)/modules.builtin

%/modules.builtin: include/config/auto.conf
	$(Q)$(MAKE) $(modbuiltin)=$*
...
I don't understand what this does, but I guess the first thing to go tilt, when using incompatible (or outdated) shell commands, are stuff related to AWK and the output of certain variables, such as "!x[$$0]++"...

Perhaps if someone could send me a working Makefile for different MST (ARM) firmware of the same or similar Kernel version??
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 »

The Wiki is online! (WIP...)

@arris69: Wow! Thank you! That is very...uhmm...extensive.
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: [HELP] ARM Cross Compilation Toolchain

Post by arris69 »

E3V3A wrote:The Wiki is online! (WIP...)

@arris69: Wow! Thank you! That is very...uhmm...extensive.
But you get with this method gnu eabi binaries and not eabi5!
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post by E3V3A »

arris69 wrote:But you get with this method gnu eabi binaries and not eabi5!
Which method do you refer to? My method or yours?
I don't know what difference it would make. I think my way yields EABI 4 by default, but that it can be set in assembler somehow.
And in addition I'm not sure it makes a difference unless you intend to run in thumb-mode... But I don't know.

Second I still have some troubles ... I get:
SpoilerShow

Code: Select all

$ make prepare
  CHK     include/linux/version.h
  CHK     include/generated/utsrelease.h
make[1]: `include/generated/mach-types.h' is up to date.
  CC      kernel/bounds.s
In file included from include/linux/page-flags.h:8:0,
                 from kernel/bounds.c:9:
include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/./Kbuild:35: recipe for target `kernel/bounds.s'
make[1]: *** [kernel/bounds.s] Error 1
Makefile:973: recipe for target `prepare0' failed
make: *** [prepare0] Error 2
This is a funny message as types.h are present here:
SpoilerShow

Code: Select all

$ find ./ -iname "types.h"
./arch/arm/include/asm/types.h
./arch/mips/include/asm/fw/arc/types.h
./arch/mips/include/asm/sn/types.h
./arch/mips/include/asm/types.h
./arch/x86/include/asm/types.h
./drivers/net/skfp/h/types.h
./drivers/net/wireless/libertas/types.h
./drivers/scsi/bfa/include/protocol/types.h
./drivers/staging/batman-adv/types.h
./drivers/staging/ramzswap/sub-project/include/types.h
./fs/ceph/types.h
./fs/ntfs/types.h
./include/asm-generic/types.h
./include/linux/sunrpc/types.h
./include/linux/types.h
./include/rxrpc/types.h
./tools/perf/util/include/linux/types.h
./tools/perf/util/types.h
Or similarly when I try to compile module in the ./drivers/samy directory:
SpoilerShow

Code: Select all

$ make M=drivers/zamy modules

  WARNING: Symbol version dump /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Module.symvers
           is missing; modules will have no dependencies and modversions.

  CC [M]  drivers/zamy/hellok1.o
In file included from include/linux/prefetch.h:13:0,
                 from include/linux/list.h:6,
                 from include/linux/module.h:9,
                 from drivers/zamy/hellok1.c:9:
include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
scripts/Makefile.build:237: recipe for target `drivers/zamy/hellok1.o' failed
make[1]: *** [drivers/zamy/hellok1.o] Error 1
Makefile:1358: recipe for target `_module_drivers/zamy' failed
make: *** [_module_drivers/zamy] Error 2
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: [HELP] ARM Cross Compilation Toolchain

Post by arris69 »

E3V3A wrote:...
Which method do you refer to? My method or yours?
with the gcc from sourceforge
I don't know what difference it would make. I think my way yields EABI 4 by default, but that it can be set in assembler somehow.
And in addition I'm not sure it makes a difference unless you intend to run in thumb-mode... But I don't know.
not really tested but i'm sure denny had some troubles as he tried to load eabi5 binaries on system with glibc eabi4 or vice versa....
Second I still have some troubles ... I get:
SpoilerShow

Code: Select all

$ make prepare
 ...
try:

Code: Select all

make ARCH=arm V=1 prepare 
...
E3V3A
Posts: 247
Joined: Wed Oct 31, 2012 2:31 am
Location: /dev/zero

Re: [HELP] ARM Cross Compilation Toolchain

Post by E3V3A »

A slightly edited version...

$ make ARCH=arm V=1 prepare
SpoilerShow

Code: Select all

rm -f include/config/kernel.release
echo "2.6.35.13$(/bin/sh /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/scripts/setlocalversion /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11)" > include/config/kernel.release

set -e;
: '  CHK     include/linux/version.h';
mkdir -p include/linux/;
(echo #define LINUX_VERSION_CODE 132643; echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))';) < /cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/Makefile > include/linux/version.h.tmp;

if [ -r include/linux/version.h ] && cmp -s include/linux/version.h include/linux/version.h.tmp; then   
	rm -f include/linux/version.h.tmp; 
else
    : '  UPD     include/linux/version.h';
    mv -f include/linux/version.h.tmp include/linux/version.h;
fi

set -e;                          
: '  CHK     include/generated/utsrelease.h';
mkdir -p include/generated/; 

if [ `echo -n "2.6.35.13" | wc -c ` -gt 64 ]; then  
	echo '"2.6.35.13" exceeds 64 characters' >&2;
	exit 1;
fi;

(echo \#define UTS_RELEASE \"2.6.35.13\";) < include/config/kernel.release > include/generated/utsrelease.h.tmp;

if [ -r include/generated/utsrelease.h ] && cmp -s include/generated/utsrelease.h include/generated/utsrelease.h.tmp; then 
	rm -f include/generated/utsrelease.h.tmp;                    
else                                    
	: '  UPD     include/generated/utsrelease.h';   
	mv -f include/generated/utsrelease.h.tmp include/generated/utsrelease.h;                
fi

mkdir -p .tmp_versions
make -f scripts/Makefile.build obj=scripts/basic
rm -f .tmp_quiet_recordmcount
make -f scripts/Makefile.build obj=arch/arm/tools include/generated/mach-types.h

make[1]: `include/generated/mach-types.h' is up to date.
make -f scripts/Makefile.build obj=.
mkdir -p kernel/
  arm-none-linux-gnueabi-gcc -Wp,-MD,kernel/.bounds.s.d  -nostdinc -isystem /cygdrive/d/zarm/csbench/lib/gcc/arm-none-linux-gnueabi/4.7.2/include -I/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/arch/arm/include -Iinit/secureboot/include -Iinclude    -include include/generated/autoconf.h      -D__KERNEL__ -mlittle-endian -Iarch/arm/arm-boards/amber3//include -Iarch/arm/arm-boards/plat-mstar//include -Iarch/arm/arm-boards/amber3/ -Iarch/arm/arm-boards/plat-mstar/ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv5t -Wa,-march=armv7-a -msoft-float -Uarm -fno-omit-frame-pointer -fno-optimize-sibling-calls -g                              -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(bounds)"  -D"KBUILD_MODNAME=KBUILD_STR(bounds)"   -fverbose-asm -S -o kernel/bounds.s kernel/bounds.c

In file included from include/linux/page-flags.h:8:0,
                 from kernel/bounds.c:9:
include/linux/types.h:4:23: fatal error: asm/types.h: No such file or directory
compilation terminated.
/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/./Kbuild:35: recipe for target `kernel/bounds.s' failed
make[1]: *** [kernel/bounds.s] Error 1
Makefile:973: recipe for target `prepare0' failed
make: *** [prepare0] Error 2
Here's the compile line, de-mangeled:
SpoilerShow

Code: Select all

arm-none-linux-gnueabi-gcc 
	-Wp,
	-MD,kernel/.bounds.s.d 
	-nostdinc 
	-isystem /cygdrive/d/zarm/csbench/lib/gcc/arm-none-linux-gnueabi/4.7.2/include 
	-I/cygdrive/d/zarm/vdl_kernel/linux/linux-2.6.35.11/arch/arm/include 
	-Iinit/secureboot/include 
	-Iinclude 
	-include include/generated/autoconf.h 
	-D__KERNEL__ 
	-mlittle-endian 
	-Iarch/arm/arm-boards/amber3//include 
	-Iarch/arm/arm-boards/plat-mstar//include 
	-Iarch/arm/arm-boards/amber3/ 
	-Iarch/arm/arm-boards/plat-mstar/ 
	-Wall 
	-Wundef 
	-Wstrict-prototypes 
	-Wno-trigraphs 
	-fno-strict-aliasing 
	-fno-common 
	-Werror-implicit-function-declaration 
	-Wno-format-security 
	-fno-delete-null-pointer-checks 
	-Os 
	-fno-omit-frame-pointer 
	-mapcs 
	-mno-sched-prolog 
	-mabi=aapcs-linux 
	-mno-thumb-interwork 
	-D__LINUX_ARM_ARCH__=7 
	-march=armv5t 
	-Wa,-march=armv7-a 
	-msoft-float 
	-Uarm 
	-fno-omit-frame-pointer 
	-fno-optimize-sibling-calls 
	-g 
	-D"KBUILD_STR(s)=#s" 
	-D"KBUILD_BASENAME=KBUILD_STR(bounds)" 
	-D"KBUILD_MODNAME=KBUILD_STR(bounds)" 
	-fverbose-asm 
	-S 
	-o kernel/bounds.s kernel/bounds.c
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 »

PS. If your compilation setup is working, please open a new shell window and post the output of the following commands:

1. "set"
2. "export"
3. "shopt"

I think perhaps there's something funny going on in my BASHOPTS and/or SHELLOPTS variables...
HW: UE40ES5700SXXH
FW: T-MST10PDEUC-1029.0 Onboot: 1003
arris69
Official SamyGO Developer
Posts: 1700
Joined: Fri Oct 02, 2009 8:52 am
Location: Austria/Vienna (no Kangaroos here)
Contact:

Re: [HELP] ARM Cross Compilation Toolchain

Post by arris69 »

E3V3A wrote:PS. If your compilation setup is working, please open a new shell window and post the output of the following commands:

1. "set"
2. "export"
3. "shopt"

I think perhaps there's something funny going on in my BASHOPTS and/or SHELLOPTS variables...
Dont have the laptop here, just can check it in 2days.

Post Reply

Return to “[E] Firmware”