tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] newbie questions


From: grischka
Subject: Re: [Tinycc-devel] newbie questions
Date: Mon, 27 Dec 2010 18:25:11 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

CHEN-CHAU CHU wrote:
hi, folks, I am learning to use tcc.  I need some help in using libtcc.
I am not sure this is the right place to ask such questions, please
direct me to the proper places.

(1) it seems to me I cannot perform incremental compiling, to parse one
string, relocate, run,  then parse another string, relocate, run, with
the newly added code dependent on the first batch of code.
I think it can be done, only that I did not do it right.  I know I
cannot reload the same string twice because the embedded compiler (libtcc)
knows machine state and that certain symbols have been created.

Each compilation state has its own symbols.  If you know what symbols
you need you can transfer them like this:

  addr = tcc_get_symbol(s1, "foo");
  tcc_add_symbol(s2, "foo", addr);

If you want to have just all symbols, look here:
  http://lists.gnu.org/archive/html/tinycc-devel/2010-11/msg00039.html

(2) I am unable to get libtcc to work on the windows side, using native windows or mingw+msys. Most likely I have missed something.

It should work.  From tinycc/win32:
 $ build-tcc.bat
 $ gcc ../tests/libtcc_test.c -I libtcc -L libtcc -ltcc -o libtcc_test.exe
 $ .\libtcc_test
 Hello World!
 fib(32) = 2178309
 add(32, 64) = 96

(3) I have no problem building the 0.9.25 source and run all the
tests/examples on FC9 or FC10 + gcc 4.3.0 BUT, I will get segv
when "make libtests" for FC14 + gcc-4.5.1, no problem for
config/make/make-install

You could try latest development ("mob") branch:
 http://repo.or.cz/w/tinycc.git?a=shortlog;h=refs/heads/mob
You can use git:
 $ git clone git://repo.or.cz/tinycc.git
 $ git checkout -b mob origin/mob
or download a snapshot.

--- grischka




reply via email to

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