|
|
Home » Developing U++ » UppHub » New Tiny C Compiler Package
|
|
Re: New Tiny C Compiler Package [message #26455 is a reply to message #26452] |
Tue, 04 May 2010 09:24 |
|
koldo
Messages: 3357 Registered: August 2008
|
Senior Veteran |
|
|
Didier wrote on Mon, 03 May 2010 22:28 | Hi Koldo,
why stdlib is included in a separate .a lib instead of being statically compiled with rest of tcc.
Before sending the previous post I made some tests myself, and the problem is not really dependent on the stdlib.
In the tccelf.c file L1031, the stdlib is requested ... but not only: An explicit link to /usr/local/lib/tcc/libtcc1.a is made.
==> If this file is not present on the system then an exception is thrown
==> So although everything needed was compiled and linked, the program refuse to execute. if you comment L1031 & L1032 everything works fine.
I don't know why this has been done, but for our particular usage it's not good.
|
Hello Didier
In last change sent yesterday I have added two patches:
- NoStdlib() function
void NoStdlib(TCCState *s) {
s->nostdlib = 1;
}
This effectively avoids to try to load libtcc1.a, as in tccelf.c you can see this:
if (!s1->nostdlib) {
tcc_add_library(s1, "c");
snprintf(buf, sizeof(buf), "%s/%s", tcc_lib_path, "libtcc1.a");
tcc_add_file(s1, buf);
}
- For linux, constructor is now Tcc::Tcc(const char *libPath).
libPath is assigned to tcc_lib_path. This way you can put libtcc1.a wherever you want, instead of in "/usr/local/lib/tcc".
For convenience it is included in Tcc/lib/lib a copy of libtcc1.a file.
You can try both options, or using NoStdlib(), or using libtcc1.a file indicating in constructor in what folder it is (you do not need to install tcc, you just need to indicate where libtcc1.a is)
Best regards
Iñaki
|
|
|
TCC package broken [message #34038 is a reply to message #26455] |
Wed, 12 October 2011 22:57 |
Didier
Messages: 680 Registered: November 2008 Location: France
|
Contributor |
|
|
Hi Koldo,
The TCC package is broken since the tcc plugin was introduced.
The following corrections make it compile again (at least under linux):
* the plugin/tcc/tcc.upp file is missing
* in tcc/libtcc.c the path must be /plugin/tcc/tcc.c
* a dependency on plugin/tcc must be added to package tcc
[Updated on: Wed, 12 October 2011 22:58] Report message to a moderator
|
|
|
|
|
|
|
|
Goto Forum:
Current Time: Thu Apr 25 19:41:35 CEST 2024
Total time taken to generate the page: 0.03582 seconds
|
|
|