Gregory McGarry | 6 Jan 2009 21:55

Re: win32 snapshot


On 16/12/2008, at 7:03 AM, Gregory McGarry wrote:

> Since it's somewhat complicated to get a win32 system built, I've  
> been asked a few times to provide binaries.
>
> I've placed a snapshot of my pcc binaries here: http:// 
> pcc.ludd.ltu.se/ftp/pub/win32/pcc-snapshot-20081212.zip
>
> The zipfile doesn't contain a linker.  You'll need a copy of the  
> Microsoft linker somewhere in the path.

Peter Johnson of the yasm project has recently fixed the bugs in yasm  
and it is working well.  I've updated the snapshot on the ftp  
server.  Additionally, I have added the gnu linker to the snapshot,  
so it should "just work" out of the box.

Gregory McGarry | 24 Jan 2009 01:02

Re: wide character/string support for pcc

On 26/11/2008, at 2:54 AM, Thorsten Glaser wrote:

> Dixi quod…
>
>> I’ll come back with the complete diff whenever it’s done ☺ and,
>> just for the notes, this work has _not_ been sponsored by the
>> BSD fund ;-)
>
> Okay, here we are. I think I’m quite finished. Of course, there
> may be bugs – beware. ISO C99 definitively allows the direct use
> of nōn-ASCII characters in the source (I checked) as an imple-
> mentation-specific extension. $ <at> ` are mapped to _uXXXX codes,
> since at least GNU as on MirBSD didn’t handle either of them.

I've converted the linux build to use the pcc-supplied csu files and  
libpcc headers.  So now pcc on linux doesn't rely on gcc headers.

However, one problem is that wchar_t type isn't always defined  
correctly in the headers, so I've revisited to your patch.  At this  
stage I'm only interested in determining the true/best value of wchar_t.

Currently, pcc defines WCHAR_TYPE in the arch-specific macdefs.h,  
which is clearly wrong, since it's a property of the C library.  Your  
patch moves the definition into the configure script.  However, it's  
not really a property of the OS.  There are different C libraries for  
Linux, and the type of wchar_t can change.

Is it appropriate to detect the type of wchar_t in configure.ac and  
set WCHAR_TYPE?

(Continue reading)

Gregory McGarry | 24 Jan 2009 01:02

Re: wide character/string support for pcc


On 26/11/2008, at 4:45 AM, Thorsten Glaser wrote:

>> I haven’t yet tested on Win32 (haven’t ever tried that),
>
> Well, I’m unable to.
>
> build.bat is quite broken (and I’m not just talking about line
> endings), and even after investing some effort fixing it, pcc
> cannot be built with the Microsoft C Compiler 13.00, because
> it uses “long long”, etc.
>
> Then I tried to build a cross-compiler from cygwin, which error’d
> out due to some of the #ifdef̲’d stuff in arch/i386/ being broken;
> when I finally got it to compile, it didn’t even build as much as
> a simple hello world MessageBoxW() programme (erroring out with a
> redefinition warning of ▶ (yes, a right-arrow)… I gave up there.

Have you resolved your problems?  If you post the error messages,  
I'll take a look at it.

Thorsten Glaser | 24 Jan 2009 13:36
Picon
Gravatar

Re: wide character/string support for pcc

Gregory McGarry dixit:

>> a simple hello world MessageBoxW() programme (erroring out with a
>> redefinition warning of ▶ (yes, a right-arrow)… I gave up there.
>
> Have you resolved your problems?  If you post the error messages, I'll take a
> look at it.

Sorry, I didn’t have any time for that any more.

//mirabilos
--

-- 
17:57 < jtsn> Der 25C3 ist lustig. Deutsche Vortragende brechen sich vor
deutschen Zuhörern auf Englisch einen ab. ;-)  18:01 < jtsn> Adolfs Werk
war sehr nachhaltig. ;-)    18:01 < jtsn> Das gab's nichtmal in der DDR,
das Deutsche mit Deutschen auf Russisch reden. ;-)          (10x cnuke <at> )

Thorsten Glaser | 24 Jan 2009 13:46
Picon
Gravatar

Re: wide character/string support for pcc

Gregory McGarry dixit:

> Currently, pcc defines WCHAR_TYPE in the arch-specific macdefs.h, which is
> clearly wrong, since it's a property of the C library.  Your patch moves the
> definition into the configure script.  However, it's not really a property of
> the OS.

Actually, it’s a property of the ABI. To simplify things, we assume there
are only two types of wchar_t – 16-bit and 32-bit – and do not really care
whether it’s signed/unsigned, int/long, etc. if it is (after all, we _are_
using Unicode code points here). wint_t is always 32 bit, due to promotion
rules.

However, MirBSD, glibc and (with my patch) pcc are the only operating en-
vironments I know of who define __STDC_ISO_10646__, so, while I agree that
the _size_ of wchar_t should be the same with pcc as it is with the native
compiler, the _semantics_ almost always do *not* match. This is by design.

> Is it appropriate to detect the type of wchar_t in configure.ac and set
> WCHAR_TYPE?

I don’t think so. We should define it “somewhere” – gcc/gcc/config/*.h is
the place where gcc does it, and I really don’t care if pcc defines it in
the macdefs.h file or via config.h, *BUT* the definition has to be visi-
ble in more places than macdefs.h can reach, so I’m all for the hardcoding
thing in configure, however much this is normally frowned upon.

Note that gcc has -fshort-wchar (mostly for Wine), but -fno-short-wchar
does not set the size to 32 bit if it had been 16 bit beforehand.

(Continue reading)

Gregory McGarry | 24 Jan 2009 23:35

Re: wide character/string support for pcc


On 24/01/2009, at 11:46 PM, Thorsten Glaser wrote:

>> Alternatively, I thought it might be better to define  
>> __builtin_wchar_t in the
>> compiler.  There's no precedent for this in gcc AFAICT.
>
> /usr/include/stddef.h:typedef   __WCHAR_TYPE__  wchar_t;
> /usr/include/stdlib.h:typedef   __WCHAR_TYPE__  wchar_t;
> /usr/include/wchar.h:typedef    __WCHAR_TYPE__  wchar_t;
>
> I don’t like __builtin_wchar_t because you’d have to patch the  
> headers.
> There _is_ precedent for __WCHAR_TYPE__ – and any OS using GCC already
> will not have to be patched.

Thanks for the info.

I've committed your patch relating to handling of WCHAR_TYPE.

Thorsten Glaser | 25 Jan 2009 17:14
Picon
Gravatar

Re: CVS commit: pcc

Gregory McGarry dixit:

>Provide cpp definitions of __STDC_ISO_10646__

You can’t do that before the rest of the wchar_t patch is committed…
but thanks for the attention.

//mirabilos
--

-- 
17:57 < jtsn> Der 25C3 ist lustig. Deutsche Vortragende brechen sich vor
deutschen Zuhörern auf Englisch einen ab. ;-)  18:01 < jtsn> Adolfs Werk
war sehr nachhaltig. ;-)    18:01 < jtsn> Das gab's nichtmal in der DDR,
das Deutsche mit Deutschen auf Russisch reden. ;-)          (10x cnuke <at> )

Thorsten Glaser | 25 Jan 2009 17:13
Picon
Gravatar

Re: CVS commit: pcc-libs/libpcc/include

Gregory McGarry dixit:

>Use compiler-supplied macros for types (if availabel): __OFF_T__,

Never seen that one.

//mirabilos
--

-- 
17:57 < jtsn> Der 25C3 ist lustig. Deutsche Vortragende brechen sich vor
deutschen Zuhörern auf Englisch einen ab. ;-)  18:01 < jtsn> Adolfs Werk
war sehr nachhaltig. ;-)    18:01 < jtsn> Das gab's nichtmal in der DDR,
das Deutsche mit Deutschen auf Russisch reden. ;-)          (10x cnuke <at> )


Gmane