Toolchain guidance needed

Here for general support for D series TVs, request and problem solve area.

User avatar
prairie
SamyGO Project Donor
Posts: 303
Joined: Wed May 04, 2011 10:30 pm

Toolchain guidance needed

Post by prairie »

So I've tried all the toolchains available at sourceforge and none will produce a binary that will run on my platform (D8000 T-GAP8AKUC armv7). I've just been testing with a simple hello world.c and getting seg faults that have something to do with memory mapping
SpoilerShow
strace -Tt ./hello
00:44:23 execve("./hello", ["./hello"], [/* 47 vars */]) = 0 <0.001105>
00:44:23 brk(0) = 0x11000 <0.000028>
00:44:23 --- {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x40fa6968} (Segmentation fault) ---
00:44:23 +++ killed by SIGSEGV +++
Segmentation fault
So I figure I have to compile my own toolchain with sources for my platform, but I haven't been able to follow the B-series wiki example because there isn't a clear correspondence between that example and my sources. The distribution package (11_UNxxD7xx0) for my platform includes:
SpoilerShow
bcm_usbshim.tgz
binutils-2010q1.tgz
busybox-1.14.3-vdlinux.tgz
DPA_S_RT3572_LinuxSTA_V2.4.0.4.tgz
ffmpeg_0.5.tgz
GenoaP_VDLinux_OpenSource.tgz
glibc-2.11-2010q1.tgz
gloox-0.9.9.12.tar.bz2
iptables-1.4.8.tgz
LGPL_glib.tgz
LGPL_mms.tgz
libgphoto2.3.1.tar.gz
libiconv_1_9_1.tar.tar
libthai-0.1.6.tar.gz
libusb1.0.tar.gz
readme
RT3572_LinuxAP_V2.5.0.3.tgz
SDL.zip
wireless_tools.29.tgz
xfsprogs-3.0.5.tgz
I have successfully compiled the GenoaP kernel but really don't know where to go next to build the toolchain. Has anyone built a toolchain from this source distro? Any tips would be greatly appreciated. thx
PN60F8500AFXZA
T-FXPAKUC 1206.3 + SamyGO

"BrickMaster 2015"
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Toolchain guidance needed

Post by juusso »

i have feeling your tv is not arm, but mstar? or?
i remember plasmas of d series were mstar based..

or... gap& should be arm. give the output of
cat /proc/cpuinfo
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
User avatar
prairie
SamyGO Project Donor
Posts: 303
Joined: Wed May 04, 2011 10:30 pm

Re: Toolchain guidance needed

Post by prairie »

D7 plasma is mstar, D8 is arm.
SpoilerShow
cat /proc/cpuinfo
Processor : ARMv7 Processor rev 2 (v7l)
BogoMIPS : 798.72
Features : swp half thumb fastmult vfp edsp neon vfpv3
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x2
CPU part : 0xc08
CPU revision : 2

Hardware : Samsung SDP1002 Evaluation board
Revision : 0000
Serial : 0000000000000000
Is

Code: Select all

svn checkout svn://svn.code.sf.net/p/samygo/code/develop/toolchains/T-GAS_GAP VDLinux-armv7a8
the same as

Code: Select all

http://sourceforge.net/projects/samygo/files/Toolchains/VDLinux-armv7a8-toolchain-lite_20100630.tgz/download
?
PN60F8500AFXZA
T-FXPAKUC 1206.3 + SamyGO

"BrickMaster 2015"
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Toolchain guidance needed

Post by juusso »

yea. same but slightly updated.
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
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Toolchain guidance needed

Post by juusso »

i think you have problems with environment. what does it mean -compiled kernel, but don't have toolchain :-) without toolchain you can't compile kernel :-P
possible that you have compiled kernel from sources with x86 native toolchain for your PC. or?
what is cmdline you use for compillation?

viewtopic.php?t=5148#p36675
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
User avatar
prairie
SamyGO Project Donor
Posts: 303
Joined: Wed May 04, 2011 10:30 pm

Re: Toolchain guidance needed

Post by prairie »

Yes the kernel compiled with CROSS_COMPILE = arm-v7a8-linux-gnueabi toolchain (lite) but compiling simple program like hello.c doesn't run on TV. Command line CFLAGS are:

Code: Select all

-pipe -march=arm7-a -mcpu=cortex-a8 -mtune=cortex-a8 -mfpu=vfp3 -msoft-float -mfloat-abi=softfp -mabi=aapcs-linux -mthumb-interwork
I've also tried removing all the fine tuning options and just using -march=arm7-a
PN60F8500AFXZA
T-FXPAKUC 1206.3 + SamyGO

"BrickMaster 2015"
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Toolchain guidance needed

Post by juusso »

Example of Makefile for your simple helloworld.c :

Code: Select all

CROSS_COMPILE = arm-v7a8-linux-gnueabi-

CC	= $(CROSS_COMPILE)gcc


SRC_DIR	= ./
OBJ_DIR	= $(SRC_DIR)


INC =  \
	-I$(SRC_DIR)

EXTRA_CFLAGS = -Wall -fPIC

CFLAGS = -c -O2 $(INC) $(EXTRA_CFLAGS) $(DEFS)


OBJS =helloworld.o
SRCS =helloworld.c
		
DEFS =-DARM7 -DD_SERIES #-DDEBUG_LOG

TARGET_SO =hello.so
OBJ_SUFFIX =o

all :	$(TARGET_SO)

.c.$(OBJ_SUFFIX):
	@echo Compile $(CC)... [$@]
	$(CC) $< $(CFLAGS) -o $*.$(OBJ_SUFFIX)
		
O16S = $(SRCS:.c=.$(OBJ_SUFFIX))

$(TARGET_SO) : $(O16S)
			@echo Linking ... [$@]
			$(CC) $(DEFS) -fPIC -shared -Wl,-soname,$(TARGET_SO) -o $(TARGET_SO) $(OBJS) $(EXTRA_CFLAGS) -lm -ldl
			

clean :
	rm -rf $(OBJS) $(TARGET_SO) 


.SUFFIXES = .c .o 
you dont use fPIC? :)
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
User avatar
prairie
SamyGO Project Donor
Posts: 303
Joined: Wed May 04, 2011 10:30 pm

Re: Toolchain guidance needed

Post by prairie »

juuso wrote:Example of Makefile for your simple helloworld.c :
...
you dont use fPIC? :)
:lol: What's that?

That Makefile is generating a missing separator error at line:

Code: Select all

@echo Compile $CC ... [$@]
PN60F8500AFXZA
T-FXPAKUC 1206.3 + SamyGO

"BrickMaster 2015"
User avatar
bugficks
Official SamyGO Developer
Posts: 1062
Joined: Tue Jun 25, 2013 3:56 pm

Re: Toolchain guidance needed

Post by bugficks »

fPIC is kinda only useful for shared libs (.so) . he tries to create an executable. exe always get it's own process heap while .so get mapped into that and when 2 .so have same base address one needs to get relocated. there comes PIC into place. position-independent-code
User avatar
juusso
SamyGO Moderator
Posts: 10129
Joined: Sun Mar 07, 2010 6:20 pm

Re: Toolchain guidance needed

Post by juusso »

i just gave example to you. It comes not from me so i can`t troubleshoot. But you can look at cmdline and you see you use complete different code (stole from... c series?). Ok, maybe i`m not who have deep compiling knowledge, but i can tell you what i would do if i were you...

Optional you can try this:

Code: Select all

arm-v7a8-linux-gnueabi-gcc -O2 -c helloworld.c -o helloworld.o
arm-v7a8-linux-gnueabi-gcc -shared -Wl -o hello helloworld.o
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 “[D] Support”