tinycc-devel
[Top][All Lists]
Advanced

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

Re: [Tinycc-devel] Naming confusion


From: grischka
Subject: Re: [Tinycc-devel] Naming confusion
Date: Mon, 22 Nov 2010 19:23:26 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Christoph Gärtner wrote:
This naming scheme is somewhat confusing. My suggestion would be to

  1. rename "libtcc1.a" to something like "libtccrt.a"

libXcc1.s is somehow standard for the compiler support library,
gcc has libgcc1.a AFAIK.

  2. rename "tcclib.h" to "tcclibc.h" (or any other name that doesn't
     suggests a close relationship to libtcc)

I agree that it is mildly confusing but "tcclibc.h" doesn't look
any better to me.  Other suggestions?

The example code in "tests/libtcc_test.c" also claim that `tcc_set_lib_path()` should be called to tell tinyCC where "tcclib.h" (why?) and "libtcc1.a" are located.

However, everything seems to work if you do not call `tcc_set_lib_path()` and just move "libtcc1.a" into a library directory (ie a directory added via `tcc_add_library_path()`).

tcc_set_lib_path() basically implements the -B option.  It works
without when tcc is installed.  It is required if you do
'make test' before 'make install' (I think).

Also, "char my_program[] ..." in libtcc_test.c indeed doesn't
include anything, but it could, with more real applications.

It seems that `tcc_set_lib_path()` serves no useful purpose and could be removed during a round of API cleanup.

Geez, I just added it. ;)

tcc_set_lib_path() sets tcc_lib_path which is where tcc finds:
1) libtcc1.a
2) bcheck.o
3) compiler specific standard header stddef.h, stdarg.h, ...
4) entire lib and include directories on win32

3)4) can be done by tcc_add_library_path() / tcc_add_sysinclude_path()
but not 1)2).

So it seems that if you want to link your application with libtcc.a
and run it on a system that does not have tcc installed you need
tcc_set_lib_path() to tell libtcc.a where is libtcc1.a.  No?


Christoph




reply via email to

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