Page 1 of 6

HelloWorld.c

Posted: Thu Aug 21, 2014 11:12 am
by MrKalach
HI. I'm new on forum.

Ok, I want to compile my first helloworld fo tv. I have downloaded VDLinux-armv7a8-toolchain-lite from samsung server and tried to compile this code:

Code: Select all

#include <stdio.h>
int main(void) {
       printf("Hello world\n");
       return (0);
gedit }

Code: Select all

arm-v7a8-linux-gnueabi-gcc -mglibc hello.c -o hellocs
then copied hellocs to tv, make chmod +x hellocs and run it.

And I have got: "Segmentation fault".

Need help guys.

Same shit happening when i try to load mc.

Re: HelloWorld.c

Posted: Thu Aug 21, 2014 2:11 pm
by Lordbyte
Try other toolchain ?

Re: HelloWorld.c

Posted: Thu Aug 21, 2014 2:27 pm
by MrKalach
Lordbyte wrote:Try other toolchain ?
But same shit happening with Midnight Commander :(

Ok, I download arm-v7a15v3r1 and I'll try it

Re: HelloWorld.c

Posted: Thu Aug 21, 2014 2:33 pm
by MrKalach
I tried, same problem.

I also tried make static build, same shit! I'm using right toolchain, arm-v7a15v3r1 for my proc ARMv7 rev.3(Cortex A15)

Cmon guys, I need guru help!

Re: HelloWorld.c

Posted: Thu Aug 21, 2014 8:54 pm
by sectroyer
MrKalach wrote:I tried, same problem.

I also tried make static build, same shit! I'm using right toolchain, arm-v7a15v3r1 for my proc ARMv7 rev.3(Cortex A15)

Cmon guys, I need guru help!
First of all you lied. This code doesn't compile:

Code: Select all

#include <stdio.h>
int main(void) {
       printf("Hello world\n");
       return (0);
gedit }
Second skip "-mglibc". I never used this flag :)

Re: HelloWorld.c

Posted: Fri Aug 22, 2014 1:04 pm
by MrKalach
sectroyer wrote:First of all you lied. This code doesn't compile:

Code: Select all

#include <stdio.h>
int main(void) {
       printf("Hello world\n");
       return (0);
gedit }
Second skip "-mglibc". I never used this flag :)
It's just copy-paste lag.
I tried both:

Code: Select all

arm-v7a15v3r1-linux-gnueabi-gcc -static hello.c -o hello
and

Code: Select all

arm-v7a15v3r1-linux-gnueabi-gcc hello.c -o hello
and I got:

Code: Select all

; Attributes: bp-based frame

EXPORT main
main
STMFD           SP!, {R11,LR}
ADD             R11, SP, #4
MOV             R0, aHelloWorld ; s
BL              puts
MOV             R3, #0
MOV             R0, R3
LDMFD           SP!, {R11,PC}
; End of function main
All fine, but I don't know what about is __imp_puts contain right address...

Re: HelloWorld.c

Posted: Fri Aug 22, 2014 1:40 pm
by sectroyer
BTW don't use a15 it's better to stick to a8 :)

Re: HelloWorld.c

Posted: Fri Aug 22, 2014 2:19 pm
by MrKalach
I tried, same sChit :(

Re: HelloWorld.c

Posted: Fri Aug 22, 2014 5:22 pm
by sectroyer
MrKalach wrote:I tried, same sChit :(
On what "machine" are you compiling it ? :) Do our patches run on your TV? :)

Re: HelloWorld.c

Posted: Sat Aug 23, 2014 12:01 pm
by MrKalach
Ubuntu 12.04 64bit, TV rooted via latest root method, FW:1118