tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Staging for -m32 option


From: Henry Kroll
Subject: Re: [Tinycc-devel] Staging for -m32 option
Date: Mon, 06 Dec 2010 21:26:27 -0800

On Tue, 2010-12-07 at 02:08 +0100, grischka wrote:
> Henry Kroll wrote:
> >     if (32 == atoi(optarg)) {/* -m32 */
> > #ifdef TCC_TARGET_X86_64
> > #ifdef TCC_TARGET_PE
> > #ifdef _WIN32
> >         strcpy(arg,"tcc.exe");
> >         sep='\\';
> > #else
> >         strcpy(arg,"i386-win32-tcc");
> > #endif
> > #endif
> 
> What is the deal with this?  Maybe there is one but I can't figure
> it out.  If we are on windows and if the current tcc produces
> 64bit PE code then "tcc -m32" should start "i386-win32-tcc.exe", no?
> 
_WIN64 is not handled (yet), so we only deal with the "Big 3"
cross-compiler configurations for now, the minimum needed to start
testing on Windows or Linux:

1) x86_64-win32-tcc.exe  ->  tcc.exe (win32 to Win64/32 only, for now)
2) tcc -m32              ->  i386-tcc (Linux64 to Linux64/32).
3) x86_64-win32-tcc -m32 ->  i386-win32-tcc (Linux64 to Win64/32).

* I think to get (win64) tcc.exe -> i386-win32-tcc.exe working _WIN64
needs to be defined in the header and elsewhere, about the same way
_WIN32 is. I'll look into that. The i386-win32-tcc is for Linux. ifdef
_WIN32.. else Linux.

I probably should put the "figure out path" part back in using your API
suggestion, thanks. That will make it look much better. I knew there was
something like that. I just couldn't remember the name. I will test all
that for a few days before putting it up. I got another paper to write
now. :(

> >         if(!(tcc=1+strrchr(argv[-1],sep)))
> >             tcc=argv[-1];
> Don't bother.  Use:
>      tcc = tcc_basename(argv[-1]);
> 
> Note however that !(tcc=1+strrchr(argv[-1],sep)) is actually
> never true because of the 1+ ;)
> 
Yeah, I noticed that, too when I started running tests ;)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]