Re: [Tinycc-devel] Add wine support

2019-10-25 Thread Michael Matz
Hello, On Thu, 24 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > I wanted to test how windows generated some code. I never use windows so I > wanted to use wine. > > I copied the Makefile from 'https://sourceforge.net/projects/wintcc/' and > adjusted it a little bit. > > Now I can use th

Re: [Tinycc-devel] SSE calling convention bug

2019-10-28 Thread Michael Matz
Hi, On Sun, 27 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > Look like the code in x86_64-gen.c is wrong. It should read: > >     if (sse_reg) { /* avoid redundant movaps %xmm0, %xmm0 */ >     /* movaps %xmm1, %xmmN */ >     o(0x280f); >   

Re: [Tinycc-devel] constructor/destructor support

2019-10-28 Thread Michael Matz
Hello, On Fri, 25 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > I implemented constructors and destructors. This was the one thing I was > missing for my own project. > > See the attachment. > > Can I push it? Could you please refactor some things? In particular the duplicate code of

Re: [Tinycc-devel] constructor/destructor support

2019-10-30 Thread Michael Matz
Hi, On Wed, 30 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > I had a good night sleep and realized that I could copy the .init/.fini > arrays relocations to the text section Why to the text section (and not, say .data, .init_array contains pointers, not code), and why copying at all?

Re: [Tinycc-devel] bounds checking with tcc

2019-10-31 Thread Michael Matz
Hi, On Tue, 29 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > I tried bound checking with tcc and found some problems. (See attached > patch). The bound checking code is fairly incomplete, and some of it can't really be fixed without more aggressive changes in TCC, my private opinion is

Re: [Tinycc-devel] constructor/destructor support

2019-11-27 Thread Michael Matz
I like that, push it :) Ciao, Michael. > > Regards, > >     Herman > > On 2019-10-30 15:58, Michael Matz wrote: > > Hi, > > > > On Wed, 30 Oct 2019, Herman ten Brugge via Tinycc-devel wrote: > > > >> I had a good night sleep and realized that I

Re: [Tinycc-devel] compiler warning with 'elf: rewrite version support'

2019-11-27 Thread Michael Matz
Hi, On Tue, 26 Nov 2019, Herman ten Brugge via Tinycc-devel wrote: > tccelf.c: In function 'tcc_output_file': > tccelf.c:615:23: warning: 'vna' may be used uninitialized in this function > [-Wmaybe-uninitialized] >   615 | vna->vna_next = 0; >   | ~~^~~ > tccelf.c:

Re: [Tinycc-devel] bounds checking with tcc

2019-11-27 Thread Michael Matz
Hello Herman, On Tue, 26 Nov 2019, Herman ten Brugge wrote: > > As TCC is single pass, at the declaration of locali you can't know that > > eventually the address is taken. So, as in your patch, you have to always > > generate code assuming that the address will be eventually taken, i.e. for > >

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Michael Matz
Hello, On Wed, 27 Nov 2019, Herman ten Brugge wrote: > > Exactly. So we need to make a decision if we want that extension of the > > bounds-checking feature in TCC under these constraints. In my opinion we > > don't want to, but I won't stand in the way of extending it to locals (but > > then t

Re: [Tinycc-devel] bounds checking with tcc

2019-11-28 Thread Michael Matz
Hello again, but to maybe be a bit more constructive: On Thu, 28 Nov 2019, Michael Matz wrote: > > I fixed this with some push/pop trickery. I see, yeah, expanding calls during calls is broken as gfunc_call in the generators doesn't generally leave a trace in vtop[] which re

Re: [Tinycc-devel] bounds checking with tcc

2019-12-05 Thread Michael Matz
>> threaded. > >> I found another problem with nocode_wanted when using sizeof(). > >> Also the push/pop trick needed to push some more registers when more > >> parameters are passed in registers. > >> > >> I probably forget to mention a lot a other

Re: [Tinycc-devel] some options do not work after tcc.h change

2019-12-05 Thread Michael Matz
Hi, On Thu, 5 Dec 2019, Herman ten Brugge via Tinycc-devel wrote: > Some options do not work any more after recent tcc.h change. (values are > overwritten). > The code in set_flag uses: > >     *(int*)((char *)s + p->offset) = >     p->flags & FD_INVERT ? !value : value; > >

Re: [Tinycc-devel] make tcc reentrant

2019-12-06 Thread Michael Matz
Hello, On Tue, 3 Dec 2019, Ulrich Schmidt wrote: > i try to write a lua binding for tcc. To work out propperly, the tcc lib > needs to be reentrant. As demonstrated down-thread, that isn't correct. It doesn't _need_ to be, it would be an feature. As usual with features it needs to be measured

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hi, On Sun, 8 Dec 2019, uso ewin wrote: > I've made a version that should support multi thread on my github > https://github.com/cosmo-ray/tcc/commit/46d0e73edc7e448f0f514936fdb4f62e2c8800a4 > I didn't tests it, it's just here to show the > possibility using _Thread_local. Ulrich doesn't care fo

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hi, On Sat, 7 Dec 2019, Daniel Glöckner wrote: > We need a macro > > #if scenario == 1 > #define PASSPARAM1 > #else > #define PASSPARAM1 s1, > #endif > > Grouping all globals in the TCCState structure might be beneficial > even if we don't switch to those macros, because of the cache locality >

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
ginal Message- > From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] > On Behalf Of Michael Matz > Sent: Friday, December 06, 2019 16:42 > To: TCC mailing list > Subject: Re: [Tinycc-devel] make tcc reentrant > > Hello, > > On Tue, 3 Dec 20

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hello, [sorry for the flurry of mails, I probably should have responded once to a set of mails :) ] On Sat, 7 Dec 2019, Ulrich Schmidt wrote: > After reading all your posts. I see there are 2 scenarios/goals in the > comunity. > > scenario 1: > I want a tiny and fast c compiler (tcc/tcc.exe).

Re: [Tinycc-devel] make tcc reentrant

2019-12-09 Thread Michael Matz
Hello, On Mon, 9 Dec 2019, Ulrich Schmidt wrote: > Am 09.12.2019 um 16:42 schrieb Michael Matz: > > And here's the crux: define "compiling state related values". Is the > > memory allocator part of that? The token hash table? The sections? > > The symbol ta

Re: [Tinycc-devel] 111_conversion.c with bounds checking

2019-12-10 Thread Michael Matz
Hello, On Tue, 10 Dec 2019, Herman ten Brugge via Tinycc-devel wrote: > I still have one small problem with testcase 111_conversion.c > > The problem is that it fails on i386.c (linux) when compiling with: > tcc 111_conversion.c -o 111_conversion -b > ./111_conversion > > I fixed this (and com

Re: [Tinycc-devel] make tcc reentrant

2019-12-11 Thread Michael Matz
Hi, On Wed, 11 Dec 2019, grischka wrote: > Couldn't help to try out some things, related to the matter. > See > https://repo.or.cz/tinycc.git/commitdiff/72729d8e360489416146d6d4fd6bc57c9c72c29b Yeah, something like that was in my mind as well. > Anyway I think, it still does look like tinycc.

Re: [Tinycc-devel] mob is broken for ARM/ARM64 [make tcc reentrant]

2019-12-11 Thread Michael Matz
Hello Christian, On Wed, 11 Dec 2019, Christian Jullien wrote: > but, as still does Aarch64, gives: > - libtest : tcc in threads - > tcc: error: library 'c' not found Yeah, on x86-64 as well. I think I've fixed this in mob now. Please recheck. Ciao, Michael. > > Adding $(NATIVE_DE

Re: [Tinycc-devel] mob is broken for ARM/ARM64 [make tcc reentrant]

2019-12-11 Thread Michael Matz
e TCC_ARM_VFP in tcc.h Otherwise, Aarch64 is fine. Tomorrow I'll add the missing headers to remove warnings. -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Michael Matz Sent: Wednesday, December 11, 2019 18:11 To: jull.

Re: [Tinycc-devel] make tcc reentrant

2019-12-14 Thread Michael Matz
Hi, On Thu, 12 Dec 2019, grischka wrote: I assume Michael wrote that under the impression that there is still global data with lifetime beyond the tcc_compile function call, which was the case for example for the tokens and token hash table. I have to admit that I did remove that feature, Lu

Re: [Tinycc-devel] TinyCC failure on i386

2019-12-17 Thread Michael Matz
Hello, On Fri, 13 Dec 2019, Giovanni Mascellani wrote: > TinyCC fails to test on i386 on the CI that I just set up. Apparently, > though, the problem is not in tcc, but in gcc, which is used to compile > the test program too and compare the results. > > I managed to trim down the offending examp

Re: [Tinycc-devel] CI improvements (was: Re: TinyCC failure on i386)

2019-12-17 Thread Michael Matz
Hi, On Tue, 17 Dec 2019, Giovanni Mascellani wrote: Ok, I enabled a "test_native" job that runs tests without a virtual machine. It is only for amd64, for the moment. I will add i386 as soon as I have some time to test the right environment and commands. Super, thanks. BTW, I am happy that

Re: [Tinycc-devel] Request: __attribute__((vector_size))

2020-01-06 Thread Michael Matz
Hello, On Mon, 6 Jan 2020, Rasmus Riiner via Tinycc-devel wrote: See here: https://gcc.gnu.org/onlinedocs/gcc/Vector-Extensions.html This is one of those things that doesn't come up in a lot of types of programming, but is indispensable in some, namely anything to do with 2D or 3D math. The

Re: [Tinycc-devel] Request: __attribute__((vector_size))

2020-01-06 Thread Michael Matz
ndeed necessary for a compiler, or any program whatsoever. Ciao, Michael. regards, ian Le 06/01/2020 à 20:36, Michael Matz a écrit : Hello, On Mon, 6 Jan 2020, Rasmus Riiner via Tinycc-devel wrote: See here: https://gcc.gnu.org/onlinedocs/gcc/Vector-

Re: [Tinycc-devel] Request: __attribute__((vector_size))

2020-01-06 Thread Michael Matz
s or physics If I'm wrong, please, explain to me where... ian Le 06/01/2020 à 21:46, Michael Matz a écrit : Hi, On Mon, 6 Jan 2020, ian wrote: Is the support for data structures and calculations a real "need to" for a compiler

Re: [Tinycc-devel] Divisions by zero in dead branches cause compiler errors

2020-01-15 Thread Michael Matz
Hello, On Wed, 15 Jan 2020, Petr Skočík wrote: I've just noticed `_Static_assert( !0 || 1/0, "");` fails to compile on tinycc. Thanks for the report, that shows that unevaluated sub-expressions of const expressions were mishandled. We also diagnosed (incorrectly) static int i = 2 || 1 /

Re: [Tinycc-devel] Error when compiling with tcc

2020-01-15 Thread Michael Matz
Hello, On Tue, 14 Jan 2020, Thiabaud Engelbrecht wrote: Hey all, works with every other compiler I've tried, including GCC, clang, MSVC, MinGW, etc.) When I attempt to compile, I get tcc: x86_64-gen.c:421: load: Assertion `((ft & 0x000f) == 0) || ((ft & 0x000f) == 12) || ((ft & 0x000f) == 4)

Re: [Tinycc-devel] Add new _ISOCxx macros?

2020-01-17 Thread Michael Matz
Hello, On Thu, 16 Jan 2020, Christian Jullien wrote: Pushed on mob. The macros _ISOC99_SOURCE and _ISOC11_SOURCE are requests to enable c99 and c11 features of glibc. They are supposed to come at the request of users and are interpreted by of glibc to set various other macros. They aren

Re: [Tinycc-devel] Broken i386

2020-01-17 Thread Michael Matz
Hi, On Thu, 16 Jan 2020, Giovanni Mascellani wrote: It seems that commit 73afa2b3 by herman ten brugge breaks tests under i386: https://gitlab.com/giomasce/tinycc/-/jobs/405007299 I have no idea of what's going on in that commit, so I cannot help with solving it. The bcheck_123 subtest wa

Re: [Tinycc-devel] Add debug information.

2020-01-19 Thread Michael Matz
e optimized. Can I apply this patch?commit 0d9b48883997b5c93d30155895e6d8e6ca7052c7 Merge: 6cb68c3 949e634 Author: Michael Matz Date: Mon Dec 16 05:39:37 2019 +0100 WIP on mob: 6cb68c3 arm64: fix some casts diff --cc tcc.h index 30f7eb9,30f7eb9..7164a76 --- a/tcc.h +++ b/tcc.h @@@ -148

Re: [Tinycc-devel] standalone backtraces

2020-01-19 Thread Michael Matz
Hi, On Sun, 19 Jan 2020, grischka wrote: Herman ten Brugge wrote: I need only 1. I modified the code. See attached patch. I don't think so. Basically, in tinycc, before you add new code, always try if you can solve the problem by just removing old code first. (Also, please don't make chan

Re: [Tinycc-devel] Buggy commit "Rework expr_landor"

2020-01-27 Thread Michael Matz
Hello, On Mon, 20 Jan 2020, grischka wrote: > > Your last commit breaks something in my bignum library used by OpenLisp. > > > > This library does a lot of logical and bit operations on integers. > > > > Only this last commit generates a core dump as tested on Linux x64 (tcc > > compiled by gcc 9

Re: [Tinycc-devel] Request: __attribute__((vector_size))

2020-01-28 Thread Michael Matz
Hello, On Sun, 26 Jan 2020, Alexander Nicholi wrote: > > Technically it wouldn't be too much work to semantically support that > > How involved would it be? My mainstay with work is writing C, but my > experience with compiler internals is limited. You need a new type category for CType (see t

Re: [Tinycc-devel] Introduce C2X _Static_assert syntax

2020-03-03 Thread Michael Matz
Hello, On Sat, 29 Feb 2020, uso ewin wrote: > Hello, as I was working on fixing _Static_assert bug, > I've saw that it was fairly easy to add C2x _Static_assert > syntax support to tinycc. > > the code is here: https://github.com/cosmo-ray/tcc/commits/static_assert_c2x > > The only difference w

Re: [Tinycc-devel] trouble shooting for arm64-gen.c

2020-03-23 Thread Michael Matz
Hi, On Sun, 22 Mar 2020, Christian Jullien wrote: jullien@rpi64 $ cat print.c #include   struct X { int _x; };   void va_arg_bug(va_list ap) {     void *x = va_arg(ap, struct X *); This is a pointer. jullien@rpi64 $ tcc -c print.c tcc: arm64-gen.c:257: arm64_type_size: Asserti

Re: [Tinycc-devel] error: unknown type size with struct sockaddr_in sa

2020-03-27 Thread Michael Matz
Hello, On Fri, 27 Mar 2020, Julio Carchi wrote: Here is a paste of the config.log file https://pastebin.com/xqmUSKpj Seems that the ./configure script was unable to find the proper paths where are the include files. You seem to miss the glibc-kernel interface headers, e.g. /usr/include/as

Re: [Tinycc-devel] mob is not compiling on osx 10.12

2020-04-10 Thread Michael Matz
Hi, On Sat, 11 Apr 2020, Robert Hölzl wrote: I tried to build the "mob" branch (commit id df67d86) of TCC on macos (10.12) without success. I get the following error message when running "make": ... ../tcc -c bt-exe.c -o ../bt-exe.o -B.. -I.. -D_ANSI_SOURCE In file included from bt-exe.c:6: I

Re: [Tinycc-devel] Obscure local-label related bug

2020-04-14 Thread Michael Matz
Hello, On Tue, 14 Apr 2020, Petr Skocik wrote: I ran into this in some in some macro generated code: int main() {     #if 1 //a workaround     __label__ LBL;     #endif     //jump to a classical label out of an expr-stmt that had previously overshadowed that classical label     ({          {

Re: [Tinycc-devel] macos problems

2020-04-14 Thread Michael Matz
Hi, On Wed, 15 Apr 2020, Robert Hölzl wrote: Hello, I fixed the compilation problems of libtcc1.a on macOS (see commit ID 1803762e3f86aff58d5cce78f7d4faf88e74cc6b). Uh, that breaks stdarg for everyone else on non-windows x86-64 and wouldn't work completely as is on MacOS either. We need t

Re: [Tinycc-devel] /usr/include/syslog.h:68: error: invalid type #24

2020-04-14 Thread Michael Matz
Hello, On Wed, 15 Apr 2020, James Mills wrote: Sorry for the bad subject line; but this is the best I could come up with! I am trying to understand this "invalid type" I keep getting when trying to compile software that wants to pull in syslog.h -- e.g: libressl and most recently I also trie

[Tinycc-devel] stdarg.h overhaul (was: /usr/include/syslog.h:68: error: invalid type)

2020-04-15 Thread Michael Matz
Hello all, On Wed, 15 Apr 2020, Michael Matz wrote: I would appreciate some help understanding this syslog.h "invalid type" problem. I don't quite get it :) FWIW that line references va_list which ... ah, oh, see? :) Hmm, so is TCC's stdarg.h really being included,

Re: [Tinycc-devel] stdarg.h overhaul (was: /usr/include/syslog.h:68: error: invalid type)

2020-04-16 Thread Michael Matz
]: https://github.com/mirror/tinycc/commit/245f6a0d1392a2862a0a1d2f370519 7f92452569 James Mills / prologic E: prolo...@shortcircuit.net.auw: prologic.shortcircuit.net.au On Thu, Apr 16, 2020 at 8:23 AM Steffen Nurpmeso wrote: Michael Matz wrote in :  |On Wed, 15 Apr 2020, Michae

Re: [Tinycc-devel] github

2020-04-21 Thread Michael Matz
Hello, On Sun, 19 Apr 2020, Giovanni Mascellani wrote: TinyCC is great because it supports so much configurations (3 OSes, even more CPU archs). But the downside is, that nobody can ensure that his change wont break any of these configurations. (Probably most of us are testing only on their ow

Re: [Tinycc-devel] github

2020-04-21 Thread Michael Matz
Hello Robert, On Sat, 18 Apr 2020, Robert Hölzl wrote: How about a CI? See also https://gitlab.com/giomasce/tinycc/pipelines . I would be happy to add the corresponding scripts, so that at least windows (x86 and x64), linux (x64) and macos (x64) are tested. I did not investigate yet, but it

Re: [Tinycc-devel] Fwd: Re: github

2020-04-22 Thread Michael Matz
Hello, On Wed, 22 Apr 2020, Daniel Glöckner wrote: I did macOS test with the help of vagrant. You can download any OS from their platform: https://app.vagrantup.com/boxes/search and its very convenient as it automates the generation and integration (ssh connection, shared folders, ...). And a

Re: [Tinycc-devel] -version vs. --version

2020-05-10 Thread Michael Matz
Hello, On Sat, 9 May 2020, Christian Jullien wrote: As minor request, could it be possible to support both -version --version otherwise we have to modify configure.ac which is not always possible on many source packages. Sure, it's a good idea, added to mob. Ciao, Michael. ___

Re: [Tinycc-devel] -version vs. --version

2020-05-11 Thread Michael Matz
v really is verbose, not just a version flag, '-v -h' or '-v --help' should give all help screens, care to cobble up a patch and push it? Ciao, Michael. C. -Original Message- From: Michael Matz [mailto:matz@frakked.de] Sent: Sunday, May 10, 2020 22:58 T

Re: [Tinycc-devel] Debugger options: difference output between linux and windows

2020-05-15 Thread Michael Matz
Hello, On Fri, 15 May 2020, Massimo Sala wrote: * linux:   -DLUA_USE_LINUX -g -b    lua -v    bcheck.c __bound_ptr_add: 0x7fffe66f is outside of the region    bcheck.c bound_error: invalid pointer    /opt/packages/tcc.sh: line 49: 19914 Segmentation fault      ./lua -v From the output I ca

Re: [Tinycc-devel] busybox for win32

2020-05-15 Thread Michael Matz
Hello, On Tue, 12 May 2020, grischka wrote: It contains a busybox-w32 from https://frippery.org/busybox/ as well as a gnu-make, both in source form. Included 'makebox.bat' converts these to binaries with the aid of the above mentioned tcc. Nice! To get started there is a little shell menu

Re: [Tinycc-devel] Thumb2 codegen ready for review

2020-05-25 Thread Michael Matz
Hello, On Mon, 25 May 2020, Erlend Sveen wrote: Yeah, it is probably best to drop that test unless there is a way to make a smaller version of it that would still be useful, if the test makes sense from a codegen perspective at all. Maybe if it is fine as long as it passes for x86 or somethi

Re: [Tinycc-devel] riscv64 feedback

2020-05-26 Thread Michael Matz
Hello, On Tue, 26 May 2020, Christian Jullien wrote: Tcc is configured with: ./configure --with-selinux Does it work without selinux? I've not tried that for riscv, my qemu userspace (debian) isn't selinux enabled, and as the symptom you see is related to mapping executable memory that mig

Re: [Tinycc-devel] error: Unknown relocation type for got: 23 with -static

2020-06-03 Thread Michael Matz
Hello, On Sun, 31 May 2020, Christian Jullien wrote: I confirm! I tested this sample with mod on Debian RPi 4 armv7l and had a similar error: $ tcc -static foo.c tcc: error: Unknown relocation type for got: 107 This, as well as Scotts problem, are relocations for thread local storage. Sever

Re: [Tinycc-devel] arraystring, a simple C program which doesn't compile

2020-06-03 Thread Michael Matz
Hello, On Sat, 30 May 2020, Patrick Hammer wrote: #include #define abc "abc" int main(void) {     char a[2] = { abc[0], 0 };     puts(a);     return 0; } Output: arraystring.c:6: warning: initializer-string for array is too long arraystring.c:6: error: '}' expected (got "[") Interestingly t

Re: [Tinycc-devel] stringify, another simple C program which doesn't compile

2020-06-03 Thread Michael Matz
Hello, On Sat, 30 May 2020, Patrick Hammer wrote: Hi! The second program also works with Clang, gcc etc., but not with tcc. It tries to use stringification with a backslash, indirectly: #include #define PRINT_(X) puts(#X); #define PRINT(X) PRINT_(X) int main(void) {     PRINT(\\)     return

Re: [Tinycc-devel] Building Tor with tcc dynamically [was: error: Unknown relocation type for got: 23 with -static]

2020-06-05 Thread Michael Matz
Hello John, On Wed, 3 Jun 2020, John Scott wrote: On Wednesday, June 3, 2020 11:16:03 AM EDT Michael Matz wrote: Why is it not recommended? Because it is not well supported or just because shared lib, by ideology, is generally preferred? I think the comment is indeed about the general

Re: [Tinycc-devel] arraystring, a simple C program which doesn't compile

2020-06-20 Thread Michael Matz
Hello, On Wed, 3 Jun 2020, Michael Matz wrote: int main(void) {     char a[2] = { abc[0], 0 };     puts(a);     return 0; } Output: arraystring.c:6: warning: initializer-string for array is too long arraystring.c:6: error: '}' expected (got "[") Interestingl

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

2020-06-20 Thread Michael Matz
Hello, On Tue, 16 Jun 2020, Christian Jullien wrote: Hi, it looks new and I’ve not tested this solution but it may help to finally get a native tcc port on macOS. Image is around 200Gb I've just pushed my macos port to mob. It's lightly tested but seems to work reasonably well, the testsuit

Re: [Tinycc-devel] Major issue with current macos port. clang and tcc .o are not compatible

2020-06-23 Thread Michael Matz
Hello Christian, On Tue, 23 Jun 2020, Christian Jullien wrote: As suspected, I have a proof that current version does not allow to mix clang and tcc objects (which is of course a big issue). Well, of course, that's exactly the same as if someone tried to do similar things on Windows, the .o

Re: [Tinycc-devel] Major issue with current macos port. clang and tcc .o are not compatible

2020-06-23 Thread Michael Matz
Hello, On Tue, 23 Jun 2020, Christian Jullien wrote: I agree that it is the same on Windows however on macOS and more generally on unix systems it is not uncommon to have components shipped as static libs (.a). While I never copy .o I very often use .a installed on my system. Baeh, static

Re: [Tinycc-devel] Regression building GMP with tcc, bisected

2020-07-06 Thread Michael Matz
Hello Herman, On Mon, 6 Jul 2020, Herman ten Brugge via Tinycc-devel wrote: Patch below should fix the problem on mob. I can commit it if it works for you. Please find a different way, without strcmp in next_nomacro1. In principle it shouldn't matter how the file is named, and if the cmdlin

Re: [Tinycc-devel] Regression building GMP with tcc, bisected

2020-07-06 Thread Michael Matz
Hello, On Mon, 6 Jul 2020, Herman ten Brugge wrote: In the old code you can also make it fail: tst.s: -     .data     .globl  foo     .long   0 foo     .byte   0 - If you compile it in the old compiler with: tcc -include tst.s -c

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-08 Thread Michael Matz
Hello, On Wed, 8 Jul 2020, Christian Jullien wrote: It is still unclear why it does not work but on macOS, ./configure –disable-static Now raises an error: hello-exe === recurse /Users/jullien/tinycc/tests/.. === dyld: Library not loaded: libtcc.dylib   Referenced

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Michael Matz
mage not found /bin/sh: line 1: 62220 Abort trap: 6 ../tcc -vv + ldd ../tcc /bin/sh: ldd: command not found + exit 1 make[2]: *** [hello-exe] Error 1 make[1]: *** [all] Error 2 make: *** [test] Error 2 -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=oran

Re: [Tinycc-devel] Tiny c availability

2020-07-09 Thread Michael Matz
Hello, On Thu, 9 Jul 2020, arn...@skeeve.com wrote: I compile gawk with it all the time and gawk passes its test suite. I use it mainly when I want a quick build to test something. My big wish for tcc is that it'd produce debug info for use with GDB. Recent mob has some changes that make tcc

Re: [Tinycc-devel] macos: DYLD_LIBRARY_PATH no longer works after cleanup

2020-07-09 Thread Michael Matz
Hello Christian, (I missed the question earlier, apologies) On Thu, 9 Jul 2020, Christian Jullien wrote: If you have a moment, can you please test if my macos fix for dyld also works on your configuration? Yes, it works fine here on my emulated macOS. Ciao, Michael. __

Re: [Tinycc-devel] [issue] macos: tcc cannot self-host with --disable-static

2020-07-13 Thread Michael Matz
Hello, On Fri, 10 Jul 2020, Christian Jullien wrote: Thank you for testing the different configure options on macos. I can easily fix this but it will fail later. I'm not sure that tcc is currently able to generate .dylib It's not, and even if it were I wouldn't want to support the complete

Re: [Tinycc-devel] missing dlfcn.h but defined in tcclib.h, also missing RTLD_LOCAL

2020-07-15 Thread Michael Matz
Hello, On Tue, 14 Jul 2020, UnknownGamer40464 wrote: I see. I had assumed it was for unix compatibility but I guess not. Is it supposed to show up in the win32 tcclib.h file then? tcclib.h is a small convenience header that exists merely to show how a minimal installation on unix-like syste

Re: [Tinycc-devel] aarch64: wrong constant values for float.h

2020-07-15 Thread Michael Matz
Hello, On Wed, 15 Jul 2020, Christian JULLIEN wrote: I think that float.h should be modified accordingly, is it Ok? Yes, as the aarch64 backend indeed uses the IEEE float128 for long double. (what are the risc-v values) Same as on aarch64. Ciao, Michael. ___

Re: [Tinycc-devel] aarch64: subnormal double to long double conversion bug

2020-07-15 Thread Michael Matz
Hello, On Wed, 15 Jul 2020, Vincent Lefevre wrote: With TCC mob on aarch64, the double to long double conversion is buggy on subnormal values. This makes a MPFR test fail (reported by Christian Jullien). Thanks for the report, it was indeed unhandled in the support routines. I fixed this in

Re: [Tinycc-devel] function pointer problem on x86_64/macos/riscv

2020-07-16 Thread Michael Matz
Hello, On Thu, 16 Jul 2020, Herman ten Brugge via Tinycc-devel wrote: While testing gmp on the x86_64 target I discovered a fuction pointer bug. (reuse in directory tests/mpf) The code: #include typedef int (*func) (int); func allfunc[] = { putchar }; int main(void) {   printf ("%d\n", all

Re: [Tinycc-devel] compare problem on riscv target

2020-07-16 Thread Michael Matz
Hello, On Thu, 16 Jul 2020, Herman ten Brugge via Tinycc-devel wrote: While testing gmp on the riscv target I discovered a compare bug. (t-get_d test fails in directory tests/mpq) The code: #include int tst(void) {   long value = 3;   return -value; } int main(void) {   printf ("%d\n", tst

[Tinycc-devel] attribute alias handling and Windows testing request

2020-09-30 Thread Michael Matz
Hello, I just pushed a change to reinstate proper handling of the alias attribute (352e1d0f). It affects targets with different symbol leading underscore conventions, some of which I can't properly test, namely Windows. Can someone do this for me please? Thanks in advance. (The commit giv

Re: [Tinycc-devel] attribute alias handling and Windows testing request

2020-10-01 Thread Michael Matz
. --- 120_alias.expect 2020-10-01 16:27:18.0 +0200 +++ 120_alias.output 1970-01-01 01:00:00.0 +0100 Le : 30 septembre 2020 à 18:07 (GMT +02:00) De : "Michael Matz" À : "tinycc-devel@nongnu.org" Objet : [Tinycc-devel] attribute ali

Re: [Tinycc-devel] How do you specify code model?

2020-11-06 Thread Michael Matz
Hello, On Thu, 5 Nov 2020, Somchai Smythe wrote: With gcc and clang, I specify the AMD64 large code model with -mcmodel=large but that doesn't seem to work for tcc. What is the right way to do that on tcc? tcc only supports the normal ("small") code model, so there's no way to specify a dif

Re: [Tinycc-devel] How do you specify code model?

2020-11-09 Thread Michael Matz
Hello, On Mon, 9 Nov 2020, Somchai Smythe wrote: I guess it's documented somewhere, and I tried to find out that way, but failed. I looked in the tcc git root directory README file, the man page, the TODO, the wikipedia page https://en.wikipedia.org/wiki/Tiny_C_Compiler, https://bellard.org/tc

Re: [Tinycc-devel] Building sudo?

2020-11-18 Thread Michael Matz
Hello, On Tue, 17 Nov 2020, James Mills wrote: Hi guys, Tried to build sudo with tcc and it fails with: libtool: link: (cd .libs/sudoers.lax/libparsesudoers.a && ar x"/usr/ports/sudo/build/src/sudo-1.9.3p1/plugins/sudoers/./.libs/libparsesud oers.a") usage: tcc -ar [rcsv] lib file... create l

Re: [Tinycc-devel] Building sudo?

2020-11-20 Thread Michael Matz
n tcc -ar. It's may for instance be possible to build binutils (at least parts of it) with tcc, then you would have a capable 'ar' program available. Ciao, Michael. cheers James James Mills / prologic E: prolo...@shortcircuit.net.auw: prologic.shortcircuit.net.au Blog:  R

Re: [Tinycc-devel] struct bug: identical named struct members

2020-11-27 Thread Michael Matz
Hello, On Fri, 27 Nov 2020, Tyge Løvset wrote: Is this a known bug, or regression?  Known bug. I tried to follow the code in parse_btype() in tccgen.c for the missing struct member symbol lookup check, but didn't succeed so far:       } else {             c = 0;             flexible = 0;  

Re: [Tinycc-devel] struct bug: identical named struct members

2020-11-28 Thread Michael Matz
source base :) Ciao, Michael. I do have some compiler tech experience way back from creating an external syntax checker for www.autoitscript.com, using flex and yacc. (http://www.google.com/search?q=au3check) Cheers, Tyge On Sat, 28 Nov 2020 at 00:32, Michael Matz wrote: Hello, O

Re: [Tinycc-devel] struct bug: identical named struct members

2020-11-28 Thread Michael Matz
Hello again, On Sun, 29 Nov 2020, Michael Matz wrote: The only other fast C map I know of is khash (https://attractivechaos.github.io/klib), however not memory efficient, and the codebase is somewhat bigger. I guess there as many map implementations as there are C developers :-) Though

Re: [Tinycc-devel] struct bug: identical named struct members

2020-11-29 Thread Michael Matz
able) :) Ciao, Michael. Cheers. Tyge. On Sun, 29 Nov 2020 at 00:16, Michael Matz wrote: Hello again, On Sun, 29 Nov 2020, Michael Matz wrote: >>  The only other fast C map I know >>  of is khash (https://attractivechaos.github.io/klib), however not mem

Re: [Tinycc-devel] Multiple, threaded LibTCC states

2020-12-05 Thread Michael Matz
Hello, On Thu, 3 Dec 2020, Jonathan Levi wrote: I am using LibTCC to compile runtime defined functions for a rendering layer of a project of mine.  I compile many of these functions in parallel.  LibTCC is crashing with exit code -11, at what appears to be when execution is passed to LibTCC on

Re: [Tinycc-devel] A possible bug in TCC

2020-12-14 Thread Michael Matz
Hello, On Sun, 13 Dec 2020, Anton Shepelev wrote: Vincent Lefevre: No issue with tcc 0.9.27+git20200814.62c30a4a-1 provided by Debian. The bug on my side is reproduced with this version just five days old: https://repo.or.cz/tinycc.git/snapshot/8ff705554de47f16726ec5f1a6c49a162b926732.z

Re: [Tinycc-devel] Anyone else working with the RISC-V port?

2020-12-20 Thread Michael Matz
Hello, On Sat, 19 Dec 2020, Charles Lohr wrote: I am interested in doing a project using TinyCC, a web-based IDE for the ESP32-C3, a wifi-enabled microcontroller.  https://github.com/cnlohr/espwebc3/blob/main/README.md I spent a while trying to decipher riscv-gen, and it's actually not that ba

Re: [Tinycc-devel] Hello and a few questions about using libtcc

2020-12-20 Thread Michael Matz
Hello, In addition to the answers already given by Kyryl: On Sun, 20 Dec 2020, Joshua Scholar wrote: Now questions about generated code.  The jit I'm hoping to make is for a language that's embarrassingly parallel, so I need to know how the generated code works with threads and stacks and cont

Re: [Tinycc-devel] Anyone else working with the RISC-V port?

2020-12-20 Thread Michael Matz
o, Michael. C. -Original Message- From: Tinycc-devel [mailto:tinycc-devel-bounces+eligis=orange...@nongnu.org] On Behalf Of Michael Matz Sent: Sunday, December 20, 2020 23:41 To: tinycc-devel@nongnu.org Subject: Re: [Tinycc-devel] Anyone else working with the RISC-V port? Hello, On Sat, 1

Re: [Tinycc-devel] Problem with NOTE commit

2020-12-24 Thread Michael Matz
Hello, On Thu, 24 Dec 2020, Herman ten Brugge via Tinycc-devel wrote: The recent commit 'ELF: include SHT_NOTE sections everywhere' does not work for me on x86_64. The problem is in /usr/lib64/crt1.o If I do: readelf -a -W /usr/lib64/crt1.o | grep .gnu.build.attributes.hot I get:   [64] .gnu.

Re: [Tinycc-devel] Hello and a few questions about using libtcc

2020-12-24 Thread Michael Matz
Hello, On Sun, 20 Dec 2020, Joshua Scholar wrote: 4) If I did something weird like have a call out from generated code to my code, and my code returned on the same stack but in the context of a different thread than it entered from, would that break anything? No. Or, perhaps better said, i

Re: [Tinycc-devel] tinycc manpage

2020-12-25 Thread Michael Matz
Hello, On Fri, 25 Dec 2020, Sudipto Mallick wrote: When I compiled a recent version of tinycc from mob, I looked at the source of the manpage. I don't like it. In which sense? tcc.1 is a generated file, it's not supposed to be edited. The source is tcc-doc.texi, i.e. texinfo, via texi2pod

Re: [Tinycc-devel] What is your general workflow in answering to mailing list thread?

2020-12-25 Thread Michael Matz
Hello, On Fri, 25 Dec 2020, Vaidas BoQsc wrote: What is the proper way to quote and reply in a Mailing List? Thanks. I just noticed that instead of replying, I created a new thread. Thank you for asking. Generally the usual netiquette rules should be obeyed, but we don't need to be too obse

Re: [Tinycc-devel] What is your general workflow in answering to mailing list thread?

2020-12-25 Thread Michael Matz
Hello, On Sat, 26 Dec 2020, Michael Matz wrote: c) no top-posting [1], no full-quoting if answering to only some parts, And obviously I could use an email client that asked me that, if I had used something like "[1]" to reference a foot note, and then not actually put in a foot n

Re: [Tinycc-devel] [PATCH 00/16] Add ARM inline assembler

2020-12-27 Thread Michael Matz
Hello Danny, On Sat, 26 Dec 2020, Danny Milosavljevic wrote: This patchset adds an ARM inline assembler. Wonderful! I like the content and the form of presentation :) Cool stuff. Ciao, Michael. ___ Tinycc-devel mailing list Tinycc-devel@nongnu.o

Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc

2021-01-01 Thread Michael Matz
Hello, On Fri, 1 Jan 2021, Christian Jullien wrote: First, happy new year all. To you as well. Porting tcc on *BSD systems raised issues/questions with stddef.h from tcc distrib. First, it contains a mix of definitions coming from both stddef.h and stdint.h IMHO it should only contain what

Re: [Tinycc-devel] issues/questions with stddef.h which comes with tcc

2021-01-01 Thread Michael Matz
Hello, On Fri, 1 Jan 2021, Joshua Scholar wrote: I noticed that in the win32 directory there are 46 include files in the main include directory, 9 in include/sys, there's a secure api directory with 12 files, an a libtcc directory with an include file and a def file.. but the include directory

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-03 Thread Michael Matz
Hello, On Mon, 4 Jan 2021, Vincent Lefevre wrote: - #include #include #include int main(int argc, char **argv) { double d = strtod("-nan", NULL); d = -d; printf("%g, signbit(d) = %d\n", d, signbit(d)); return 0; } -

Re: [Tinycc-devel] arm-asm: Test script

2021-01-03 Thread Michael Matz
Hello, On Sun, 3 Jan 2021, Danny Milosavljevic wrote: Updated test script for all of this (should I also commit this? Where?): Yeah, put it into tests/ I'd say. The x86 assembler also has a little testfile in there that isn't used by default (as it shows a few differences between GNU as a

Re: [Tinycc-devel] x86_64 tcc doesn't set sign bit on NaNs

2021-01-04 Thread Michael Matz
Hello, On Mon, 4 Jan 2021, Christian Jullien wrote: Also on OpenBSD x64 with clang 10 Bah. I could fix this generically with using signbit(3) to check for the required sign flip, but I'm not sure how widespread it's availability or correctnes is on other platforms. So Hermans disabling f

<    1   2   3   4   5   6   >