Re: [Tinycc-devel] TinyCC as selfcontaining compiler

2023-06-06 Thread Domingo Alvarez Duarte
I once did something related to this and can be seen here https://github.com/mingodad/tinycc/blob/af686a796bda94dc92fc3ad140ef438dafa08950/libtcc.h#L44 and here https://github.com/mingodad/tinycc/blob/af686a796bda94dc92fc3ad140ef438dafa08950/libtcc.c#L479 . On 6/6/23 21:50, draco wrote:

Re: [Tinycc-devel] Calling for Release 0.10.0

2023-05-31 Thread Domingo Alvarez Duarte
Hello all ! I would like to offer my patch for fully reentrant TCC for the upcoming release (see here https://github.com/mingodad/tinycc ) ! Cheers ! On 31/5/23 15:07, John Mastronardo via Tinycc-devel wrote: David Koch is spot on. I couldn’t agree more, and I’m paraphrasing him here:

Re: [Tinycc-devel] C23 front end

2023-05-30 Thread Domingo Alvarez Duarte
tps://github.com/melt-umn/silver>. = Cheers ! On 30/5/23 9:48, Domingo Alvarez Duarte wrote: Hello Thiago ! Maybe this project https://github.com/graphitemaster/gmqcc can be of your interest to use as backend on the playground. Cheers ! On 30/5/23 3:44, Thiago Adams wrote: Apo

Re: [Tinycc-devel] C23 front end

2023-05-30 Thread Domingo Alvarez Duarte
Hello Thiago ! Maybe this project https://github.com/graphitemaster/gmqcc can be of your interest to use as backend on the playground. Cheers ! On 30/5/23 3:44, Thiago Adams wrote: Apologies if this is a wrong place for this e-mail. I am creating a c23 front end called cake

Re: [Tinycc-devel] TCC produced wrong code (yarpgen v1)

2023-03-08 Thread Domingo Alvarez Duarte
Sorry ! It was my fault I was testing with a not mob tinycc, using mob the failed example I've showed before doesn't happen. Cheers ! On 8/3/23 12:02, Domingo Alvarez Duarte wrote: Using this script: yarpgen --std=c #../c2m driver.c func.c -ei gcc -o ygcc driver.c func.c &&

Re: [Tinycc-devel] TCC produced wrong code (yarpgen v1)

2023-03-08 Thread Domingo Alvarez Duarte
Using this script: yarpgen --std=c #../c2m driver.c func.c -ei gcc -o ygcc driver.c func.c && ./ygcc tinycc-env tcc -o ytcc driver.c func.c && ./ytcc It gives different result than gcc after 4 trials: check-it.sh /*SEED 2003917550*/ 5782830862525388415 1507557374623343254

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-19 Thread Domingo Alvarez Duarte
Looking through the code on "tests/tcctest.c" there is more places using "[unsigned] long" that probably will need to be revised to use "[unsigned] long long" or "size_t". Probably in several other places see bellow for a search on my fork: = va_list.c extern void *memcpy(void *dest,

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-19 Thread Domingo Alvarez Duarte
Hello Michael ! Thank you for your great work ! I applied your changes to my fork but the tests continue to fail on window see the result here https://github.com/mingodad/tinycc/actions/runs/3282234645/jobs/5405354710 . Cheers ! On 19/10/22 14:36, Michael Matz wrote: Hello, On Fri, 14

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-14 Thread Domingo Alvarez Duarte
It seems that something changed on windows itself because my fork was passing the tests before and now without any substantial change is failing see here https://github.com/mingodad/tinycc/actions , and I also tested on Windows7 32 bits and all tests pass. On 14/10/22 11:24, avih via

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-14 Thread Domingo Alvarez Duarte
The github action is already working and the windows tests failed see then here https://github.com/TinyCC/tinycc/actions/runs/3249532722 . On 14/10/22 11:24, avih via Tinycc-devel wrote: In reply to the second half of: https://lists.nongnu.org/archive/html/tinycc-devel/2022-10/msg00021.html >

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-14 Thread Domingo Alvarez Duarte
@nongnu.org] On Behalf Of Domingo Alvarez Duarte Sent: Friday, October 14, 2022 10:54 AM To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] test failures on win32 x86-64 I noticed that there is a github mirror of tinycc repository, maybe it's a good idea to set a github action there that builds

Re: [Tinycc-devel] test failures on win32 x86-64

2022-10-14 Thread Domingo Alvarez Duarte
I noticed that there is a github mirror of tinycc repository, maybe it's a good idea to set a github action there that builds and test it on windows, mac and linux on every commit. On 13/10/22 20:59, grischka wrote: On 08.10.2022 22:39, avih via Tinycc-devel wrote: Hi, The following tests

Re: [Tinycc-devel] Linking with cosmopolitan: Invalid relocation entry

2022-10-12 Thread Domingo Alvarez Duarte
    "_Thread_local _Alignof can't exceed TLS_ALIGNMENT"); = On 12/10/22 17:44, Domingo Alvarez Duarte wrote: Hello ! I'm trying to use tcc to build a test program using cosmopolitan libc https://github.com/jart/cosmopolitan and I'm getting this error : "cosmopolitan.a: err

[Tinycc-devel] Linking with cosmopolitan: Invalid relocation entry

2022-10-12 Thread Domingo Alvarez Duarte
Hello ! I'm trying to use tcc to build a test program using cosmopolitan libc https://github.com/jart/cosmopolitan and I'm getting this error : "cosmopolitan.a: error: Invalid relocation entry [ 2] '.rela.text' @ 000c". Here is the C program: = typedef short __CHAR16_TYPE__;

Re: [Tinycc-devel] Bug that TinyCC Analyses Strings inside #if 0 blocks

2022-07-11 Thread Domingo Alvarez Duarte
Hello Ziyao ! Although gcc compiles a file containing your example with warnings, I'm not sure it's worth try to do the same in TiinyCC the preprocessor probably uses TOKENS from the lexer to decide to skip till the end of the initial "#if 0" and '"' is not a valid token the error probably

Re: [Tinycc-devel] [patch] adding path resolution to #line directives

2022-05-05 Thread Domingo Alvarez Duarte
Why don't you do the collapse at generation time ? On 5/5/22 10:50, Raul Hernandez wrote: Hi, list. Over at vlang/v, we use #line directives to map line numbers in the generated C to the respective locations in the original code in backtraces, etc. The code we generate looks something like

Re: [Tinycc-devel] Linking with libtcc1.a

2022-04-14 Thread Domingo Alvarez Duarte
Hello Ziyao ! I once did this "Added what I call virtual io to tinycc this way we can make a monolitic executable or library that contains all needed to compile programs, truly tinycc portable." here https://github.com/mingodad/tinycc/commit/59e18aee0e509a3ca75dbe6f909e18c1d17893d1 maybe it

Re: [Tinycc-devel] Compilation error while including LAPACKE

2022-04-09 Thread Domingo Alvarez Duarte
e more the only other mention of complex type support with TCC was in 2015. https://www.mail-archive.com/tinycc-devel@nongnu.org/msg06428.html If complex types are not supported are there known work-arounds other than "dont use them"? Thanks Chris On Sat, 9 Apr 2022 at 09:03, Domingo A

Re: [Tinycc-devel] Compilation error while including LAPACKE

2022-04-09 Thread Domingo Alvarez Duarte
The problem seem to be related with "Complex" rather than "lapacke": #include #include int main() {   printf("Hello World!\n");   return 0; } Output: tcc -c cmath.c In file included from cmath.c:2: In file included from /usr/include/complex.h:106:

Re: [Tinycc-devel] Question about Atomics support in TCC

2022-04-07 Thread Domingo Alvarez Duarte
Here is the code that runs on linux and also seems to not behave correctly: #include //#include #include #include atomic_int acnt; int cnt; //int f(void* thr_data) { void *f(void* thr_data) {     for (int n = 0; n < 1000; ++n) {     ++cnt;     ++acnt;     }     return 0; }

Re: [Tinycc-devel] Re : Re: Re : Some questions regarding of TCC's optimizations.

2022-04-06 Thread Domingo Alvarez Duarte
Hello Brian ! I just applied you changes to my fork of tcc made fully reentrant here https://github.com/mingodad/tinycc and tested with the script shown bellow building sqlite3 with tcc and gcc -O0. The resulting sqlite3 was tested creating a database from 150MB of sql and the resulting

Re: [Tinycc-devel] Re : Re: Re : Some questions regarding of TCC's optimizations.

2022-04-05 Thread Domingo Alvarez Duarte
. ~Brian On 4/4/2022 10:26 AM, Domingo Alvarez Duarte wrote: After reading this https://briancallahan.net/blog/20220330.html and using a citation on this list about dumping the ASM generated by TCC using objdump maybe we can find patterns on the generated code and identify where it's produced and update

Re: [Tinycc-devel] Re : Re: Re : Some questions regarding of TCC's optimizations.

2022-04-04 Thread Domingo Alvarez Duarte
10:26 AM, Domingo Alvarez Duarte wrote: After reading this https://briancallahan.net/blog/20220330.html and using a citation on this list about dumping the ASM generated by TCC using objdump maybe we can find patterns on the generated code and identify where it's produced and update then. On 31/3

Re: [Tinycc-devel] Re : Re: Re : Some questions regarding of TCC's optimizations.

2022-04-04 Thread Domingo Alvarez Duarte
After reading this https://briancallahan.net/blog/20220330.html and using a citation on this list about dumping the ASM generated by TCC using objdump maybe we can find patterns on the generated code and identify where it's produced and update then. On 31/3/22 20:16, rempas via Tinycc-devel

Re: [Tinycc-devel] A Patch for -dumpmachine Option

2022-03-24 Thread Domingo Alvarez Duarte
Looking at the patch I think that somehow it can be a good idea to create a new header/source to hold all (or as much as possible) of the platforms machinery in one place instead of spread through everywhere, like the functionality of "-dumpmachine" would be on that header/source. On 24/3/22

Re: [Tinycc-devel] NULL pointer dereference due to unchecked return from fdopen()

2022-02-28 Thread Domingo Alvarez Duarte
+1 To "just write a tcc_fdopen()" On 28/2/22 13:46, Steffen Nurpmeso wrote: Vincent Lefevre wrote in <20220228103710.ga33...@zira.vinc17.org>: |On 2022-02-28 10:50:29 +0100, grischka wrote: |> Christian Jullien wrote: |>> Thanks, |>> This is unfortunately not the only case where

Re: [Tinycc-devel] Re : Re: Re : Re: Extend tcc to use viable.

2022-02-25 Thread Domingo Alvarez Duarte
Hello Steffen ! Thank you for pointing out https://directory.fsf.org/wiki/Lightweight_C++ I just downloaded it and fixed several compilers warnings/errors but but there is a need to add code to handle/ignore "__attribute__" for the preprocessed headers. I'm making my fixes available here

Re: [Tinycc-devel] Using tcc for reflection

2022-02-02 Thread Domingo Alvarez Duarte
Every day is a day to learn something new (even if it's old) ! On 1/2/22 22:07, rempas via Tinycc-devel wrote: This is deceptive! The GNU libc headers unconditionally define '__attribute__()' to nothing if the compiler isn't GCC, and not just internally, so a declaration like:

Re: [Tinycc-devel] Using tcc for reflection

2022-02-01 Thread Domingo Alvarez Duarte
Hello Elijah ! On 1/2/22 6:30, Elijah Stone wrote: ‘cleanup’ variable attribute It doesn't seem that tinycc has this implemented properly because testing it with this example https://echorand.me/site/notes/articles/c_cleanup/cleanup_attribute_c.html I can build and execute it but there is

Re: [Tinycc-devel] CFront for TinyCC?

2021-11-04 Thread Domingo Alvarez Duarte
ange...@nongnu.org] On Behalf Of Domingo Alvarez Duarte Sent: Tuesday, November 02, 2021 14:07 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] CFront for TinyCC? Hello ! After making tinycc fully reentrant here https://github.com/mingodad/tinycc I decided to have a look at cfront and after

[Tinycc-devel] CFront for TinyCC?

2021-11-02 Thread Domingo Alvarez Duarte
Hello ! After making tinycc fully reentrant here https://github.com/mingodad/tinycc I decided to have a look at cfront and after a week of work on a fork from seiko2 I've got it to build for 32/64 bits for linux here https://github.com/mingodad/cfront-3 , it also build on OSX and MYSYS2 with

Re: [Tinycc-devel] Making tinycc fully reentrant

2021-10-25 Thread Domingo Alvarez Duarte
tok_two_chars[67]; = With respect to "any tinycc practical project exists" I consider libtcc the main project and tcc and all cross compiler variants as usage examples of it. Again any feedback pull request is welcome ! Cheers ! On 25/10/21 0:25, grischka wrote: Domingo Alvarez Du

Re: [Tinycc-devel] Making tinycc fully reentrant

2021-10-21 Thread Domingo Alvarez Duarte
off_t; Christian -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Domingo Alvarez Duarte Sent: Thursday, October 21, 2021 20:19 To: tinycc-devel@nongnu.org Subject: [Tinycc-devel] Making tinycc fully reentrant Hello ! I did

[Tinycc-devel] Making tinycc fully reentrant

2021-10-21 Thread Domingo Alvarez Duarte
Hello ! I did it once in the past and did again moving almost all global variables to TCCState and on Ubuntu 18.04 x86_64 all tests from "make test" pass. It's a massive refactoring (3 full working days). Any comments/suggestions are welcome ! Cheers !

Re: [Tinycc-devel] Mach-O (i.e. MacOS) support

2020-06-21 Thread Domingo Alvarez Duarte
I think that if it's not too hard to maintain 32bits it shouldn't be removed, because there is still working machines that run 32bits code (used and usable second hand). On 21/6/20 6:56, Christian Jullien wrote: Hello Matz, Amazing!! I'm glad to be the first to tell you it works ROOTB

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Domingo Alvarez Duarte
Hello ! We can have direct measure using https://github.com/mingodad/tinycc that already does/did the transformation to make tinycc reentrant and maybe revive it. Cheers ! On 9/12/19 16:33, Michael Matz wrote: Hi, On Sat, 7 Dec 2019, Christian Jullien wrote: 2) slower code: most of the

Re: [Tinycc-devel] make tcc reentrant

2019-12-07 Thread Domingo Alvarez Duarte
Hello ! I went to the trouble of making tcc fully reentrant but it was not accepted https://github.com/mingodad/tinycc which is sad. Cheers ! On 6/12/19 22:16, Charles Lohr wrote: Is there a reason you don't just compile tcc in tcc to make the tcc instance that is basically then reentrant? 

Re: [Tinycc-devel] c extensions

2014-04-18 Thread Domingo Alvarez Duarte
I like your idea in principle, have you thought to use a tool like led/peg parser http://piumarta.com/software/peg/ using a C grammar like http://www.romanredz.se/freesoft.htm#C, you'll have more freedom to express your ideas. Also maybe you already know this: - http://milgra.com/classc/ - pcc

[Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
Hello ! When applying this commit to my fork, I'm not sure if it's correct: arm: Use proper PLT/GOT for -run.http://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848bhttp://repo.or.cz/w/tinycc.git/commit/01c041923474750a236da02561f0f8835445848b

Re: [Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
Ok I can see in the next commit that this is removed completely ! On Sun, Apr 6, 2014 at 11:19 AM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Hello ! When applying this commit to my fork, I'm not sure if it's correct: arm: Use proper PLT/GOT for -run.http

Re: [Tinycc-devel] Is this ok on commit Use proper PLT/GOT for -run

2014-04-06 Thread Domingo Alvarez Duarte
:50 AM, Michael Matz matz@frakked.de wrote: Hi, On Sun, 6 Apr 2014, Domingo Alvarez Duarte wrote: Ok I can see in the next commit that this is removed completely ! Yep, I was trying to separate cleanups from implementing features also for the commits, makes bisecting a tad easier

Re: [Tinycc-devel] Tinycc for ARM help needed !

2014-04-03 Thread Domingo Alvarez Duarte
to: www.valgrind.org In the bug report, send all the above text, the valgrind version, and what OS and version you are using. Thanks. On Thu, Apr 3, 2014 at 5:07 PM, Michael Matz matz@frakked.de wrote: Hi, On Wed, 2 Apr 2014, Domingo Alvarez Duarte wrote: 1- Inconsistency detected by ld.so: rtld.c

Re: [Tinycc-devel] Tinycc for ARM help needed !

2014-04-03 Thread Domingo Alvarez Duarte
This error appear only when the program is compiled with tinycc without debug info, with debug info valgrind runs fine without errors, and striping the program then the program and valgrind also works fine. On Thu, Apr 3, 2014 at 5:41 PM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Thanks

Re: [Tinycc-devel] tcc i386 test failures after commit ea2805f

2014-04-03 Thread Domingo Alvarez Duarte
Indeed I did so on my repository https://github.com/mingodad/tinycc/commit/74840e25b5d2bde099dbd3e7088cfef49bb172ce On Thu, Apr 3, 2014 at 8:55 PM, Domingo Alvarez Duarte mingo...@gmail.comwrote: I propose to remove bounds check from tests/build till we have a good solution/implementation

Re: [Tinycc-devel] Valgrind Inconsistency detected by ld.so: rtld.c:

2014-04-01 Thread Domingo Alvarez Duarte
--event.mtime DESC LIMIT 20; - On Mon, Mar 31, 2014 at 11:14 PM, Domingo Alvarez Duarte mingo...@gmail.com wrote: Hello Daniel ! I'm still looking at why fossil-scm compiled by tcc do not work properly and found that now the problem is with the sqlite3 sources compiled with tcc, in a place

Re: [Tinycc-devel] improving get_tok_str

2014-03-31 Thread Domingo Alvarez Duarte
Hello Thomas ! What do you mean by old version of tcc there is other newer versions elsewhere ? Cheers ! On Mon, Mar 31, 2014 at 3:26 PM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-30 21:18, Domingo Alvarez Duarte a écrit : That would be nice ! I would like to see

Re: [Tinycc-devel] improving get_tok_str

2014-03-31 Thread Domingo Alvarez Duarte
Not at all I propose using the current tinycc for that ! On Mon, Mar 31, 2014 at 4:00 PM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-31 22:50, Domingo Alvarez Duarte a écrit : Hello Thomas ! What do you mean by old version of tcc there is other newer versions elsewhere

Re: [Tinycc-devel] improving get_tok_str

2014-03-31 Thread Domingo Alvarez Duarte
About documentation and looking at the Tiny code generator http://wiki.qemu.org/Documentation/TCG/backend-ops and http://wiki.qemu.org/Documentation/TCG/frontend-ops , something like that for the actual tinycc would be useful for new people to understand code generation. Cheers ! On Mon, Mar

Re: [Tinycc-devel] Valgrind Inconsistency detected by ld.so: rtld.c:

2014-03-31 Thread Domingo Alvarez Duarte
-ldl -lpthread - And get results from the test-query-gcc but no results from test-query-tcc, now I'll try to get more close to the problem. Cheers ! On Sat, Mar 29, 2014 at 5:57 PM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Hello Daniel ! With your commit tcc can compile and run

Re: [Tinycc-devel] Bounds mixing non malloced strings is the reason to make tests fail on linux 32bits

2014-03-30 Thread Domingo Alvarez Duarte
On Sun, Mar 30, 2014 at 4:50 AM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-30 01:01, Domingo Alvarez Duarte a écrit : Hello all ! I followed the code and could see that mixing strings malloced and not malloced by tcc is the reason for the test to fail on linux 32 bits

Re: [Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-30 Thread Domingo Alvarez Duarte
from anywhere without any auxiliary files/folder. Cheers ! On Sat, Mar 29, 2014 at 7:13 PM, grischka gris...@gmx.de wrote: Domingo Alvarez Duarte wrote: Hello all ! I finished phase1 of code refactoring of tinycc to remove global variables, not all global variables are removed yet

Re: [Tinycc-devel] Is --enable-cross of any use in its current form?

2014-03-30 Thread Domingo Alvarez Duarte
For kick/dirty tests purposes --enable-cross is a good option when making changes to tinycc itself. On Sun, Mar 30, 2014 at 1:28 PM, Thomas Preudhomme robo...@celest.frwrote: Hi there, TL;DR: remove --enable-cross and use build arch != target arch to detect the cross-compiling case When

Re: [Tinycc-devel] improving get_tok_str

2014-03-30 Thread Domingo Alvarez Duarte
That would be nice ! I would like to see the implementation of qcc http://lists.nongnu.org/archive/html/tinycc-devel/2011-09/txtYogaFhDvlT.txtand any documentation will help on it, someone asked before about tinycc generate an intermediate pcode that would make things easier for qcc. When I

[Tinycc-devel] Improve generated .stabs to make easy to debug tinycc generated code

2014-03-30 Thread Domingo Alvarez Duarte
Hello all ! I'm trying to figure out why the fossil-scm compiled with tinycc on arm doesn't work as expected and again with my previous experience trying to figure out why tinycc was generating bad code on X86_64 I found that having function names on the generated .stabs is better than nothing

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-30 Thread Domingo Alvarez Duarte
, Michael Matz matz@frakked.de wrote: Hi, On Sat, 29 Mar 2014, Domingo Alvarez Duarte wrote: clang and pcc also generates inline assembly instead of call/alloc. Yes. I haven't said the relevant stdarg functions have to use malloc. They just need to interoperate with what the ABI says

[Tinycc-devel] Tinycc failing to compile fossil-scm on ubuntu 13.10 arm

2014-03-30 Thread Domingo Alvarez Duarte
Hello all ! Trying to find why fossil-scm compiled with tinycc do not work properly on ubuntu 13.10 arm inside a nexus5 and trying to use the debugger I've got the messages shown bellow, on my ubuntu 12.04 X86_64 gdb works fine with fossil-scm compiled by tinycc, it's here just in case someone

Re: [Tinycc-devel] improving get_tok_str

2014-03-29 Thread Domingo Alvarez Duarte
It's not better to have two different functions/entry points, one for when we have/need a CValue and other without it ? On Sat, Mar 29, 2014 at 5:26 PM, Michael Matz matz@frakked.de wrote: Hi, On Sat, 29 Mar 2014, grischka wrote: Thomas Preudhomme wrote: Le 2014-03-15 20:10, mobi

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-29 Thread Domingo Alvarez Duarte
, On Fri, 28 Mar 2014, Domingo Alvarez Duarte wrote: It's simple remove the zeroing CValues and try make clean, make and make test you'll see that on linux 32 bits and linux 64 bits and you'll I see no errors on x86_64, I do see these errors on i386: -- -Test C99 VLA 5

Re: [Tinycc-devel] Valgrind Inconsistency detected by ld.so: rtld.c:

2014-03-29 Thread Domingo Alvarez Duarte
wrote: On Fri, Mar 28, 2014 at 12:27:39PM +, Domingo Alvarez Duarte wrote: For arm experts, it gets a segfault on translate.c:98 Please try again with current mob. I fixed a bug that might be the cause for your segfault. Best regards, Daniel P.S.: I wonder if a better fix would

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-29 Thread Domingo Alvarez Duarte
(unreachable\n); lbl_return: return 0; } On Sat, Mar 29, 2014 at 5:57 PM, Michael Matz matz@frakked.de wrote: Hi, On Sat, 29 Mar 2014, Domingo Alvarez Duarte wrote: How do you propose to solve this specific problem ? ST_FUNC void vset(TCCState* tcc_state, CType *type, int r, int v

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-29 Thread Domingo Alvarez Duarte
, On Sat, 29 Mar 2014, Domingo Alvarez Duarte wrote: Ok now I understand your point, here is the minimal program that I was using to trace it: int main() { int x; static void *label_return = lbl_return; //printf(label_return = %p\n, label_return); goto *label_return; // here segfault

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-29 Thread Domingo Alvarez Duarte
. And even thought about using macros to set/get CValues that will check for the correct values with an assert and then forbid as a rule to use get/set CValues directly. Cheers ! On Sun, Mar 30, 2014 at 12:40 AM, Domingo Alvarez Duarte mingo...@gmail.com wrote: Not at all, now you also could see

Re: [Tinycc-devel] Valgrind Inconsistency detected by ld.so: rtld.c:

2014-03-28 Thread Domingo Alvarez Duarte
./src/branch.c ==16261== valgrind: m_debuginfo/readelf.c:2309 (vgModuleLocal_read_elf_debug_info): Assertion 'crc_offset + sizeof(UInt) = debuglink_sz' failed. ==16261==at 0x380ABB88: ??? (in /usr/lib/valgrind/none-arm-linux) On Fri, Mar 28, 2014 at 11:51 AM, Domingo Alvarez Duarte mingo

Re: [Tinycc-devel] Tinycc from git still can't compile fossil-scm

2014-03-28 Thread Domingo Alvarez Duarte
I found that on X86_64 linux if I do not free the memory on __va_end(), the compiled fossil-scm server works, I suspect is something with the fork/threads. --- void __va_end(struct __va_list_struct *ap) { //free(ap); } Cheers ! On Thu, Mar 27, 2014 at 12:23 PM, Domingo Alvarez Duarte mingo

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-28 Thread Domingo Alvarez Duarte
, 2014 at 7:58 PM, Michael Matz matz@frakked.de wrote: Hi, On Wed, 26 Mar 2014, Domingo Alvarez Duarte wrote: On my commit It would be easier if you wrote your reasons for doing things in mails, not only in commit messages, it makes quoting much harder. Anyway, in the commit message you

[Tinycc-devel] Code refactoring to remove globals phase1 done.

2014-03-28 Thread Domingo Alvarez Duarte
Hello all ! I finished phase1 of code refactoring of tinycc to remove global variables, not all global variables are removed yet but most of then are, with that it can cross compile all platforms on my linux X86_64 and till only on real test was done on linux. Here you can find the repository to

Re: [Tinycc-devel] trying tinycc on several hundred projects (results)

2014-03-27 Thread Domingo Alvarez Duarte
Hello Austin ! We did some fixes to tinycc, some of then could be the reason for so may failures on your tests, can you try then again with the tinycc from git to see how it have improved ? Thanks in advance for your time and attention ! On Wed, Mar 26, 2014 at 3:31 AM, Austin English

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-27 Thread Domingo Alvarez Duarte
the community have one start point to decide and compare the pros cons of a such code change. Cheers ! On Thu, Mar 27, 2014 at 3:44 PM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-27 07:23, Domingo Alvarez Duarte a écrit : Again my mistake, it does pass vla tests on linux 32 bits

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-27 Thread Domingo Alvarez Duarte
are zeroed. Are you sure about that ? Cheers ! On Thu, Mar 27, 2014 at 3:44 PM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-27 07:23, Domingo Alvarez Duarte a écrit : Again my mistake, it does pass vla tests on linux 32 bits, the bounds check tests fail with garbage being passed

Re: [Tinycc-devel] This commit causes segfaults on make test

2014-03-26 Thread Domingo Alvarez Duarte
] Error 2 Cheers ! On Wed, Mar 26, 2014 at 1:54 PM, Thomas Preudhomme robo...@celest.frwrote: Le 2014-03-26 07:58, Domingo Alvarez Duarte a écrit : Hello ! Hi there, This commit Support GOT32 and PLT32 reloc for same symbol causes make test to segfault, also tcc compiles by itself

[Tinycc-devel] Zeroing stack variables CValue

2014-03-26 Thread Domingo Alvarez Duarte
Hello ! On my commit I posted that it solves the vla tests on linux 32bits, it was a mistake from my part, the vla test still fail with garbage. Probably what the comments say is happening: /* Overwrite a VLA. This will overwrite the return address if SP is incorrect */ Cheers !

Re: [Tinycc-devel] Zeroing stack variables CValue

2014-03-26 Thread Domingo Alvarez Duarte
Again my mistake, it does pass vla tests on linux 32 bits, the bounds check tests fail with garbage being passed to strlen. On arm it also works. On Wed, Mar 26, 2014 at 8:30 PM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Hello ! On my commit I posted that it solves the vla tests

[Tinycc-devel] This commit causes segfaults on make test

2014-03-25 Thread Domingo Alvarez Duarte
Hello ! This commit Support GOT32 and PLT32 reloc for same symbol causes make test to segfault, also tcc compiles by itself segfault. Cheers ! ___ Tinycc-devel mailing list Tinycc-devel@nongnu.org https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Re: [Tinycc-devel] Tinycc without globals first try

2014-03-23 Thread Domingo Alvarez Duarte
/generation. I'm trying to figure out what the problem is, meanwhile if someone with more knowledge on tinycc can give a help it's welcome. Thanks again for your time and attention ! On Sun, Mar 23, 2014 at 12:28 AM, Domingo Alvarez Duarte mingo...@gmail.com wrote: Hello ! I've been

[Tinycc-devel] Tinycc without globals first try

2014-03-22 Thread Domingo Alvarez Duarte
Hello ! I've been refactoring tinycc to remove global variables and work only with TCCState after several attempts I finaly got it on a initial working state using netbeans to do most of the refactoring work. Testing it on a nexus five running Ubuntu 13.10 with make test all tests pass On

Re: [Tinycc-devel] test failure on Linux

2013-02-13 Thread Domingo Alvarez Duarte
Talking about crt*.o I remember having problem to link on Android. Has someone discovered how to link on Android ? Thanks ! On Wed, Feb 13, 2013 at 3:30 PM, arn...@skeeve.com wrote: Thomas Preud'homme robo...@celest.fr wrote: Why not but strike multiarch from that as I don't see how we

Re: [Tinycc-devel] Small patch

2013-01-31 Thread Domingo Alvarez Duarte
On Thu, Jan 31, 2013 at 12:19 PM, grischka gris...@gmx.de wrote: -h = elf_hash(name) % nbuckets; +h = name ? elf_hash(name) % nbuckets : 0; This is counterproductive IMO because when you read this you get the wrong impression that there are cases where name is

Re: [Tinycc-devel] Small patch

2013-01-31 Thread Domingo Alvarez Duarte
On Thu, Jan 31, 2013 at 12:36 PM, Thomas Preud'homme robo...@celest.frwrote: Le jeudi 31 janvier 2013 13:19:59, grischka a écrit : -strcpy(buf, __bound_); -strcat(buf, name); +snprintf(buf, sizeof(buf), __bound_%s, name);

Re: [Tinycc-devel] Small patch

2013-01-30 Thread Domingo Alvarez Duarte
Hello ! I'm looking again on the reports done with Coverity Scan and found several things one of it is this: static void asm_expr_prod(TCCState *s1, ExprValue *pe) { int op; ExprValue e2; asm_expr_unary(s1, pe); for(;;) { op = tok; if (op != '*' op != '/' op !=

Re: [Tinycc-devel] Small patch

2013-01-30 Thread Domingo Alvarez Duarte
= ~VT_INLINE; On Thu, Jan 31, 2013 at 1:13 AM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Also on this function: CID 968150 (#1 of 1): Unchecked return value (CHECKED_RETURN)6. check_return: Calling function parse_btype(CType *, AttributeDef *) without checking return value (as is done

Re: [Tinycc-devel] Small patch

2013-01-30 Thread Domingo Alvarez Duarte
= 0; type1 = btype; On Thu, Jan 31, 2013 at 1:07 AM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Also here : static void asm_expr_logic(TCCState *s1, ExprValue *pe) { int op; ExprValue e2; asm_expr_prod(s1, pe); for(;;) { op = tok

Re: [Tinycc-devel] Small patch

2013-01-30 Thread Domingo Alvarez Duarte
default mean pe-v ^= e2.v; break; } } } On Thu, Jan 31, 2013 at 1:06 AM, Domingo Alvarez Duarte mingo...@gmail.comwrote: Hello ! I'm looking again on the reports done with Coverity Scan and found several things one of it is this: static void

Re: [Tinycc-devel] Call for testing

2013-01-18 Thread Domingo Alvarez Duarte
wrote: Domingo Alvarez Duarte wrote: Please someone here that administer this project can open a free account for opensource projects on http://scan.coverity.com/ and submit tinycc build to verify for defects, I did with my account and I've got this: There is much more details available about

Re: [Tinycc-devel] Call for testing

2013-01-17 Thread Domingo Alvarez Duarte
Please someone here that administer this project can open a free account for opensource projects on http://scan.coverity.com/ and submit tinycc build to verify for defects, I did with my account and I've got this: There is much more details available about this problems on the account pages, if

Re: [Tinycc-devel] Added virtual io to tinycc

2013-01-14 Thread Domingo Alvarez Duarte
Domingo Alvarez Duarte wrote: Let's see if I can explain it better. The modifications I did was replace: fd - fd or fd-fd depending on the context [...] Indeed switching tinycc to cope with struct fd was a bad decision to begin with. Under any circumstances I'd recommend

Re: [Tinycc-devel] Added virtual io to tinycc

2013-01-12 Thread Domingo Alvarez Duarte
; } On Sat, Jan 12, 2013 at 4:35 PM, grischka gris...@gmx.de wrote: Domingo Alvarez Duarte wrote: Added what I call virtual io to tinycc this way we can make a monolitic executable or library that contains all needed to compile programs, truly tinycc portable. [...] I hope this will improve

Re: [Tinycc-devel] Added virtual io to tinycc

2013-01-11 Thread Domingo Alvarez Duarte
(fd-fd); vio_initialize(fd); return rc; } On Fri, Jan 11, 2013 at 7:28 AM, u-tcc-u...@aetey.se wrote: Hello Domingo, On Fri, Jan 11, 2013 at 12:23:35AM +, Domingo Alvarez Duarte wrote: Added what I call virtual io to tinycc this way we can make a monolitic executable

[Tinycc-devel] Added virtual io to tinycc

2013-01-10 Thread Domingo Alvarez Duarte
Added what I call virtual io to tinycc this way we can make a monolitic executable or library that contains all needed to compile programs, truly tinycc portable. Tested under linux exec the mk-it shell script and you'll end up with a portable tinycc executable that doesn't depend on anything