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 #26451 is a reply to message #26446] Mon, 03 May 2010 21:27 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello all

I have added the possibility of choosing stdlib folder in constructor and NoStdlib() to refuse to use it.

A tcc stdlib file is in In Tcc/lib/lib/libtcc1.a

Please try it and tell me if it is ok.

Demo is also adapted.

index.php?t=getfile&id=2512&private=0
  • Attachment: dib.png
    (Size: 47.40KB, Downloaded 1627 times)


Best regards
Iñaki
Re: New Tiny C Compiler Package [message #26452 is a reply to message #26446] Mon, 03 May 2010 22:28 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
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.
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 next message
koldo is currently offline  koldo
Messages: 3356
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
TCC package broken [message #34038 is a reply to message #26455] Wed, 12 October 2011 22:57 Go to previous messageGo to next message
Didier is currently offline  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

Re: TCC package broken [message #34039 is a reply to message #34038] Thu, 13 October 2011 09:09 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Hello Didier

Thank you. I probably lost some changes. Last months I have changed PCs and I have had problems losing things Rolling Eyes.

About plugin/tcc package... in fact it did not existed before Smile.

However it is better this way. I did Tcc package when I had less knowledge of U++ Rolling Eyes . plugin/tcc/tcc.upp is now created and added to Tcc. Of course old libtcc.c file has been removed.

It will be updated this afternoon.



Best regards
Iñaki
Re: TCC package broken [message #34046 is a reply to message #34039] Thu, 13 October 2011 20:02 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Thank's Koldo

Re: TCC package broken [message #34052 is a reply to message #34046] Thu, 13 October 2011 21:43 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Thank you. It is updated yet. Please check it. Smile

Best regards
Iñaki
Re: TCC package broken [message #34106 is a reply to message #34052] Tue, 18 October 2011 22:55 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 680
Registered: November 2008
Location: France
Contributor
Hi Koldo,

I tried you're modifications and all works fine under linux.

Thank's for the corrections
Re: TCC package broken [message #34111 is a reply to message #34106] Wed, 19 October 2011 13:44 Go to previous message
koldo is currently offline  koldo
Messages: 3356
Registered: August 2008
Senior Veteran
Great! Smile

Best regards
Iñaki
Previous Topic: Scatter: To find width bwt any two points.
Next Topic: User configurable menu system
Goto Forum:
  


Current Time: Tue Apr 16 16:00:09 CEST 2024

Total time taken to generate the page: 0.01538 seconds