SLK Mail | 22 May 2013 21:37
Picon

tcc-arm hosted on windows

Is there a short description of how to compile target ARM, host win32 on  
windows. Do not need float, just want to compile my vi-like editor and SLK  
parser generator for use on android.

--

-- 
Thanks

Lee | 13 May 2013 05:08
Picon

libtcc1 example usage

Hi,

I am trying to use the example provided libtcc_test.c but with no luck. Compiles OK but I get the errors:
tcc: error: cannot find library: libtcc1.a
tcc: error: undefined symbol 'printf'

I've tried to hard code the lib_path, with -ltcc1 used in the makefile, no success. I'am using tcc version 0.9.26 (i386 Win32).
Any help will be greatly appreciated.

Thanks,
Lee
<div><div>
<div>Hi,</div>
<div><br></div>
<div>I am trying to use the example provided libtcc_test.c but with no luck. Compiles OK but I get the errors:</div>
<div>tcc: error: cannot find library: libtcc1.a<br>tcc: error: undefined symbol 'printf'</div>
<div><br></div>
<div>I've tried to hard code the lib_path, with -ltcc1 used in the makefile, no success. I'am using tcc version 0.9.26 (i386 Win32).</div>
<div>Any help will be greatly appreciated.</div>
<div><br></div>
<div>Thanks,</div>
<div>Lee</div>
</div></div>
Carlos Montiers | 7 May 2013 07:42
Picon

editing tccpe.c

Hello. I want change the default message of my compiled files from:
'This program cannot be run in DOS mode'
by:
'This program must be run under Win32'

I do it using this in line 499 of tccpe.c

},{
/* BYTE dosstub[0x40] */
/* 14 code bytes + "This program cannot be run in DOS mode.\r\r\n$" + 6 * 0x00 */
0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01,0x4c,0xcd,0x21,
'T','h','i','s',' ','p','r','o','g','r','a','m',' ','m','u','s','t',' ',
'b','e',' ','r','u','n',' ','u','n','d','e','r',' ','W','i','n','3','2',
0x0d,0x0a,0x24,0x00,
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00
},

but I want remove the last 11 0x00

I tried do it replacing dosstub[0x40]  in line 237 by dosstub[0x35]  and 0x00000080 by 0x00000075 in line 498. But I get bad result.

Please can someone help me please indicating the modifications needed for remove the last 0x00?

Carlos.
<div><div dir="ltr">Hello. I want change the default message of my compiled files from:<div>'This program cannot be run in DOS mode'</div>
<div>by:</div>
<div>'This program must be run under Win32'</div>
<div><br></div>
<div>I do it using this in line 499 of tccpe.c</div>
<div><br></div>
<div>
<div>
<div>},{</div>
<div>/* BYTE dosstub[0x40] */</div>
<div>/* 14 code bytes + "This program cannot be run in DOS mode.\r\r\n$" + 6 * 0x00 */</div>
<div>0x0e,0x1f,0xba,0x0e,0x00,0xb4,0x09,0xcd,0x21,0xb8,0x01,0x4c,0xcd,0x21,</div>
<div>'T','h','i','s',' ','p','r','o','g','r','a','m',' ','m','u','s','t',' ',</div>
<div>'b','e',' ','r','u','n',' ','u','n','d','e','r',' ','W','i','n','3','2',</div>
<div>0x0d,0x0a,0x24,0x00,</div>
<div>0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00</div>
<div>},</div>
</div>
<div><br></div>
<div>but I want remove the last 11 0x00</div>
<div><br></div>
<div>I tried do it replacing dosstub[0x40] &nbsp;in line 237 by dosstub[0x35] &nbsp;and&nbsp;0x00000080 by 0x00000075 in line 498. But I get bad result.</div>
<div><br></div>
<div>Please can someone help me please indicating the modifications needed for remove the last 0x00?</div>
<div><br></div>
<div>Carlos.</div>
</div>
</div></div>
grischka | 5 May 2013 23:49
Picon
Picon

Relicensing TinyCC

Hi all,

It has been discussed already on this list whether it would be
good to relicense TinyCC under a more permissive BSD-like license.

The discussion started here:
http://lists.gnu.org/archive/html/tinycc-devel/2013-04/msg00052.html

Opinions varied but mostly were positive so it appears to
be worth to start the process and see how far we can get.

For that purpose I've committed a new file RELICENSING with the
suggested new license clause and a list for people to confirm
their agreement (or disagreement).

http://repo.or.cz/w/tinycc.git/commitdiff/e6704355000425e9

If you have contributed to TinyCC in the past, in particular if
you are one of the copyright owners for an entire file, please
add yourself to that file (rsp. replace the question mark) and
then commit to the "mob" brancn with log message:

      Relicensing TinyCC

Suggestions or concerns wrt. the procedure are welcome, also.

Thanks,

--- grischka

Stephan Beal | 4 May 2013 15:12

Missing predefs.h on x64 Linux?

Hiho,

i just updated to "the latest" tcc:

[stephan <at> host:~/cvs/tinycc]$ git pull
...
From git://repo.or.cz/tinycc
...

And i am seeing what is probably a portability problem on x64 Ubuntu 12.04:

[stephan <at> host:~/cvs/fossil/cpdo]$ CC=tcc make
Generating dependencies...
+ tcc -Wall -Werror -fPIC -g -I. -I./include -I/home/stephan/include -UNDEBUG -DDEBUG=1 -DCPDO_ENABLE_SQLITE3=1 -DCPDO_ENABLE_SQLITE4=1 -DCPDO_ENABLE_MYSQL5=1 -c -o test.o test.c
In file included from test.c:25:
In file included from /usr/include/assert.h:37:
/usr/include/features.h:324: error: include file 'bits/predefs.h' not found
make: *** [test.o] Error 1


i haven't compiled this code with tcc in many months, so i cannot say when this started happening (and my git-fu is not powerful enough to figure it out :( ).

i get the same even if i disable assert by setting NDEBUG:

[stephan <at> host:~/cvs/fossil/cpdo]$ CC=tcc make DEBUG=0
+ tcc ... -UDEBUG -DNDEBUG=1 ...
In file included from /usr/include/assert.h:37:
/usr/include/features.h:324: error: include file 'bits/predefs.h' not found
make: *** [test.o] Error 1

Setting CC=gcc or CC=clang compiles as expected.

Any tips on working around this?

--
----- stephan beal
http://wanderinghorse.net/home/stephan/
<div><div dir="ltr">Hiho,<div><br></div>
<div>i just updated to "the latest" tcc:</div>
<div><br></div>
<div>
<div>[stephan <at> host:~/cvs/tinycc]$ git pull</div>
<div>...</div>
<div>From git://<a href="http://repo.or.cz/tinycc">repo.or.cz/tinycc</a><br>
</div>
<div>...</div>
<div><br></div>
<div>And i am seeing what is probably a portability problem on x64 Ubuntu 12.04:</div>
<div><br></div>
<div>
<div>[stephan <at> host:~/cvs/fossil/cpdo]$ CC=tcc make</div>
<div>Generating dependencies...</div>
<div>+ tcc -Wall -Werror -fPIC -g -I. -I./include -I/home/stephan/include -UNDEBUG -DDEBUG=1 -DCPDO_ENABLE_SQLITE3=1 -DCPDO_ENABLE_SQLITE4=1 -DCPDO_ENABLE_MYSQL5=1 -c -o test.o test.c</div>
<div>In file included from test.c:25:</div>
<div>In file included from /usr/include/assert.h:37:</div>
<div>/usr/include/features.h:324: error: include file 'bits/predefs.h' not found</div>
<div>make: *** [test.o] Error 1</div>
<div><br></div>
</div>
<div><br></div>
<div>i haven't compiled this code with tcc in many months, so i cannot say when this started happening (and my git-fu is not powerful enough to figure it out :( ).</div>
<div>
<br>
</div>
<div>i get the same even if i disable assert by setting NDEBUG:</div>
<div><br></div>
<div>
<div>[stephan <at> host:~/cvs/fossil/cpdo]$ CC=tcc make DEBUG=0</div>
<div>+ tcc ... -UDEBUG -DNDEBUG=1 ...</div>
<div>In file included from /usr/include/assert.h:37:</div>
<div>/usr/include/features.h:324: error: include file 'bits/predefs.h' not found</div>
<div>make: *** [test.o] Error 1</div>
<div><br></div>
<div>Setting CC=gcc or CC=clang compiles as expected.</div>
<div><br></div>
</div>
<div>Any tips on working around this?</div>
<div><br></div>-- <br>----- stephan beal<br><a href="http://wanderinghorse.net/home/stephan/" target="_blank">http://wanderinghorse.net/home/stephan/</a><div>
<a href="http://gplus.to/sgbeal" target="_blank">http://gplus.to/sgbeal</a>
</div>
</div>
</div></div>
Daniel Glöckner | 1 May 2013 16:59
Picon

ARM hardfloat prolog

Hi Thomas,

I saw that you used the following line to store the floating point
arguments that have been passed in fpu register:

    o(0xED2D0A00|nf); /* save s0-s15 on stack if needed */

In my 2nd edition ARM ARM this maps to the FSTMS instruction and there
is a note allowing implementations to keep the values in an internal
representation and just convert them to IEEE format for storing to
memory. So I don't think we can use this instruction to store double
arguments and need one FSTMS/FSTMD for each run of consecutive fpu
registers of same precision to be stored. Or have read otherwise?

Best regards,

  Daniel

Christian Jullien | 26 Apr 2013 20:59
Picon
Favicon

Recent changes segfault on Linux ARM

Here is the offending test :

 

../tcc -B.. -I.. -I.. -I../include -o abitest-tcc abitest.c ../libtcc.a -I..  -W                                                   all -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-                                                   result -DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" -DCONFIG_MULTIARCHDIR="\"arm                                                   -linux-gnueabihf\"" -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_H                                                   ARDFLOAT -DTCC_ARM_VFP -lm -ldl   -I..

------------ abitest ------------

./abitest-cc lib_path=.. include="../include"

ret_int_test... success

ret_longlong_test... success

ret_float_test... success

ret_double_test... success

ret_longdouble_test... success

ret_2float_test... Segmentation fault

make[1]: *** [abitest] Error 139

make[1]: Leaving directory `/home/jullien/tinycc/tests'

make: *** [test] Error 2

 

<div><div class="WordSection1">
<p class="MsoNormal">Here is the offending test&nbsp;:<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
<p class="MsoNormal">../tcc -B.. -I.. -I.. -I../include -o abitest-tcc abitest.c ../libtcc.a -I..&nbsp; -W&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; all -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; result -DCONFIG_LDDIR="\"lib/arm-linux-gnueabihf\"" -DCONFIG_MULTIARCHDIR="\"arm&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; -linux-gnueabihf\"" -DTCC_TARGET_ARM -DWITHOUT_LIBTCC -DTCC_ARM_EABI -DTCC_ARM_H&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ARDFLOAT -DTCC_ARM_VFP -lm -ldl&nbsp;&nbsp; -I..<p></p></p>
<p class="MsoNormal">------------ abitest ------------<p></p></p>
<p class="MsoNormal">./abitest-cc lib_path=.. include="../include"<p></p></p>
<p class="MsoNormal">ret_int_test... success<p></p></p>
<p class="MsoNormal">ret_longlong_test... success<p></p></p>
<p class="MsoNormal">ret_float_test... success<p></p></p>
<p class="MsoNormal">ret_double_test... success<p></p></p>
<p class="MsoNormal">ret_longdouble_test... success<p></p></p>
<p class="MsoNormal"><span>ret_2float_test... Segmentation fault</span><p></p></p>
<p class="MsoNormal">make[1]: *** [abitest] Error 139<p></p></p>
<p class="MsoNormal">make[1]: Leaving directory `/home/jullien/tinycc/tests'<p></p></p>
<p class="MsoNormal">make: *** [test] Error 2<p></p></p>
<p class="MsoNormal"><p>&nbsp;</p></p>
</div></div>
ggasnier31 | 24 Apr 2013 22:15
Picon
Favicon

Re: ARM code generator / ARM tiny C compiler

I didn't check all. 
I found informations in the 'TODO' file related to 'ARM code generator'.
So where could I find the supported ARM architecture and what is the roadmap for it ?

Guillaume.

ggasnier31 | 24 Apr 2013 18:00
Picon
Favicon

ARM code generator / ARM tiny C compiler

Hello,

Are there people working on the feature ?
For this long-term feature, what are the main aspects of TCC to understand before going forward ?

Regards,
Guillaume GASNIER

Armin Steinhoff | 24 Apr 2013 12:25
Picon
Favicon

libtcc1 supported for ARMv7 ?


Hello,

I'm trying to use the JIT capabilitiy of TCC for an ARMv7 environment 
(Beaglebone / QNX6 ..) but the libtcc1 can't be recompiled for ARM CPUs.

Are there any plans to support the JIT features for ARM CPUs ?

Regards

--Armin

James Lyon | 22 Apr 2013 20:32
Picon

ABI compatibility

Hi,

I've been trying to use TCC as an embedded C compiler (instead of using 
GCC and dlopen/LoadLibrary). I ran into a few ABI compatibility issues 
(on Linux (x86-64), Win32 and Win64), basically to do with the way TCC 
passes and returns structs/unions. It seems that TCC generally expects 
that structs are passed and returns on the stack or via pointers, and on 
these 3 platforms it is also possible that they will be packed into 
registers. Anyway, I've also been working on fixing these problems and 
Linux (x86-64) and Win32 appear to work (at least, they pass the tests 
I'm using). Anyway, I'm really just emailing to say hello and start 
towards hopefully getting this stuff merged in.

James


Gmane