Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to previous messageGo to previous message
koldo is currently offline  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 Confused
==> 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
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message icon14.gif
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Scatter: To find width bwt any two points.
Next Topic: User configurable menu system
Goto Forum:
  


Current Time: Fri Apr 26 20:47:30 CEST 2024

Total time taken to generate the page: 0.03075 seconds