tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Tinycc-devel] Very sorry - newbie questions


From: Tony Robinson
Subject: [Tinycc-devel] Very sorry - newbie questions
Date: Sun, 12 Mar 2017 18:35:04 +0000
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0

Hello,

Very sorry for newbie questions but I'm looking for C compiler for a processor that I've been very slowly building as a hobby. The instruction set is super simple (Rz = Rx op Ry for op in ADD, SUB, AND, OR, XOR, ASR plus basic LOAD/STORE/PUSH/POP instructions) and as the clock rate is only about 50kHz I'm not too worried about optimization. Portability is key - I will port FORTH but would love C.

But all that is background, I'm wondering if;

a) tcc is the simplest C compiler for me to retarget and
b) assuming that it is, I did the standard:

$ tar xvf tcc-0.9.26.tar.bz2
$ cd tcc-0.9.26
$ ./configure
$ make
$ make test
make -C tests test
make[1]: Entering directory '/home/tonyr/nanocpu/tcc-0.9.26/tests'
------------ hello-exe ------------
../tcc -B.. ../examples/ex1.c -o hello || (../tcc -vv; exit 1) && ./hello
Segmentation fault (core dumped)
Makefile:62: recipe for target 'hello-exe' failed
make[1]: *** [hello-exe] Error 139
make[1]: Leaving directory '/home/tonyr/nanocpu/tcc-0.9.26/tests'
Makefile:316: recipe for target 'test' failed
make: *** [test] Error 2

that is. running the complied version of ex1.c seg faults. I'm on standard xubuntu:

$ uname -a
Linux code0 4.4.0-59-generic #80-Ubuntu SMP Fri Jan 6 17:47:47 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
$ code0 tonyr: gcc --version
gcc (Ubuntu 5.4.0-6ubuntu1~16.04.4) 5.4.0 20160609
Copyright (C) 2015 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


Tony
P.S. more CPU info than you probably wanted to know at nanocpu.org




reply via email to

[Prev in Thread] Current Thread [Next in Thread]