Re: [Tinycc-devel] Report - A decying support for Windows 2000 Professional SP4

2020-12-01 Thread Austin English
On Tue, Dec 1, 2020, 12:16 Kyryl Melekhin  wrote:

> Can't you just implement that function (strtoui64) in tcc's source code
> instead of using the crt version? Or at least make a dummy function with
> this symbol and you should be able to compile
>

It's for a 20 year old OS. Whoever cares should do it rather than asking
others to support ancient abandonware.

>
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


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

2020-04-22 Thread Austin English
On Wed, Apr 22, 2020 at 11:35 AM Michael Matz  wrote:

> 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 as it is a VM it is 100% macOS (no emulation with its quirks)
> >
> > The thing is that the macOS license AFAIK allows the use only on Apple
> > hardware. There is no "official" macOS VM on Vagrant. All macOS VMs you
> > can find on Vagrant have been provided by users.
>
> Yeah, thought so.  But darling might be a way indeed (haven't yet looked
> at it, but if the low-level userspace is complete enough, and it must be
> from what they claim to be able to run, it should be enough for tinycc).
>
> (But I didn't know about the other macos possibilities either, so thanks
> for the info)
>

Travis-CI integrates with github well, and supports linux and osx (no
windows though):
https://docs.travis-ci.com/user/multi-os/


-- 
-Austin
GPG: 267B CC1F 053F 0749 (expires 2021/02/18)
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Tinycc-devel Digest, Vol 192, Issue 12

2019-05-20 Thread Austin English
On Mon, May 20, 2019 at 3:09 PM Ben Hutchinson  wrote:

> Date: Sun, 19 May 2019 01:11:26 +0200
>> From: Daniel Gl?ckner 
>>
>> If you don't need __chkstk, you are not compiling for Windows and should
>> not use a TinyCC that is targetting Windows. TinyCC targetting Linux does
>> not emit calls to __chkstk.
>>
>>
>>
> Not quite true. Assembly language is my starting point for learning
> low-level x86 programming. I have used NASM and FASM to compile windows
> programs from assembly code. Neither of these assemblers output any calls
> to stack check functions in addition to your actual program code. I've
> never had any problem with programs I've written in assembly regarding the
> stack. The nice thing about assembly is it only outputs what you tell it
> to. It doesn't add any calls to other functions that you didn't explicitly
> tell it to. However, due to the extremely low-level nature of programming
> in assembly, it takes a lot of code to do simple tasks.
>
> This is why I want to upgrade to C to do my low-level programming. Making
> loops and other useful code structures is very easy in C, compared to
> assembly. However the problem with C is that depending on the compiler you
> use, it can insert additional code (usually in the form of various checks)
> into your program that you didn't explicitly tell it to.
>
> Therefore, I have been on a quest, looking for a C compiler which does NOT
> generate code that you didn't explicitly tell it to. I thought I had found
> what I was looking for, when I discovered TinyCC. To get it to perform as
> expected, I always use the command line switch -nostdlib and also use the
> entry point "_start" rather than using "main" function that most C
> programmers use. This forces it to not insert additional initialization
> functions in my program, and instead start by executing the code I tell it
> to. This for the most part causes TinyCC to ONLY do what I tell it to.
>
> But there is ONE POINT TinyCC fails on. This is its insertion of the
> __chkstk function. At first I thought since TinyCC was so small that it was
> too small to have any code to generate unnececary code. But that is clearly
> not the case. It seems it easily is capable of defying the programmer's
> wishes. Even worse, as of me writing this, there is no command-line switch
> that disables TinyCC's generation of __chkstk. That makes TinyCC a bad C
> compiler.
>
> For me, a good C compiler is one that:
> 1) Uses all of the official C syntax (not a language that is an
> alternative to C)
> 2) Generates machine code in response to the C code that I supply in the
> source code
> 3) Does not generate machine code that I do not instruct it to
> 4) If by default it generates extra code, then it has a command line
> switch to disable this
>
> TinyCC is good for the first 2 of these points. However, it fails on the
> last 2 of these points. That right there means it is a no-go for me. Unless
> of course the officials who are programming TinyCC wish to fix point-4, and
> actually provide a command line switch that allows you to force TinyCC to
> ONLY output explicitly what you tell it to (which means no stuff like calls
> to __chkstk gets inserted into the code).
>
> Keep in mind I'm not asking the devs to completely remove from TinyCC the
> generation of code that calls __chkstk. I'm just asking them to add a
> command-line switch that would allow somebody to start TinyCC in a mode
> where it didn't add these checks to the code.
>
> If the official TinyCC developers were to make this one simple change,
> TinyCC would no longer be a no-go for me, and in fact TinyCC would then
> become my primary means to write Windows software.
>

If you're skilled in C, why not submit a patch yourself rather than demand
others do so?

-- 
-Austin
GPG: 267B CC1F 053F 0749 (expires 2021/02/18)
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] spelling

2017-09-24 Thread Austin English
On Sun, Sep 24, 2017 at 8:08 PM, Larry Doolittle
 wrote:
> Friends -
>
> I just committed a patch with 28 spelling fixes to mob.
>
> One word baffled me: in tcc.h I find the comment
> "next related symbol (for fields and anoms)"
> What are anoms?
>
>   - Larry
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Anonymous structs, maybe?

-- 
-Austin
GPG: 14FB D7EA A041 937B

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] plans to 0.9.28

2017-07-26 Thread Austin English
Yes please!

On Wed, Jul 26, 2017 at 5:37 AM, David Mertens  wrote:
> +1
>
> David
>
> On Wed, Jul 26, 2017 at 6:33 AM, Christian JULLIEN  wrote:
>>
>>
>> Hi all,
>>
>>
>> Last December, we where close to release 0.9.28 but more than 6 months
>> later, I see no plans for an imminent 0.9.28 release.
>>
>> I'm fortunate to know how to build tcc on the many machines I use but also
>> see many users trying to use a very old 0.9.27 version.
>>
>> I think it's time to release 0.9.28 and start new dev. on 0.9.29
>>
>>
>> IMHO,
>>
>> - we should decide what we really want to implement before we release
>> 0.9.28 and propose an ETA for implementation
>>
>> - enter a bug fix, validation cycle (no new feature or gratuitous changes)
>>
>> - check all ports (Windows 32/64, Linux x86, x64, arm, Aarch64, more?), I
>> will test all of them
>>
>> - Make 0.9.28
>>
>>
>> Sounds reasonable to you?
>>
>>
>> ___
>> Tinycc-devel mailing list
>> Tinycc-devel@nongnu.org
>> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>>
>
>
>
> --
>  "Debugging is twice as hard as writing the code in the first place.
>   Therefore, if you write the code as cleverly as possible, you are,
>   by definition, not smart enough to debug it." -- Brian Kernighan
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>



-- 
-Austin
GPG: 14FB D7EA A041 937B

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Add support of musl-libc to tinycc

2017-04-25 Thread Austin English
On Mon, Apr 24, 2017 at 10:12 AM, avih  wrote:
> Because you asked so nice, here's a less than 5 minutes guide to get enough
> musl for tcc on Alpine linux, and without any permanent storage:
>
> - Download the "VANILLA" iso (80M) from https://alpinelinux.org/downloads/
> - Boot as live cd in a [V]M with network. No HDD required, 512M ram is
> enough*
>
> - Login as root (no password)
> - "echo \n\n\n | setup-interfaces" (or do manual setup)
> - "ifup eth0"
> - "echo 1 | setup-apkrepos" (or run it directly and choose manually)
> - "apk add build-base git" to get some build deps (but not for the docs)
>
> That's enough to clone the tinycc repo, build it and run the tests, but
> that's
> without the doc tools.
>
> [*] 256M is probably enough if you don't install git, and you might need
> more
> if you add more tools like openssh or vim, or xfce4 etc ;)
>
> Of course, if instead of using it as live cd you to install it someplace
> then 256M should be enough for quite a lot.

While that's helpful if someone wants to reproduce, it doesn't
describe the problem at all.

-- 
-Austin
GPG: 14FB D7EA A041 937B

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Why doesn't this work in TCC?

2017-03-31 Thread Austin English
On Fri, Mar 31, 2017 at 11:59 PM, Ben Hutchinson  wrote:
> I just tried this code:
>
> #include 
> void _start(void){
> HWND wnd;
> HDC dc;
> wnd = 0;
> dc = GetDC(wnd);
> ReleaseDC(wnd,dc);
> ExitProcess(0);
> }
>
>
>
>
> But then when I compiled it, I got this error:
>
> tcc: error: undefined symbol '_GetDC@4'
> tcc: error: undefined symbol '_ReleaseDC@8'
>
>
>
>
> I don't know where it's getting those errors. The windows.h include file is
> supposed to include all the correct definitions of all the Windows API
> functions. And the ones that aren't directly defined in windows.h are
> defined in other include files that windows.h has included in itself (there
> are other #include statements in windows.h). So they should ALL be defined,
> but these 2 very common ones for working with graphics, have either not been
> defined, or have been incorrectly defined (some kind of bug in one of the
> include files).
>
> Can somebody here please tell me exactly why it's not working?
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>

As a starting point, have you tried doing a hello world with just
windows.h included? There very well may be a regression that broke
something that is in windows.h.

-- 
-Austin
GPG: 14FB D7EA A041 937B

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Installation

2016-07-18 Thread Austin English
.sig is used for verification, you want the .bz2 file itself.

Then extract,  ./configure && make && sudo make install

On Jul 18, 2016 1:16 AM, "Niyousha D"  wrote:

> Hello,
>
> I am trying to install tcc-0.9.26.tar.bz2.sig
> ,but
> I have no idea how to do it.
> I am working in Linux, and I'm coding in python, and I want to compile a C
> file in python, that is why I am trying to install this.
>
> This file I already have downloaded. The only issue I have is I don't know
> how to install it.
>
> Could you help me with this?
>
> Thanks,
> Niusha
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>
>
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Trouble on x86-64, not windows, not gcc

2016-07-09 Thread Austin English
On Sat, Jul 9, 2016 at 3:10 PM, David Mertens  wrote:
> Hello everyone,
>
> When run on Mac systems, I get errors about "incompatible redefinition of
> 'va_list'". Looking at the source files involved, I'm pretty sure this
> occurs on x86-64 systems that are neither Windows nor built with gcc. Such
> systems include 64-bit Macs and BSDs using clang. It might also occur on
> Solaris, though I've not received any reports from that system yet.
>
> TCC's handling of variable argument lists are spelled out in stdarg.h, with
> implementation in libtcc1.c. I think that for 64-bit machines, we should
> also check for clang, and then use clang-compatible definitions. I think I
> could just check if __llvm__ and/or __clang__ are defined, and then insert
> the appropriate definitions. Does this sound right? I am a bit out of my
> depth working on such things, so if anybody has any ideas about how to solve
> this, I'm all ears.
>
> I'd be happy to work on a solution, but I don't have access to a Mac machine
> or a BSD system. I'm not interested in going through a full-on BSD
> installation at this time, so if anybody knows where I could find a
> pre-canned BSD virtualbox image with working git and cc, I'd be much
> obliged.
>
> Thanks!
> David
>
> --
>  "Debugging is twice as hard as writing the code in the first place.
>   Therefore, if you write the code as cleverly as possible, you are,
>   by definition, not smart enough to debug it." -- Brian Kernighan
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel
>

You'd want to check for #ifdef __clang__

PC-BSD is easy to get running in virtualbox, and comes with a GUI out
of the box, fyi.

-- 
-Austin
GPG: 14FB D7EA A041 937B

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] tcc build on OSX

2016-04-29 Thread Austin English
On Apr 29, 2016 11:10 PM, "Sergey Korshunoff"  wrote:
>
> > I found it helpful (necessary? I don't remember) to include the
following typedefs when working > with Mac:
>
> How to check a OSX target in *.c code? Any proposal?

#ifdef __APPLE__
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] License is too restrictive for real-world use.

2016-03-02 Thread Austin English
The counterargument is that if they want to be able to lock down their code
while getting the benefits of free software, developers should be able to
prevent that. (L)GPL provides a mechanism.

No one is forcing the code to be used. Make your own implementation, or if
the code is important enough to use, accept its license. It's free with
conditions, if the conditions aren't acceptable, don't take the gift ;)

On Wed, Mar 2, 2016 at 2:00 AM, John B  wrote:

> Hello, thank you for your email.  I didn't want to get into too many
> details since most people are familiar with the license differences.
> However, I am not concerned about to the code that links against it.  I am
> talking about modifying tinycc and linking against a derivative,
> essentially that becoming my code.  Here is a fact of life:  businesses and
> people who want to build a product to sell, they can take out all of the
> copyright protections and licenses and hire the best lawyers all they
> want.  But that pales in comparison to the low low price and effort of
> just keeping everything a trade secret.  lgpl is the opposite of that.  In
> some cases people may not even necessarily want to disclose the use of 3rd
> party code.  People keep secrets when they write proprietary software and
> if that means utilizing an inferior yet more license compatible library, so
> be it.  I am not too sure if my business partner and I care about
> disclosing, but providing source for a derivative is simply non-viable.
> And of course I would want to build a derivative.
>
>
> Hope this helps clarify!  Sorry if the formatting of the email is bad, I
> am using outlook.com and it inserts way too many new lines.
>
> Regards,
> John.
>
> --
> *From:* tinycc-devel-bounces+xienn_us=outlook@nongnu.org
>  on behalf of Nids <
> francesco.nid...@gmail.com>
> *Sent:* Tuesday, March 1, 2016 11:01 PM
> *To:* tinycc-devel@nongnu.org
> *Subject:* Re: [Tinycc-devel] License is too restrictive for real-world
> use.
>
> Ehm... No.
>
> The LGPL just states that when you redistribute your product, the code of
> TinyCC, or its modified version, must be redistributed/made available. The
> same does NOT apply to the code that links against it.
>
> What you are describing is the GPL license and not the LGPL one.
>
> I could be wrong, can you please point me to the part of the license
> stating what you are saying?
>
> Typed on a very small keyboard...
> --
> From: John B 
> Sent: ‎02/‎03/‎2016 06:07
> To: tinycc-devel@nongnu.org
> Subject: [Tinycc-devel] License is too restrictive for real-world use.
>
> Hi,
>
>
> I really love playing around with tinycc for jit-enabled scripting.  There
> are so many applications to this and by far tinycc is the single-most best
> tool for the job that I have so far evaluated.
>
>
> If you evaluate luajit or llvm etc., they can execute code as fast as
> tinycc.  They can call extern C functions just as fast as tinycc.  But
> there is one important criteria for flexible jit scripting that only tinycc
> can do.  No other jit library seems to be able to do this one simple task:
>  Repeatedly call into the compiled script from C in a very tight loop.  So
> your application can define a script and execute it in tinycc or luajit or
> whatever... and each of these can call into your main application (pull)
> very fast.  TinyCC is about the only ultra fast jit in existence that can
> do reverse push calling.  So once you have the compiled object loaded with
> the function pointer returned, you can call it as many times as you want
> without worrying about performance.  It's beautiful, it's useful, it's...
> under lgpl.  It's off-limits.
>
>
> This is important... it let's you build compiled expressions.  You don't
> really need a jit scripting engine for fully fledged procedures or
> algorithms.  I mean you can, but to me it is all about compiled
> expressions.  Almost like say you are building a regex parser.  If you do
> that in other jit implementations, be prepared for your script to pull all
> of the text down otherwise you are going to have a bad time.  TinyCC on the
> other hand, you can parse it wherever you want and just send portions to
> the compiled expression.  TinyCC could own the jit scripting market right
> now.
>
>
> It falls down and becomes completely unusable, all because of it's
> license.  Lgpl is this magical property that turns anything it touches into
> a toy.  I am not independently rich, and I work hard in the hope I can sell
> my software.  That is just the how it is for me.  LPGL prevents me from
> ever touching TinyCC in my code.  And it is a darn shame, because it is
> exactly the library I want to use for scripting and i'll use it in very
> imaginative ways.  I don't want to use LuaJit, but the license tells me
> otherwise.  Luajit is a wonderful tool but it has 

Re: [Tinycc-devel] Time to make a 0.9.27 version?

2016-02-27 Thread Austin English
On Feb 28, 2016 1:22 AM, "Christian Jullien"  wrote:
>
> Hi guys,
>
>
>
> These days, tcc seems to be very stable and I see no big dev/fix coming
soon.
>
> Don’t you think it’s time to make a stable 0.9.27 as official 0.9.26 (
http://download.savannah.gnu.org/releases/tinycc/) is quite old.
>
>
>
> Christian.
>
>
> ___
> Tinycc-devel mailing list
> Tinycc-devel@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Yes, please :)
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] out of the box configuration on x86_64 ubuntu still broken

2015-03-22 Thread Austin English
Works for me on debian 8:
austin@debian-laptop:~/src/tinycc$ file x86_64-tcc
x86_64-tcc: ELF 64-bit LSB executable, x86-64, version 1 (SYSV),
dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux
2.6.32, BuildID[sha1]=0a9841ff39929e7889132b9b95452310b50a9a7d, not stripped

austin@debian-laptop:~/src/tinycc$ uname -a
Linux debian-laptop 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt4-3 (2015-02-03)
x86_64 GNU/Linux

austin@debian-laptop:~/src/tinycc$ git describe
release_0_9_26-420-gaba2d64

austin@debian-laptop:~/src/tinycc$ ls -al tcc
lrwxrwxrwx 1 austin austin 10 Mar 22 19:56 tcc - x86_64-tcc


On Sun, Mar 22, 2015 at 3:37 PM, Sergey Korshunoff sey...@gmail.com wrote:

 I tested it on debian 7 x86_64 and all was OK. What the output of the
 uname -m ?
 There was many messages about building a i386 compiler. But no one
 tell me the output of the uname -m on that systems.

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Latest mob broken in test 66_macro_concat_end

2014-05-28 Thread Austin English
I'm sorry, but I don't understand what you're saying.

Anyway, latest mob builds and passes the tests, thanks for fixing it.


On Wed, May 28, 2014 at 6:17 PM, jiang 30155...@qq.com wrote:

  The gcc compiler is the first line in the wrong for you, then the first
 line error

 jiang

  Send Tinycc-devel mailing list submissions to
   tinycc-devel@nongnu.org

 To subscribe or unsubscribe via the World Wide Web, visit
   https://lists.nongnu.org/mailman/listinfo/tinycc-devel
 or, via email, send a message with subject or body 'help' to
   tinycc-devel-requ...@nongnu.org

 You can reach the person managing the list at
   tinycc-devel-ow...@nongnu.org

 When replying, please edit your Subject line so it is more specific
 than Re: Contents of Tinycc-devel digest...



 Today's Topics:

1. Latest mob broken in test 66_macro_concat_end (Austin English)
2. Re: Include paths (Anton Shepelev)
3. State of the tcc project (Sia Lang)
4. Re: State of the tcc project (Thomas COUDRAY)



 ___
 Tinycc-devel mailing 
 listTinycc-devel@nongnu.orghttps://lists.nongnu.org/mailman/listinfo/tinycc-devel





-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Latest mob broken in test 66_macro_concat_end

2014-05-27 Thread Austin English
Test: 66_macro_concat_end...
--- 66_macro_concat_end.expect2014-04-17 11:23:11.690041027 -0700
+++ 66_macro_concat_end.output2014-05-27 11:09:52.556191608 -0700
@@ -1 +1 @@
-66_macro_concat_end.c:2: error: '##' invalid at end of macro
+66_macro_concat_end.c:1: error: '##' invalid at end of macro
Makefile:108: recipe for target '66_macro_concat_end.test' failed
make[2]: *** [66_macro_concat_end.test] Error 1
make[2]: Leaving directory '/home/austin/src/tinycc/tests/tests2'
Makefile:100: recipe for target 'moretests' failed
make[1]: *** [moretests] Error 2
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:346: recipe for target 'test' failed
make: *** [test] Error 2
austin@aw25 ~/src/tinycc $ uname -a
Linux aw25 3.13.3-gentoo-devlight-1 #1 SMP Thu Feb 20 00:10:55 Local time
zone must be set--see zic  x86_64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz
GenuineIntel GNU/Linux
commit bcf60562e056265d0197bd3765a4d5256e2ca7ec
Author: jiang 30155...@qq.com
Date:   Fri May 23 15:46:08 2014 +0800

The number of rows to display warning is wrong
For example:
#define TOK_ASM_weak TOK_WEAK1
#define TOK_ASM_weak TOK_WEAK
Output:
C8.c:3: warning: TOK_ASM_weak redefined

diff --git a/libtcc.c b/libtcc.c
index dc01831..721eaed 100644
--- a/libtcc.c
+++ b/libtcc.c
@@ -576,12 +576,15 @@ static void error1(TCCState *s1, int is_warning,
const char *fmt, va_list ap)
 for (f = file; f  f-filename[0] == ':'; f = f-prev)
  ;
 if (f) {
+int line_num = f-line_num;
 for(pf = s1-include_stack; pf  s1-include_stack_ptr; pf++)
 strcat_printf(buf, sizeof(buf), In file included from
%s:%d:\n,
 (*pf)-filename, (*pf)-line_num);
-if (f-line_num  0) {
+if (line_num  0) {
+if(tok == TOK_LINEFEED)
+line_num--;
 strcat_printf(buf, sizeof(buf), %s:%d: ,
-f-filename, f-line_num);
+f-filename, line_num);
 } else {
 strcat_printf(buf, sizeof(buf), %s: ,
 f-filename);


-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] regression in commit: Delete a = (a = 0)? A: -a; \ (3d608d)

2014-05-20 Thread Austin English
 test3 
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\
-DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include
-DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c
-B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64
-DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -run tcctest.c 
test.out3
unknown ABI type for __va_arg
/bin/sh: line 1: 10578 Aborted ../tcc -B.. -I.. -I..
-I../include -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -DONE_SOURCE
-run ../tcc.c -B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\
-DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include
-DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c
-B.. -I.. -I.. -I../include -run tcctest.c  test.out3
Makefile:125: recipe for target 'test3' failed
make[1]: *** [test3] Error 134
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:346: recipe for target 'test' failed
make: *** [test] Error 2

introduced by:
austin@aw25 ~/src/tinycc $ git bisect good
3d608d4b54edfdd9f394f06d2be0741387ac733a is the first bad commit
commit 3d608d4b54edfdd9f394f06d2be0741387ac733a
Author: jiang 30155...@qq.com
Date:   Tue May 20 15:23:55 2014 +0800

Delete a = (a  = 0)? A: -a; \

:04 04 e518d7116b885872b994a7c3ffc19929d8618080
e0991ce02b0c2e34ee665d54c8ac70a72c58f6b4 Mlib
:04 04 666353dbf1ac4150250f9a21f4c68ce2b844b0fa
1dbcb1715e118aae33fff7f7a0787f914af78949 Mtests

x86_64 Gentoo Linux, gcc-4.8.2 used to compile tcc

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Support for hidden symbols?

2014-04-17 Thread Austin English
On Thu, Apr 17, 2014 at 8:17 AM, Michael Matz matz@frakked.de wrote:

 Hi,

 On Sun, 13 Apr 2014, Austin English wrote:

  I expected that wine wouldn't immediately work, I'm doing it for the
  curiosity factor.

 Okay :)

  The next problem is:
  make[1]: Entering directory `/home/austin/src/wine-tcc/dlls/acledit'
  /home/austin/tcc/bin/i386-linux-gnu-tcc -m32 -c -I. -I. -I../../include
  -I../../include  -D__WINESRC__  -D_REENTRANT -fPIC   -g  -o main.o main.c
  ../../tools/winegcc/winegcc -m32 -B../../tools/winebuild --sysroot=../..
  -shared ./acledit.spec main.o   -o acledit.dll.so
  ../../libs/port/libwine_port.a
  acledit.UgAqPb.s:14: error: unknown assembler directive
  '.L__wine_spec_rva_base'

 Yep, tccasm doesn't currently accept the ATT syntax of local labels.
 Well, I could add that as well, but the question will be where to stop?
 wine emits assembler code for an ATT (e.g. the GNU) assembler, and tccasm
 is not such one.  There will be many more things missing.  All the .cfi
 directives, section markers, the special syntax for marking operands with
 certain relocations.  It would be easier if you would force wine to use
 the GNU assembler at least for assembler input.  The C sources can then
 still be compiled with TCC (and presumably that's where your couriosity
 lies).


Yes, precisely. clang has -no-integrated-as for this sort of case. I don't
see such an option with tcc, and setting AS doesn't work for wine's build
system.

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Support for hidden symbols?

2014-04-13 Thread Austin English
On Sun, Apr 13, 2014 at 8:22 PM, Michael Matz matz@frakked.de wrote:

 Hi,


 On Sat, 12 Apr 2014, Austin English wrote:

  I recently revisited compiling Wine with TinyCC. I've got some patches for
 wine for that, but my current blocker is a lack of support for hidden
 symbols on tcc:


 Even with that fixed I'll predict some more blockers for wine.  It's not
 exactly one of the most trivial (and C conformant) program packages.  And
 well, wine has some quite performance critical components, so what would be
 the point in compiling it with tcc?  (except for the obvious one of that
 being an intellectually entertaining experiment)

  acledit.pEPjUb.s:14: error: unknown assembler directive '.hidden'


 Okay, so that's supporting (parsing) hidden directive from the assembler
 itself.  While fixing this is easy, you'll hit many more roadblocks in
 actually compiling real assembler sources (the above seems to be something
 emitted by the ../../tools/winegcc/winegcc wrapper).  TCCs included
 assembler really isn't much GAS compatible and misses many more directives.

  /* return a global symbol declaration for an assembly symbol */
 const char *asm_globl( const char *func )
 default:
 buffer = strmake( \t.globl %s\n\t.hidden %s\n%s:, func, func,
 func
 );

 is there any plan for supporting this?


 There are multiple aspects for supporting hidden symbols: 1) parsing the
 above (inline) assembler directives.  2) parsing hidden symbols via
 gcc-compatible visibility attribute.  3) supporting hidden symbol in the
 builtin link editor.  I've done 1) and 2) in the mob branch (e69c506).

 For 3) there's some code that isn't fully working yet.  For x86-64 I've at
 least implemented correct resolutions of calls to hidden functions.  I
 haven't yet implemented the other archs or correctly handling hidden data
 symbols.  The latter will simply be emitted as non-hidden global symbols
 (even if they were hidden in the input .o files) right now.

 grischka: the PE port uses the st_other member of ELF symbols for tracking
 its own IMPORT/EXPORT directives.  As I'm now using it for symbol
 visibility (with values 0-3) this might clash: using visibility attribute
 might overwrite former IMPORT/EXPORT directives, and using IMPORT/EXPORT
 might influence the ELF linker (as it will now make more use of
 visibility).  I lack the necessary pieces to check on windows.  If there's
 indeed an interaction (I can't quite figure that out from just reading the
 code) but the PE port wants to continue using the st_other member (and not
 the TCC symbols type) I would guess it's best to use bits outside of mask
 ELFXX_ST_VISIBILITY (0x3).

 The COFF port (used for C67) is now a bit more broken than before.  It
 uses st_other for debug type info (ugh!).  Is anyone even working on that?
 Time to remove it maybe?


 Ciao,
 Michael.
 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel


I expected that wine wouldn't immediately work, I'm doing it for the
curiosity factor.

The next problem is:
make[1]: Entering directory `/home/austin/src/wine-tcc/dlls/acledit'
/home/austin/tcc/bin/i386-linux-gnu-tcc -m32 -c -I. -I. -I../../include
-I../../include  -D__WINESRC__  -D_REENTRANT -fPIC   -g  -o main.o main.c
../../tools/winegcc/winegcc -m32 -B../../tools/winebuild --sysroot=../..
-shared ./acledit.spec main.o   -o acledit.dll.so
../../libs/port/libwine_port.a
acledit.UgAqPb.s:14: error: unknown assembler directive
'.L__wine_spec_rva_base'
winebuild: /home/austin/tcc/bin/i386-linux-gnu-tcc failed with status 1
winegcc: ../../tools/winebuild/winebuild failed
make[1]: *** [acledit.dll.so] Error 2


-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Support for hidden symbols?

2014-04-12 Thread Austin English
Howdy,

I recently revisited compiling Wine with TinyCC. I've got some patches for
wine for that, but my current blocker is a lack of support for hidden
symbols on tcc:
make[1]: Entering directory `/home/austin/src/wine-tcc/dlls/acledit'
/home/austin/tcc/bin/i386-linux-gnu-tcc -m32 -c -I. -I. -I../../include
-I../../include  -D__WINESRC__  -D_REENTRANT -fPIC   -g  -o main.o main.c
../../tools/winegcc/winegcc -m32 -B../../tools/winebuild --sysroot=../..
-shared ./acledit.spec main.o   -o acledit.dll.so
../../libs/port/libwine_port.a
acledit.pEPjUb.s:14: error: unknown assembler directive '.hidden'
winebuild: /home/austin/tcc/bin/i386-linux-gnu-tcc failed with status 1
winegcc: ../../tools/winebuild/winebuild failed
make[1]: *** [acledit.dll.so] Error 2
make[1]: Leaving directory `/home/austin/src/wine-tcc/dlls/acledit'
make: *** [dlls/acledit] Error 2

relevant Wine code (tools/winebuild/utils.c):

/* return a global symbol declaration for an assembly symbol */
const char *asm_globl( const char *func )
{
static char *buffer;

free( buffer );
switch (target_platform)
{
case PLATFORM_APPLE:
buffer = strmake( \t.globl _%s\n\t.private_extern _%s\n_%s:,
func, func, func );
break;
case PLATFORM_WINDOWS:
buffer = strmake( \t.globl _%s\n_%s:, func, func );
break;
default:
buffer = strmake( \t.globl %s\n\t.hidden %s\n%s:, func, func,
func );
break;
}
return buffer;
}

is there any plan for supporting this?

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Building a single cross-compiler: please test new configure

2014-04-11 Thread Austin English
Using Michael's patch on Gentoo64:
austin@aw25 ~/src/tinycc $  ./configure --targetcpu=i386  make
Binary  directory   /usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc/tcc
Target root prefix
Source path  /home/austin/src/tinycc
C compiler   gcc
Build CPUx86_64
Target CPU   i386
Target OSLinux
Big Endian   no
gprof enabledno
cross compilers  yes
use libgcc   no
Creating config.mak and config.h
gcc -o i386-linux-gnu-tcc tcc.c -DONE_SOURCE -DTCC_TARGET_I386
-DCONFIG_TCCDIR=\/usr/local/lib/tcc/i386\ -I.  -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
-lm -ldl
ln -sf i386-linux-gnu-tcc i386-tcc
ar rcs libtcc.a
make -C lib cross TARGET=i386 PROG_CROSS=i386-linux-gnu-tcc
make[1]: Entering directory '/home/austin/src/tinycc/lib'
mkdir -p i386
../i386-linux-gnu-tcc -B.. -c libtcc1.c -o i386/libtcc1.o -I..  -Wall -g
-O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
-Wno-unused-result -fPIC -DTCC_TARGET_I386
../i386-linux-gnu-tcc -B.. -c alloca86.S -o i386/alloca86.o -I..  -Wall -g
-O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
-Wno-unused-result -fPIC -DTCC_TARGET_I386
../i386-linux-gnu-tcc -B.. -c alloca86-bt.S -o i386/alloca86-bt.o -I..
-Wall -g -O2 -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
-Wno-unused-result -fPIC -DTCC_TARGET_I386
ar rcs i386/libtcc1.a i386/libtcc1.o i386/alloca86.o i386/alloca86-bt.o
make[1]: Leaving directory '/home/austin/src/tinycc/lib'
./texi2pod.pl tcc-doc.texi tcc.pod
pod2man --section=1 --center=Tiny C Compiler --release=`cat ./VERSION`
tcc.pod  tcc.1
makeinfo --no-split --html --number-sections -o tcc-doc.html tcc-doc.texi
makeinfo tcc-doc.texi

it builds fine, but make test fails:

austin@aw25 ~/src/tinycc $ make test
make -C tests test 'PROGS_CROSS=i386-linux-gnu-tcc'
make[1]: Entering directory '/home/austin/src/tinycc/tests'
 hello-exe 
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc
-vv; exit 1)  ./hello
/bin/sh: ../tcc: No such file or directory
/bin/sh: ../tcc: No such file or directory
Makefile:76: recipe for target 'hello-exe' failed
make[1]: *** [hello-exe] Error 1
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:350: recipe for target 'test' failed
make: *** [test] Error 2

not terribly surprising, but let's try symlinking to see if anything works:

austin@aw25 ~/src/tinycc $ ln -s i386-linux-gnu-tcc tcc
austin@aw25 ~/src/tinycc $ make test
make -C tests test 'PROGS_CROSS=i386-linux-gnu-tcc'
make[1]: Entering directory '/home/austin/src/tinycc/tests'
 hello-exe 
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc
-vv; exit 1)  ./hello
/usr/lib/crt1.o: error: invalid object file
tcc: error: file 'crt1.o' not found
/usr/lib/crti.o: error: invalid object file
tcc: error: file 'crti.o' not found
/lib64/libc.so.6: error: bad architecture
/usr/lib/libc.so:3: error: unrecognized file type
/usr/lib/libc.a: error: invalid object file
tcc: error: file '../libtcc1.a' not found
/usr/lib/crtn.o: error: invalid object file
tcc: error: file 'crtn.o' not found
tcc: error: undefined symbol 'printf'
tcc version 0.9.26 (i386 Linux)
install: /usr/local/lib/tcc/i386/
crt:
  /usr/lib
libraries:
  /usr/lib
  /lib
  /usr/local/lib
include:
  /usr/local/include
  /usr/include
  /usr/local/lib/tcc/i386/include
elfinterp:
  /lib/ld-linux.so.2
Makefile:76: recipe for target 'hello-exe' failed
make[1]: *** [hello-exe] Error 1
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:350: recipe for target 'test' failed
make: *** [test] Error 2

and indeed, trying to do anything with the compiler fails:
austin@aw25 ~ $ cat foo.c
#include stdio.h
int main(void)
{
 return 0;
}
austin@aw25 ~ $ gcc -o a foo.c ; ./a ; echo $?
0
austin@aw25 ~ $ clang -o a foo.c ; ./a ; echo $?
0
austin@aw25 ~ $ ~/src/tinycc/i386-tcc -o a foo.c ;  ./a ; echo $?
/usr/lib/crt1.o: error: invalid object file
tcc: error: file 'crt1.o' not found
/usr/lib/crti.o: error: invalid object file
tcc: error: file 'crti.o' not found
In file included from foo.c:1:
/usr/include/stdio.h:33: error: include file 'stddef.h' not found
0

32-bit libs are in /lib32 /usr/lib32


On Thu, Apr 10, 2014 at 9:01 AM, Michael Matz matz@frakked.de wrote:

 Hello Thomas,

 On Wed, 9 Apr 2014, Thomas Preud'homme wrote:

  I have a patch to build a single cross-compiler by using --targetcpu but
  given the potential of breakage of the build script I prefer to post it
  here for now and ask you to try building tcc with it, either natively or
  all the cross compilers to see if anything break.
 
  You can also try building a single compiler to see if it works for you
  or take a look at the patch. Any feedback welcome.

 

Re: [Tinycc-devel] tcc 0.9.26 cannot build mob on x86_64 linux (regression)

2014-03-19 Thread Austin English
On Wed, Mar 19, 2014 at 7:03 AM, Thomas Preud'homme robo...@celest.frwrote:

 Le mardi 18 mars 2014 11:12:42, vous avez écrit :
  Introduced by
  6ed6a36a51065060bd5e9bb516b85ff796e05f30 and
  c68af2db9d497fd8229162bc23b9679fc2e1fc8b
 
  build@build ~/linux_x86_64-tcc $ make
  tcc -o tcc.o -c tcc.c -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -I.
  -Wall -g -O2
  tcc -o libtcc.o -c libtcc.c -DCONFIG_LDDIR=\lib64\
 -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o tccpp.o -c tccpp.c -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o tccgen.o -c tccgen.c -DCONFIG_LDDIR=\lib64\
 -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o tccelf.o -c tccelf.c -DCONFIG_LDDIR=\lib64\
 -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o tccasm.o -c tccasm.c -DCONFIG_LDDIR=\lib64\
 -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o tccrun.o -c tccrun.c -DCONFIG_LDDIR=\lib64\
 -DTCC_TARGET_X86_64
  -I.  -Wall -g -O2
  tcc -o x86_64-gen.o -c x86_64-gen.c -DCONFIG_LDDIR=\lib64\
  -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
  tcc -o i386-asm.o -c i386-asm.c -DCONFIG_LDDIR=\lib64\
  -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
  ar rcs libtcc.a libtcc.o tccpp.o tccgen.o tccelf.o tccasm.o tccrun.o
  x86_64-gen.o i386-asm.o
  tcc -o tcc tcc.o libtcc.a -lm -ldl -I.  -Wall -g -O2
  tcc: error: undefined symbol '__clear_cache'
  make: *** [tcc] Error 1
  build@build ~/linux_x86_64-tcc $ tcc -version
  tcc version 0.9.26 (x86-64 Linux)
  build@build ~/linux_x86_64-tcc $ uname -a
  Linux build 3.10.33-gentoo #1 SMP Mon Mar 10 21:17:28 Local time zone
 must
  be set--see zic  x86_64 Intel(R) Xeon(R) CPU E5620 @ 2.40GHz GenuineIntel
  GNU/Linux
  build@build ~/linux_x86_64-tcc $ git describe
  release_0_9_26-166-g40e3859

 __clear_cache comes from the host compiler. Here you compiled tcc with an
 old
 tcc that didn't have __clear_cache. Try first compiling tcc with gcc and
 then
 you can compile tcc with itself.

 Best regards,

 Thomas


Yes, that works, thanks. I've been working on a test using tcc to try
compiling all packages on my gentoo system (after testing with gcc/clang).
tcc has been recompiling/reinstalled a few times in that process, which
lead to the breakage.

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] tcc compile broken with clang-3.3 (regression from 0.9.26)

2014-03-09 Thread Austin English
On Sun, Mar 9, 2014 at 10:24 AM, Thomas Preud'homme robo...@celest.frwrote:

 Le dimanche 9 mars 2014, 01:29:30 Austin English a écrit :
  It broke between 0.9.25 and 0.9.26. Introduced by:
  7a477d70cabe15fa66fd0f32fab5e95841a500e5 is the first bad commit
  commit 7a477d70cabe15fa66fd0f32fab5e95841a500e5
  Author: grischka grischka
  Date:   Wed Feb 6 19:01:07 2013 +0100
 
  lib/Makefile: use CC, add bcheck to libtcc1.a
 
  Also:
  - fix make tcc_p (profiling version)
  - remove old gcc flags:
-mpreferred-stack-boundary=2 -march=i386 -falign-functions=0
  - remove test hello for Darwin (cannot compile to file)
 
  [austin@localhost tinycc]$ git describe
  release_0_9_26-158-gfdb3b10
 
  clang -c libtcc1.c -o x86_64/libtcc1.o -I..  -Wall -g -O2
  -fheinous-gnu-extensions -DTCC_TARGET_X86_64
  libtcc1.c:697:45: error: too few arguments provided to function-like
 macro
  invocation
  void *__va_copy(struct __va_list_struct *src)
  ^
  /usr/bin/../lib/clang/3.3/include/stdarg.h:40:9: note: macro '__va_copy'
  defined here
  #define __va_copy(d,s) __builtin_va_copy(d,s)
  ^
  libtcc1.c:697:16: error: expected ';' after top level declarator
  void *__va_copy(struct __va_list_struct *src)
 ^
 ;
  2 errors generated.
  make[1]: *** [x86_64/libtcc1.o] Error 1

 Fixed. But there is another error with __clear_cache being defined and I
 don't
 know how to solve this. Why isn't this just a warning?

 Best regards,

 Thomas


Works, and passes make test, thanks.

I don't get that warning. With release_0_9_26-164-gd3d8990, I get two
warnings:
clang -o tccasm.o -c tccasm.c -DCONFIG_LDDIR=\lib64\
-DTCC_TARGET_X86_64 -I.  -Wall -g -O2 -fheinous-gnu-extensions
tccasm.c:541:72: warning: data argument not used by format string
[-Wformat-extra-args]
sprintf(sname, (n?.%s%d:.%s), get_tok_str(tok1, NULL), n);
  ~^
..
clang -o tcc tcc.o libtcc.a -lm -ldl -I.  -Wall -g -O2
-fheinous-gnu-extensions
clang: warning: argument unused during compilation:
'-fheinous-gnu-extensions'

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] tcc compile broken with clang-3.3 (regression from 0.9.26)

2014-03-08 Thread Austin English
It broke between 0.9.25 and 0.9.26. Introduced by:
7a477d70cabe15fa66fd0f32fab5e95841a500e5 is the first bad commit
commit 7a477d70cabe15fa66fd0f32fab5e95841a500e5
Author: grischka grischka
Date:   Wed Feb 6 19:01:07 2013 +0100

lib/Makefile: use CC, add bcheck to libtcc1.a

Also:
- fix make tcc_p (profiling version)
- remove old gcc flags:
  -mpreferred-stack-boundary=2 -march=i386 -falign-functions=0
- remove test hello for Darwin (cannot compile to file)

[austin@localhost tinycc]$ git describe
release_0_9_26-158-gfdb3b10

clang -c libtcc1.c -o x86_64/libtcc1.o -I..  -Wall -g -O2
-fheinous-gnu-extensions -DTCC_TARGET_X86_64
libtcc1.c:697:45: error: too few arguments provided to function-like macro
invocation
void *__va_copy(struct __va_list_struct *src)
^
/usr/bin/../lib/clang/3.3/include/stdarg.h:40:9: note: macro '__va_copy'
defined here
#define __va_copy(d,s) __builtin_va_copy(d,s)
^
libtcc1.c:697:16: error: expected ';' after top level declarator
void *__va_copy(struct __va_list_struct *src)
   ^
   ;
2 errors generated.
make[1]: *** [x86_64/libtcc1.o] Error 1

[austin@localhost tinycc]$ clang --version
clang version 3.3 (tags/RELEASE_33/final)
Target: x86_64-redhat-linux-gnu
Thread model: posix

Hopefully enough time to fix it for 0.9.27 ;)

-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-02-08 Thread Austin English
FYI, I verified this on MSVC:

 call C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\vcvarsall.bat

Setting environment for using Microsoft Visual Studio 2010 x86 tools.
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
Copyright (C) Microsoft Corporation.  All rights reserved.

 C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin\cl.exe conftest.c
Microsoft (R) Incremental Linker Version 10.00.40219.01
Copyright (C) Microsoft Corporation.  All rights reserved.

/out:conftest.exe
conftest.obj
 dir
02/08/2014  10:33 PM 6 VERSION
02/08/2014  10:33 PM   246 conftest.c
02/08/2014  10:33 PM 8,009 conftest
02/08/2014  10:33 PM   737 conftest.obj
02/08/2014  10:33 PM45,056 conftest.exe
 conftest.exe v
v
 conftest.exe version
v
 conftest.exe m
m
 conftest.exe minor
m

Pushed it here:
http://repo.or.cz/w/tinycc.git/commit/497f9393e00748b8a592a486d3f5695bcd75ec57



On Fri, Feb 7, 2014 at 2:39 AM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 Sorry, was that 'Ok' to commit?


 Well, I meant workarounds can be ok if at least we know what
 the bug is.

 On the other hand the bug isn't THAT great that we need to
 document it forever in our sources.

 Maybe I'd then go rather along your original idea, that is to
 fight tne bug with some counter-bug, for example intentionally
 mis-spelling the word version in the input (versio, verssion, ...).
 Plus a short comment in the commit message.

 But really it is up to your preference (technically, aesthetically,
 spiritually, ...) what you do.

 Thanks,

 --- grischka


  -Austin
 On Wed, Feb 5, 2014 at 2:36 AM, grischka gris...@gmx.de wrote:

  Austin English wrote:

  It's an issue with globbing, see https://sourceforge.net/p/
 mingw/bugs/2062/

  Wow, great bug.

  There's a workaround:
 Ok.


 --- grischka



 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-02-06 Thread Austin English
Sorry, was that 'Ok' to commit?

-Austin
On Wed, Feb 5, 2014 at 2:36 AM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 It's an issue with globbing, see https://sourceforge.net/p/
 mingw/bugs/2062/


 Wow, great bug.

  There's a workaround:


 Ok.


 --- grischka


 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] [PATCH] tccelf.c: Fix the Linux-i386 build

2014-02-04 Thread Austin English
Still fails, different values though:
austin@aw25 ~/src/tinycc $ make test
make -C tests test 'PROGS_CROSS=i386-linux-gnu-tcc i386-w64-mingw32-tcc
x86_64-w64-mingw32-tcc arm-linux-fpa-tcc arm-linux-fpa-ld-tcc
arm-linux-gnu-tcc arm-linux-gnueabi-tcc c67-tcc'
make[1]: Entering directory '/home/austin/src/tinycc/tests'
 hello-exe 
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc
-vv; exit 1)  ./hello
Hello World
 hello-run 
../tcc -B.. -I.. -I.. -I../include -run ../examples/ex1.c
Hello World
 libtest 
./libtcc_test lib_path=..
Hello World!
fib(32) = 2178309
add(32, 64) = 96
 test3 
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\
-DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include
-DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c
-B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64
-DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -run tcctest.c 
test.out3
--- test.ref2014-02-03 16:08:40.010395893 -0800
+++ test.out32014-02-04 09:51:37.70323 -0800
@@ -346,7 +346,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709551616.00
+ulltof: 4503599627370496.00
 float: 42.123455
 double: 42.123455
 long double: 42.123455
@@ -385,7 +385,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709549568.00
+ulltof: 8386273.00
 float: 42.123455
 double: 42.123457
 long double: 42.123457
@@ -424,7 +424,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709549282.00
+ulltof: 1761.00
 float: 42.123455
 double: 42.123457
 long double: 42.123457
Makefile:125: recipe for target 'test3' failed
make[1]: *** [test3] Error 1
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:350: recipe for target 'test' failed
make: *** [test] Error 2



On Tue, Feb 4, 2014 at 6:34 AM, Thomas Preud'homme robo...@celest.frwrote:

 Le mardi 4 février 2014, 22:31:07 Thomas Preud'homme a écrit :
 
  Can you try with the attached patch applied?

 Sorry, bad copy paste. Please try this patch instead.

 best regards,

 thomas




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-02-04 Thread Austin English
It's an issue with globbing, see https://sourceforge.net/p/mingw/bugs/2062/

There's a workaround:
diff --git a/conftest.c b/conftest.c
index 53c181c..18d763c 100644
--- a/conftest.c
+++ b/conftest.c
@@ -37,6 +37,10 @@
 # define TRIPLET TRIPLET_ARCH - TRIPLET_OS - TRIPLET_ABI
 #endif

+#if defined(_WIN32)
+int _CRT_glob = 0; /* See https://sourceforge.net/p/mingw/bugs/2062/ */
+#endif
+
 int main(int argc, char *argv[])
 {
 switch(argc == 2 ? argv[1][0] : 0) {

I can push to mob, if that is acceptable.


On Mon, Feb 3, 2014 at 9:29 PM, Austin English austinengl...@gmail.comwrote:

 Reported to MinGW:
 http://sourceforge.net/p/mingw/bugs/2182/


 On Thu, Jan 23, 2014 at 6:07 PM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 It fails with gcc-4.8.1, gcc-4.7.2 and gcc-4.6.2 I also tried gcc-4.5.2,
 but that failed to compile at all.


 Here using gcc-4.7.2, shell from git, no AV, works.


 --- grischka


 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




 --
 -Austin




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] [PATCH] tccelf.c: Fix the Linux-i386 build

2014-02-03 Thread Austin English
FWIW, I see the same failures on Gentoo amd64, at
4e5f15c6851c69c4cc5da18209218eb918dbee77 (also tested against
2eb844f8b5ea0ae159eb3fcec78aa50bd8c03f11, but the problem is there as well).
austin@aw25 ~/src/tinycc $ make test
make -C tests test 'PROGS_CROSS=i386-linux-gnu-tcc i386-w64-mingw32-tcc
x86_64-w64-mingw32-tcc arm-linux-fpa-tcc arm-linux-fpa-ld-tcc
arm-linux-gnu-tcc arm-linux-gnueabi-tcc c67-tcc'
make[1]: Entering directory '/home/austin/src/tinycc/tests'
 hello-exe 
../tcc -B.. -I.. -I.. -I../include ../examples/ex1.c -o hello || (../tcc
-vv; exit 1)  ./hello
Hello World
 hello-run 
../tcc -B.. -I.. -I.. -I../include -run ../examples/ex1.c
Hello World
 libtest 
./libtcc_test lib_path=..
Hello World!
fib(32) = 2178309
add(32, 64) = 96
gcc -o tcctest.gcc tcctest.c -I.. -I..  -w -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
-DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -std=gnu99 -O0
-fno-omit-frame-pointer
./tcctest.gcc  test.ref
 test3 
../tcc -B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\
-DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include
-DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64 -DONE_SOURCE -run ../tcc.c
-B.. -I.. -I.. -I../include -DCONFIG_LDDIR=\lib64\ -DTCC_TARGET_X86_64
-DONE_SOURCE -run ../tcc.c -B.. -I.. -I.. -I../include -run tcctest.c 
test.out3
--- test.ref2014-02-03 16:08:40.010395893 -0800
+++ test.out32014-02-03 16:08:40.371390533 -0800
@@ -346,7 +346,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709551616.00
+ulltof: 2334.00
 float: 42.123455
 double: 42.123455
 long double: 42.123455
@@ -385,7 +385,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709549568.00
+ulltof: 2334.00
 float: 42.123455
 double: 42.123457
 long double: 42.123457
@@ -424,7 +424,7 @@
 itof: -1234.00
 lltof: -2334.00
 utof: 2166572288.00
-ulltof: 18446744073709549282.00
+ulltof: 2334.00
 float: 42.123455
 double: 42.123457
 long double: 42.123457
Makefile:125: recipe for target 'test3' failed
make[1]: *** [test3] Error 1
make[1]: Leaving directory '/home/austin/src/tinycc/tests'
Makefile:350: recipe for target 'test' failed
make: *** [test] Error 2
austin@aw25 ~/src/tinycc $ git describe
release_0_9_26-142-g4e5f15c
austin@aw25 ~/src/tinycc $ uname -a
Linux aw25 3.12.0-gentoo-devlight-1 #1 SMP Mon Nov 4 19:37:36 Local time
zone must be set--see zic m x86_64 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz
GenuineIntel GNU/Linux
austin@aw25 ~/src/tinycc $ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.8.2/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.8.2/work/gcc-4.8.2/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.8.2
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/include/g++-v4
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.8.2/python
--enable-languages=c,c++,java,go --enable-obsolete --enable-secureplt
--disable-werror --with-system-zlib --disable-nls --enable-checking=release
--with-bugurl=https://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.8.2
p1.3r1, pie-0.5.8r1' --enable-libstdcxx-time --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-multilib --with-multilib-list=m32,m64 --disable-altivec
--disable-fixed-point --enable-targets=all --enable-libgomp
--enable-libmudflap --disable-libssp --disable-libquadmath --enable-lto
--without-cloog
Thread model: posix
gcc version 4.8.2 (Gentoo 4.8.2 p1.3r1, pie-0.5.8r1)



On Sun, Feb 2, 2014 at 4:02 AM, Thomas Preud'homme robo...@celest.frwrote:

 Le dimanche 2 février 2014 11:29:08, vous avez écrit :
  Signed-off-by: Ramsay Jones ram...@ramsay1.demon.co.uk
  ---
 
  Hi Thomas,
 
  tcc currently fails to compile on Linux-i386; this patch fixes it
  up for me. Unfortunately, the tests are also failing, but I don't
  have time to look into fixing them. The failure looks like so:

 My apologize, I did some refactoring of tccelf.c in the hope to make it
 more
 accessible but I made some mistake obviously. It worked on my ARM machine
 though, hence I didn't see the problem. I'll revert the last three commits
 for
 now and will wait to have access to a i386 machine to test it before
 reapplying them.

 Sorry for that.

 Best regards,

 Thomas

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 

Re: [Tinycc-devel] Running 'make test' on windows?

2014-02-03 Thread Austin English
Reported to MinGW:
http://sourceforge.net/p/mingw/bugs/2182/


On Thu, Jan 23, 2014 at 6:07 PM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 It fails with gcc-4.8.1, gcc-4.7.2 and gcc-4.6.2 I also tried gcc-4.5.2,
 but that failed to compile at all.


 Here using gcc-4.7.2, shell from git, no AV, works.


 --- grischka


 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-01-23 Thread Austin English
It fails with gcc-4.8.1, gcc-4.7.2 and gcc-4.6.2 I also tried gcc-4.5.2,
but that failed to compile at all.



On Thu, Jan 23, 2014 at 6:01 AM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 -gcc_major=$($CONFTEST version)
 -gcc_minor=$($CONFTEST minor)
 +gcc_major=$($CONFTEST v)
 +gcc_minor=$($CONFTEST m)

 it could be a gcc/mingw regression. This is gcc-4.8.1 (I haven't tried
 other versions though).

 Would you like me to push that to mob?


 Well, if with ./conftest version argv[1] is version and
 argc == 2 but
 switch(argc == 2 ? argv[1][0] : 0) {
 doesn't trigger
 case 'v':
 then it looks like a compiler bug.

 Otherwise if argv[1] is not version or argc != 2 it could be a
 bug in the mingw startup code or some virus scanner interference
 with the msys shell (cygwin-BLODA).

 Otherwise if the machine starts making inexplicable assumptions
 about the difference between version and v on that level
 I'd seriously suspect that it was infected by google. (A joke)

 Anyway I'd personally not do anything with any code before I knew
 what's wrong with my compilation environment here.


 --- grischka

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-01-22 Thread Austin English
With commit 32a4962593d6a2006cdd725480124717e7f5377d, it builds and make
test runs. There is an error:
gcc -o tcctest.gcc tcctest.c -I.. -I..  -w -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare -Wno-unused-result
-DTCC_TARGET_I386 -DTCC_TARGET_PE -std=gnu99 -O0 -fno-omit-frame-pointer
tcctest.c:6:15: error: operator '=' has no left operand
 #if GCC_MAJOR = 3
   ^
tcctest.c: In function 'builtin_test':
tcctest.c:2467:15: error: operator '=' has no left operand
 return (to);
   ^
make[1]: *** [test.ref] Error 1

make -k otherwise looks good, thanks.

P.S. I had actually originally tested against 0.9.26, not HEAD. I assumed a
release had a better chance of reliably passing 'make test'. Maybe a goal
for 0.9.27? ;)


On Tue, Jan 21, 2014 at 10:36 AM, Thomas Preud'homme robo...@celest.frwrote:

 Le lundi 20 janvier 2014, 16:44:13 Austin English a écrit :
  Howdy,
 
  I can't seem to find how to run the test suite on a windows mingw build.
  Running 'make' works fine, but 'make test' fails every time:
  make -C tests test
  make[1]: Entering directory `/c/tcc-0.9.26/tests'
   hello-exe 
  ../tcc -B../win32 -I../include -L.. ../examples/ex1.c -o hello.exe ||
  (../tcc -vv; exit 1)  ./hello.exe
  Hello World
   hello-run 
  ../tcc -B../win32 -I../include -L.. -run ../examples/ex1.c
  Hello World
   libtest 
  ./libtcc_test.exe lib_path=..
  tcc: error: cannot find library: libtcc1.a
  tcc: error: undefined symbol 'printf'
  make[1]: *** [libtest] Error 1
  make[1]: Leaving directory `/c/tcc-0.9.26/tests'
  make: *** [test] Error 2
 
  I already searched the archive for 'windows tests', and checked win32/,
 but
  haven't seen the answer.

 I think grischka may have fixed the issue. if not, can you remove
 libtcc_test.exe and then run make test and post me the output?

 Best regards,

 Thomas

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-01-22 Thread Austin English
conftest.exe is built, it fails for 'version' though:
+ CONFTEST=./conftest.exe
+ test -z ''
+ gcc -o ./conftest.exe /c/Users/austin/Documents/tinycc/conftest.c
++ ./conftest.exe bigendian
+ bigendian=no
++ ./conftest.exe version
+ gcc_major=
++ ./conftest.exe minor
+ gcc_minor=8
+ test yes = no

a simple patch fixes it:
diff --git a/configure b/configure
index 8c44e5c..c05315f 100755
--- a/configure
+++ b/configure
@@ -299,8 +299,8 @@ if test -z $cross_prefix ; then
 echo configure: error: '$cc' failed to compile conftest.c.
   else
 bigendian=$($CONFTEST bigendian)
-gcc_major=$($CONFTEST version)
-gcc_minor=$($CONFTEST minor)
+gcc_major=$($CONFTEST v)
+gcc_minor=$($CONFTEST m)
 if test $mingw32 = no ; then
   triplet=$($CONFTEST triplet)
   if test -f /usr/lib/$triplet/crti.o ; then


it could be a gcc/mingw regression. This is gcc-4.8.1 (I haven't tried
other versions though).

After that, all tests pass with HEAD (32af4962).

Would you like me to push that to mob?


On Wed, Jan 22, 2014 at 8:40 AM, grischka gris...@gmx.de wrote:

 Austin English wrote:

 tcctest.c:6:15: error: operator '=' has no left operand
  #if GCC_MAJOR = 3


 Check how it comes that conftest(.exe) is not built or gcc_major
 is not set from configure, lines 295-304.

 --- grischka



 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Running 'make test' on windows?

2014-01-22 Thread Austin English
Of course! I did not mean any complaint, I was simply saying that I tested
a release version since I suspected it would be stable and not likely to be
broken from a recent regression  like trunk might be.

I'll be sure to test when it comes around :).

Thanks for all your hard work!


On Wed, Jan 22, 2014 at 3:09 PM, Thomas Preud'homme robo...@celest.frwrote:

 Le mercredi 22 janvier 2014, 04:18:53 Austin English a écrit :
  With commit 32a4962593d6a2006cdd725480124717e7f5377d, it builds and make
  test runs. There is an error:
  gcc -o tcctest.gcc tcctest.c -I.. -I..  -w -Wall -g -O2
  -fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
 -Wno-unused-result
  -DTCC_TARGET_I386 -DTCC_TARGET_PE -std=gnu99 -O0 -fno-omit-frame-pointer
  tcctest.c:6:15: error: operator '=' has no left operand
   #if GCC_MAJOR = 3
 ^
  tcctest.c: In function 'builtin_test':
  tcctest.c:2467:15: error: operator '=' has no left operand
   return (to);
 ^
  make[1]: *** [test.ref] Error 1
 
  make -k otherwise looks good, thanks.
 
  P.S. I had actually originally tested against 0.9.26, not HEAD. I
 assumed a
  release had a better chance of reliably passing 'make test'. Maybe a goal
  for 0.9.27? ;)

 I definitely hope that 0.9.27 will work better and more tests will pass.
 We all
 worked hard for this. I myself focused on ARM as it's what I know best but
 others have worked on it as well. However we need testers to try all
 possible
 configurations so when we'll do the call for testing you are more than
 welcome
 to report tests that fail.

 Best regards,

 Thomas




-- 
-Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Running 'make test' on windows?

2014-01-20 Thread Austin English
Howdy,

I can't seem to find how to run the test suite on a windows mingw build.
Running 'make' works fine, but 'make test' fails every time:
make -C tests test
make[1]: Entering directory `/c/tcc-0.9.26/tests'
 hello-exe 
../tcc -B../win32 -I../include -L.. ../examples/ex1.c -o hello.exe ||
(../tcc -vv; exit 1)  ./hello.exe
Hello World
 hello-run 
../tcc -B../win32 -I../include -L.. -run ../examples/ex1.c
Hello World
 libtest 
./libtcc_test.exe lib_path=..
tcc: error: cannot find library: libtcc1.a
tcc: error: undefined symbol 'printf'
make[1]: *** [libtest] Error 1
make[1]: Leaving directory `/c/tcc-0.9.26/tests'
make: *** [test] Error 2

I already searched the archive for 'windows tests', and checked win32/, but
haven't seen the answer.

Thanks in advance,
Austin
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Compiling preprocessed files with tinycc?

2013-05-16 Thread Austin English
Finally was able to get creduce to work (didn't fare so well in a vm
with 32-bit gentoo, but Ubuntu 12.10 in VirtualBox was able to do it.

I've attached a tarball with the testcase and the script used to test
for the bug (against Ubuntu's gcc-4.7.3 and Debian's gcc-4.7.2):
austin@debian-home:~/tcc-bug$ cat test.sh
#!/bin/bash
set -x
gcc -Werror -c -I. -I. -I../../../include -I../../../include
-DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT -fPIC  -I/usr/include/freetype2
   -g  -o stateblock.o stateblock-i.c || exit 1
tcc -c -I. -I. -I../../../include -I../../../include
-DWINE_STRICT_PROTOTYPES -DWINE_NO_NAMELESS_EXTENSION
-DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT -fPIC  -I/usr/include/freetype2
   -g  -o stateblock.o stateblock-i.c 21 | grep error: '}' expected
(got \,\)

FWIW, clang also accepts the reduced file with no complaints. Tested
against tinycc's mob trunk, current
47305d427d27c3a93c1ddc9a09075602f75243bc.

Please let me know if you need more info / patches tested :).


On Thu, Mar 21, 2013 at 11:01 AM, Austin English
austinengl...@gmail.com wrote:
 On Wed, Mar 20, 2013 at 3:11 PM, Daniel Glöckner daniel...@gmx.net wrote:
 On Wed, Mar 20, 2013 at 01:01:10PM -0700, Austin English wrote:
 manually correcting that, I'm able to preprocess the problematic file down 
 to:
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ cat stateblock.i.tcc.c
 typedef struct _D3DVECTOR
 {
   float x;
   float y;
   float z;
 } D3DMATRIX;

 You are aware that D3DMATRIX is supposed to consist of 16 floats?

 Looks like delta foobared the program while minimalizing it. I'm
 retrying now with creduce, though it's taking quite a while..

 --
 -Austin



-- 
-Austin


tcc.tar
Description: Unix tar archive
___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Compiling preprocessed files with tinycc?

2013-03-21 Thread Austin English
On Wed, Mar 20, 2013 at 3:11 PM, Daniel Glöckner daniel...@gmx.net wrote:
 On Wed, Mar 20, 2013 at 01:01:10PM -0700, Austin English wrote:
 manually correcting that, I'm able to preprocess the problematic file down 
 to:
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ cat stateblock.i.tcc.c
 typedef struct _D3DVECTOR
 {
   float x;
   float y;
   float z;
 } D3DMATRIX;

 You are aware that D3DMATRIX is supposed to consist of 16 floats?

Looks like delta foobared the program while minimalizing it. I'm
retrying now with creduce, though it's taking quite a while..

-- 
-Austin

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Compiling preprocessed files with tinycc?

2013-03-20 Thread Austin English
On Tue, Mar 19, 2013 at 10:02 PM, Milutin Jovanović
jovanovic.milu...@gmail.com wrote:

 This is only a filename, or precisely extension issue. If you rename your
 intermediate file from stateblock.i to stateblock-i.c, I believe
 everything should work.

 Miki.


 On 19 March 2013 23:10, Austin English austinengl...@gmail.com wrote:

 Howdy,

 I'm trying to narrow down a file that fails to compile with tinycc,
 but works with gcc/clang. The exact error is:
 stateblock.c:875: error: '}' expected (got ,)

 I wanted to use multidelta to reduce the testcase, but quickly found
 that trying to recompile a preprocessed file with tcc fails:
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -E -I.
 -I../../../include -DWINE_STRICT_PROTOTYPES
 -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
 -fPIC  -I/usr/include/freetype2 -o stateblock.i stateblock.c
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
 0
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -c -I.
 -I../../../include -DWINE_STRICT_PROTOTYPES
 -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
 -fPIC  -I/usr/include/freetype2 -o stateblock.o stateblock.i
 stateblock.i:1: error: unrecognized file type
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
 1

 but this works with gcc/clang:
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ gcc -E -I.
 -I../../../include -DWINE_STRICT_PROTOTYPES
 -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
 -fPIC  -I/usr/include/freetype2 -o stateblock.i stateblock.c
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
 0
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ gcc -c -I.
 -I../../../include -DWINE_STRICT_PROTOTYPES
 -DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
 -fPIC  -I/usr/include/freetype2 -o stateblock.o stateblock.i
 austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
 0

 Is it possible to get tcc to use the preprocessed source?

 Thanks in advance,
 -Austin

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel



 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Yes, this (mostly) works:
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -E -I. -I.
-I../../../include -I../../../include  -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2-g  -o stateblock-i.c stateblock.c
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -c -I. -I.
-I../../../include -I../../../include  -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2-g  -o stateblock.o stateblock-i.c
stateblock-i.c:14963: error: invalid number

this exposes a second bug:
#define MAX_LANA 0xfe
...
typedef struct _LANA_ENUM
{
UCHAR length;
UCHAR lana[MAX_LANA+1];
} LANA_ENUM, *PLANA_ENUM;

is expanded to:
typedef struct _LANA_ENUM
{
UCHAR length;
UCHAR lana[0xfe+1];
} LANA_ENUM, *PLANA_ENUM;

whereas with gcc/clang:
typedef struct _LANA_ENUM
{
 UCHAR length;
 UCHAR lana[0xfe +1];
} LANA_ENUM, *PLANA_ENUM;

(I filed that here: https://savannah.nongnu.org/bugs/index.php?38557)

manually correcting that, I'm able to preprocess the problematic file down to:
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ cat stateblock.i.tcc.c
typedef struct _D3DVECTOR
{
  float x;
  float y;
  float z;
} D3DMATRIX;

struct transform_data
{
  D3DMATRIX view;
  D3DMATRIX projection;
  D3DMATRIX texture0;
  D3DMATRIX texture7;
  D3DMATRIX world0;
  D3DMATRIX world255;
};

static const struct transform_data transform_default_data =
{
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
{{{
1.0f, 0.0f, 0.0f, 0.0f,
0.0f, 1.0f, 0.0f, 0.0f,
0.0f, 0.0f, 1.0f, 0.0f,
0.0f, 0.0f, 0.0f, 1.0f,
}}},
};

int main(void)
{
return 0;
}

compiling that minimalized source with gcc/clang does generate some
warnings, but does not fail (as it does with tcc). The full source
file generates no errors or warnings on gcc/clang.

See also https://savannah.nongnu.org/bugs

[Tinycc-devel] Compiling preprocessed files with tinycc?

2013-03-19 Thread Austin English
Howdy,

I'm trying to narrow down a file that fails to compile with tinycc,
but works with gcc/clang. The exact error is:
stateblock.c:875: error: '}' expected (got ,)

I wanted to use multidelta to reduce the testcase, but quickly found
that trying to recompile a preprocessed file with tcc fails:
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -E -I.
-I../../../include -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2 -o stateblock.i stateblock.c
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
0
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ tcc -c -I.
-I../../../include -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2 -o stateblock.o stateblock.i
stateblock.i:1: error: unrecognized file type
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
1

but this works with gcc/clang:
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ gcc -E -I.
-I../../../include -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2 -o stateblock.i stateblock.c
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
0
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ gcc -c -I.
-I../../../include -DWINE_STRICT_PROTOTYPES
-DWINE_NO_NAMELESS_EXTENSION -DWIDL_C_INLINE_WRAPPERS  -D_REENTRANT
-fPIC  -I/usr/include/freetype2 -o stateblock.o stateblock.i
austin@debian-home:~/src/wine-tcc/dlls/d3d8/tests$ echo $?
0

Is it possible to get tcc to use the preprocessed source?

Thanks in advance,
-Austin

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] Option number is ambiguous (number-footnotes, number-sections) (texi2html) (patch)

2013-02-16 Thread Austin English
On Fri, Feb 15, 2013 at 5:42 PM, Thomas Preud'homme robo...@celest.fr wrote:
 Le vendredi 15 février 2013 19:14:23, Austin English a écrit :
 This was around before 0.9.26, but I forgot to report it:

 make[1]: Leaving directory `/home/austin/src/tinycc/lib'
 ./texi2pod.pl tcc-doc.texi tcc.pod
 pod2man --section=1 --center=  --release=  tcc.pod  tcc.1
 texi2html -monolithic -number tcc-doc.texi
 Option number is ambiguous (number-footnotes, number-sections)
 Try `texi2html --help' for more information.
 make: [tcc-doc.html] Error 2 (ignored)
 makeinfo tcc-doc.texi

 austin@aw25 ~/src/tinycc $ texi2html --version
 5.0

 austin@aw25 ~/src/tinycc $ uname -a
 Linux aw25 3.5.3-gentoo #4 SMP Wed Oct 24 21:55:24 PDT 2012 x86_64
 Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux

 The following patch fixes it:
 diff --git a/Makefile b/Makefile
 index 705b585..9376132 100644
 --- a/Makefile
 +++ b/Makefile
 @@ -300,7 +300,7 @@ endif

  # documentation and man page
  tcc-doc.html: tcc-doc.texi
 - -texi2html -monolithic -number $
 + -texi2html -monolithic -number-sections $

  tcc.1: tcc-doc.texi
   -$(top_srcdir)/texi2pod.pl $ tcc.pod

 Go ahead and commit it to the mob branch. As I said I'd like to release more
 often, around 1 release a year like before. Let's make the next release even
 better than this one :)

 Best regards,

 Thomas

It fails to push:
austin@debian-home:~/src/tinycc$ git push
ssh://m...@repo.or.cz/srv/git/tinycc.git docfix:mob
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 320 bytes, done.
Total 3 (delta 2), reused 0 (delta 0)
The mob user cannot _create_ the 'mob' branch, sorry
error: hooks/update exited with error code 2
error: hook declined to update refs/heads/mob
To ssh://m...@repo.or.cz/srv/git/tinycc.git
 ! [remote rejected] docfix - mob (hook declined)
error: failed to push some refs to 'ssh://m...@repo.or.cz/srv/git/tinycc.git'

may be related to the problem someone else posted of not being able to
do a git pull?

-- 
-Austin

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


[Tinycc-devel] Option number is ambiguous (number-footnotes, number-sections) (texi2html) (patch)

2013-02-15 Thread Austin English
This was around before 0.9.26, but I forgot to report it:

make[1]: Leaving directory `/home/austin/src/tinycc/lib'
./texi2pod.pl tcc-doc.texi tcc.pod
pod2man --section=1 --center=  --release=  tcc.pod  tcc.1
texi2html -monolithic -number tcc-doc.texi
Option number is ambiguous (number-footnotes, number-sections)
Try `texi2html --help' for more information.
make: [tcc-doc.html] Error 2 (ignored)
makeinfo tcc-doc.texi

austin@aw25 ~/src/tinycc $ texi2html --version
5.0

austin@aw25 ~/src/tinycc $ uname -a
Linux aw25 3.5.3-gentoo #4 SMP Wed Oct 24 21:55:24 PDT 2012 x86_64
Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux

The following patch fixes it:
diff --git a/Makefile b/Makefile
index 705b585..9376132 100644
--- a/Makefile
+++ b/Makefile
@@ -300,7 +300,7 @@ endif

 # documentation and man page
 tcc-doc.html: tcc-doc.texi
-   -texi2html -monolithic -number $
+   -texi2html -monolithic -number-sections $

 tcc.1: tcc-doc.texi
-$(top_srcdir)/texi2pod.pl $ tcc.pod

-- 
-Austin

___
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel


Re: [Tinycc-devel] test failure on Linux

2013-02-13 Thread Austin English
On Wed, Feb 13, 2013 at 11:31 AM, Thomas Preud'homme robo...@celest.fr wrote:
 Le mercredi 13 février 2013 16:17:42, Thomas Preud'homme a écrit :

 Ok, I can do that.

 See attached patch and the diffstat below:

  configure|   48 +---
  print_env_info.c |   35 +++
  2 files changed, 40 insertions(+), 43 deletions(-)

 I suggest we include it and then release tomorrow once people checked I didn't
 break something with my last patches.

 Best regards,

 Thomas

 ___
 Tinycc-devel mailing list
 Tinycc-devel@nongnu.org
 https://lists.nongnu.org/mailman/listinfo/tinycc-devel


It breaks for me on 64-bit gentoo:
austin@aw25 ~/src/tinycc $ git reset --hard origin
HEAD is now at f9ac201 Detect multiarch triplet and lddir from ldd output

austin@aw25 ~/src/tinycc $ git clean -dfx
Removing config.h
Removing config.mak
Removing config.texi
Removing i386-asm.o
Removing lib/x86_64/
Removing libtcc.a
Removing libtcc.o
Removing libtcc1.a
Removing tcc
Removing tcc-doc.info
Removing tcc.1
Removing tcc.o
Removing tcc.pod
Removing tccasm.o
Removing tccelf.o
Removing tccgen.o
Removing tccpp.o
Removing tccrun.o
Removing x86_64-gen.o

austin@aw25 ~/src/tinycc $ ./configure
ldd: ./print_env_info: No such file or directory
Binary  directory   /usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc/tcc
Target root prefix
Source path  /home/austin/src/tinycc
C compiler   gcc
Target OSLinux
CPU  x86-64
Big Endian   no
gprof enabledno
cross compilers  no
use libgcc   no
Creating config.mak and config.h

austin@aw25 ~/src/tinycc $ make
gcc -o tcc.o -c tcc.c -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
gcc -o libtcc.o -c libtcc.c -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
libtcc.c: In function ‘tcc_new’:
libtcc.c:988:29: error: expected ‘)’ before ‘CONFIG_LDDIR’
libtcc.c:990:66: error: expected ‘)’ before ‘CONFIG_LDDIR’
libtcc.c: In function ‘tcc_compile’:
libtcc.c:728:15: warning: ignoring return value of ‘getcwd’, declared
with attribute warn_unused_result
make: *** [libtcc.o] Error 1

austin@aw25 ~/src/tinycc $ uname -a
Linux aw25 3.5.3-gentoo #4 SMP Wed Oct 24 21:55:24 PDT 2012 x86_64
Intel(R) Core(TM) i7 CPU 960 @ 3.20GHz GenuineIntel GNU/Linux

austin@aw25 ~/src/tinycc $ gcc -v
Using built-in specs.
COLLECT_GCC=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4/gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/4.5.4/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage/sys-devel/gcc-4.5.4/work/gcc-4.5.4/configure
--prefix=/usr --bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/4.5.4
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/4.5.4/include/g++-v4
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu
--disable-altivec --disable-fixed-point --without-ppl --without-cloog
--disable-lto --enable-nls --without-included-gettext
--with-system-zlib --enable-obsolete --disable-werror
--enable-secureplt --enable-multilib --enable-libmudflap
--disable-libssp --enable-libgomp
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/4.5.4/python
--enable-checking=release --disable-libgcj
--enable-languages=c,c++,fortran --enable-shared
--enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu
--enable-targets=all --with-bugurl=http://bugs.gentoo.org/
--with-pkgversion='Gentoo 4.5.4 p1.0, pie-0.4.7'
Thread model: posix
gcc version 4.5.4 (Gentoo 4.5.4 p1.0, pie-0.4.7)

reverting the patch fixes it:
austin@aw25 ~/src/tinycc $ git show | patch -p1 -R
patching file configure
patching file tcc.h
austin@aw25 ~/src/tinycc $ ./configure  make
Binary  directory   /usr/local/bin
TinyCC directory/usr/local/lib/tcc
Library directory   /usr/local/lib
Include directory   /usr/local/include
Manual directory/usr/local/share/man
Info directory  /usr/local/share/info
Doc directory   /usr/local/share/doc/tcc
Target root prefix
Source path  /home/austin/src/tinycc
C compiler   gcc
Target OSLinux
CPU  x86-64
Big Endian   no
gprof enabledno
cross compilers  no
use libgcc   no
Creating config.mak and config.h
config.h is unchanged
gcc -o tcc.o -c tcc.c -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
gcc -o libtcc.o -c libtcc.c -DTCC_TARGET_X86_64 -I.  -Wall -g -O2
-fno-strict-aliasing -Wno-pointer-sign -Wno-sign-compare
libtcc.c: In function 

[Tinycc-devel] Compiling Wine with TinyCC (status/bug reports)

2012-09-04 Thread Austin English
Howdy,

I recently tried compiling Wine with tcc, which found a few bugs. I've
filed some on Savannah (and have before as well), but that didn't
garner much attention, so I'm writing here as well. If that's
unwelcome, please let me know and I'll refrain :).

Now then, I used wine-1.5.12 (recent development snapshot), and tinycc
from git (commit 56e23984b9cd3b58e1766748524e63f8301ccd68). Compared
to 0.9.25, it gets much further, a couple of my bugs were fixed
already:
https://savannah.nongnu.org/bugs/?33010 - configure misses most dependencies
https://savannah.nongnu.org/bugs/?33713 - tinycc doesn't support u_int64_t

the new bugs:
https://savannah.nongnu.org/bugs/?37240 - tinycc: unknown opcode 'movq'
https://savannah.nongnu.org/bugs/?37241 - tinycc: 'error: bad
expression syntax [.]' on some wine files
https://savannah.nongnu.org/bugs/?37242 - tinycc: tmarshal.h:761:
error: identifier expected (wine)
https://savannah.nongnu.org/bugs/?37243 - tinycc: fails to compile
wine's dlls/d3d8/tests/stateblock.c file
https://savannah.nongnu.org/bugs/?37244 - tinycc: lacks -nostartfiles
-nodefaultlibs support, needed by Wine

there are a couple other issues, that I haven't filed bugs for:
A) running ./configure fails to detect libhal and opengl. This can be
worked around by doing:
CC=tcc -L/usr/lib ./configure

B) TinyCC doesn't seem to support DECLSPEC_HIDDEN / DECLSPEC_HOTPATCH.

C) There are some other areas that fail to compile, though those
appear to be Wine bugs. I've attached a (very hacky) patch that
(mostly) allows wine to compile. For the files mentioned above that
don't compile, make CC=gcc was used to work around it.

After that, wine segfaults on launch, so there's obviously more work
to be done, but these issues make narrowing down that problem harder.

I'd be happy to test any tcc patches, if needed. I've attached
testcases for some of the bugs, when possible. I attempted to use
delta (http://delta.tigris.org/) to narrow down the problems more, but
it seems tinycc doesn't support dumping the preprocessed code?

-- 
-Austin
commit 9a9171901c3145df95e421eeab55c7ab005d0661
Author: Austin English austin@debian
Date:   Fri Aug 31 15:04:58 2012 -0700

asdf

diff --git a/dlls/advapi32/lsa.c b/dlls/advapi32/lsa.c
index 385ace4..d0ad0e7 100644
--- a/dlls/advapi32/lsa.c
+++ b/dlls/advapi32/lsa.c
@@ -627,7 +627,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
  */
 PPOLICY_PRIMARY_DOMAIN_INFO pinfo;
 
-pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), 
offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
+//pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), 
offsetof(POLICY_PRIMARY_DOMAIN_INFO, Name));
 
 TRACE(setting domain to %s\n, debugstr_w(pinfo-Name.Buffer));
 
@@ -677,7 +677,7 @@ NTSTATUS WINAPI LsaQueryInformationPolicy(
  */
 PPOLICY_DNS_DOMAIN_INFO pinfo;
 
-pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), 
offsetof(POLICY_DNS_DOMAIN_INFO, Name));
+//pinfo = ADVAPI_GetDomainName(sizeof(*pinfo), 
offsetof(POLICY_DNS_DOMAIN_INFO, Name));
 
 TRACE(setting domain to %s\n, debugstr_w(pinfo-Name.Buffer));
 
diff --git a/dlls/crypt32/crypt32_private.h b/dlls/crypt32/crypt32_private.h
index ea85cbc..950fe4b 100644
--- a/dlls/crypt32/crypt32_private.h
+++ b/dlls/crypt32/crypt32_private.h
@@ -149,7 +149,7 @@ BOOL WINAPI CRYPT_AsnEncodePubKeyInfoNoNull(DWORD 
dwCertEncodingType,
  */
 HCRYPTPROV CRYPT_GetDefaultProvider(void) DECLSPEC_HIDDEN;
 
-HINSTANCE hInstance DECLSPEC_HIDDEN;
+extern HINSTANCE hInstance DECLSPEC_HIDDEN;
 
 void crypt_oid_init(void) DECLSPEC_HIDDEN;
 void crypt_oid_free(void) DECLSPEC_HIDDEN;
diff --git a/dlls/d3d8/d3d8_main.c b/dlls/d3d8/d3d8_main.c
index 3405447..84d1469 100644
--- a/dlls/d3d8/d3d8_main.c
+++ b/dlls/d3d8/d3d8_main.c
@@ -35,7 +35,7 @@ void WINAPI DebugSetMute(void) {
 /* nothing to do */
 }
 
-IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
+extern IDirect3D8 * WINAPI DECLSPEC_HOTPATCH Direct3DCreate8(UINT sdk_version)
 {
 struct d3d8 *object;
 
diff --git a/dlls/d3d8/tests/Makefile.in b/dlls/d3d8/tests/Makefile.in
index 14fa2fc..7df81bf 100644
--- a/dlls/d3d8/tests/Makefile.in
+++ b/dlls/d3d8/tests/Makefile.in
@@ -5,7 +5,6 @@ C_SRCS = \
buffer.c \
d3d8_main.c \
device.c \
-   stateblock.c \
surface.c \
texture.c \
visual.c \
diff --git a/dlls/d3d9/tests/Makefile.in b/dlls/d3d9/tests/Makefile.in
index 4c4ce0f..b3be706 100644
--- a/dlls/d3d9/tests/Makefile.in
+++ b/dlls/d3d9/tests/Makefile.in
@@ -7,7 +7,6 @@ C_SRCS = \
device.c \
query.c \
shader.c \
-   stateblock.c \
surface.c \
texture.c \
vertexdeclaration.c \
diff --git a/dlls/d3dx9_36/tests/Makefile.in b/dlls/d3dx9_36/tests/Makefile.in
index 5384705..01bc538 100644
--- a/dlls/d3dx9_36/tests/Makefile.in
+++ b/dlls/d3dx9_36/tests/Makefile.in
@@ -6,9 +6,6 @@ C_SRCS = \
core.c