Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

GCC-4.4.0

8 views
Skip to first unread message

Andris Pavenis

unread,
May 25, 2009, 1:22:36 AM5/25/09
to DJGPP List (E-mail)
Built GCC-4.4.0 for DJGPP. This time had to leave Ada out as the
Ada library fails to build. At least I did not found easily enough
how to get it to build for system without sockets support.

All stuff is at

http://ap1.pp.fi/djgpp/gcc/

As usually the first step was to build Linux to DJGPP cross-compiler.
Cross-compiler RPM packages are in subdirectory rpm. I built binary
RPMS in 32 bit CentOS 5.3 chroot under Fedora 10 x86_64. So hopefully
they should be compatible enough and be usable also for other
distributions.

Packages for DJGPP v2.03r2 are in subdirectory v203 and for development
version of DJGPP v2.04 in subdirectory v2.04. Packages were built under
Windows Vista Business SP1.

Not much testing done, so there should be a possibility to do more ...

Also, if there is wish to have Ada back, somebody will have to help in
this. I will almost surely have not enough time for doing it myself.
The easiest would perhaps to try for that at first to enable building Ada
compiler when building Linux to DJGPP cross-compiler. One could edit
specs file to skip bootstrapping at first native compiler as it takes
much time.

Andris

Rugxulo

unread,
May 25, 2009, 8:41:08 AM5/25/09
to
Hi,

On May 25, 12:22 am, Andris Pavenis <andris.pave...@iki.fi> wrote:
>
> Built GCC-4.4.0 for DJGPP.

Thanks! (Now to figure out and test the "optimize" and "target"
#pragmas.)

> This time had to leave Ada out as the
> Ada library fails to build. At least I did not found easily enough
> how to get it to build for system without sockets support.
>

> ...
>
> Also, if there is wish to have Ada back, somebody will have to help in
> this. I will almost surely have not enough time for doing it myself.
> The easiest would perhaps to try for that at first to enable building Ada
> compiler when building Linux to DJGPP cross-compiler. One could edit
> specs file to skip bootstrapping at first native compiler as it takes
> much time.

Do you know why sockets are needed at all? Is it due to tasking? I
still naively think WATT-32 might work, but who knows. Have you tried
asking for more specific help on the GCC mailing lists or in
comp.lang.ada?

Andris Pavenis

unread,
May 25, 2009, 8:56:04 AM5/25/09
to dj...@delorie.com
On 05/25/2009 03:41 PM, Rugxulo wrote:
> Hi,
>
> On May 25, 12:22 am, Andris Pavenis<andris.pave...@iki.fi> wrote:
>
>> Built GCC-4.4.0 for DJGPP.
>>
> Thanks! (Now to figure out and test the "optimize" and "target"
> #pragmas.)
>
>
Never used those. Perhaps the best source is the documentation (archives
present at specified URL even if not montioned in earlier post) or gcc-help
mailing list if the information is not found in documentation.

>> This time had to leave Ada out as the
>> Ada library fails to build. At least I did not found easily enough
>> how to get it to build for system without sockets support.
>>
>> ...
>>
>> Also, if there is wish to have Ada back, somebody will have to help in
>> this. I will almost surely have not enough time for doing it myself.
>> The easiest would perhaps to try for that at first to enable building Ada
>> compiler when building Linux to DJGPP cross-compiler. One could edit
>> specs file to skip bootstrapping at first native compiler as it takes
>> much time.
>>
> Do you know why sockets are needed at all? Is it due to tasking? I
> still naively think WATT-32 might work, but who knows. Have you tried
> asking for more specific help on the GCC mailing lists or in
> comp.lang.ada?
>

Absence of tasking does not cause problem. Trying to specify
that sockets are not supported for system does.

When I tried to specify that sockets are not
supported, I got build errors for libada. I do not have enough time
for fixing that (I do not know Ada well enough either), so the help is
appreciated.

Andris

Rugxulo

unread,
May 25, 2009, 5:17:16 PM5/25/09
to
Hi,

On May 25, 7:56 am, Andris Pavenis <andris.pave...@iki.fi> wrote:
> On 05/25/2009 03:41 PM, Rugxulo wrote:> Hi,
>

> > Thanks! (Now to figure out and test the "optimize" and "target"
> > #pragmas.)
>
> Never used those.

They're new. :-)

> Perhaps the best source is the documentation (archives
> present at specified URL even if not montioned in earlier post) or gcc-help
> mailing list if the information is not found in documentation.

Yes, I know. I tried (and tried and tried ...). What I discovered is
that "__attribute__((optimize(2)))" works on function prototypes
(only), good!, but "#pragma GCC optimize" seems to be a complete no-
op, does nothing (or else I did it wrong, searching didn't really help
for that). Same results with unofficial MinGW GCC 4.4.0, also.

> When I tried to specify that sockets are not
> supported, I got build errors for libada. I do not have enough time
> for fixing that (I do not know Ada well enough either), so the help is
> appreciated.

I wish I could help, but I don't know Ada at all, and obviously don't
have the skills to participate more. :-(

Andris Pavenis

unread,
May 26, 2009, 1:39:05 AM5/26/09
to dj...@delorie.com
On 05/26/2009 12:17 AM, Rugxulo wrote:
> Hi,
>
> On May 25, 7:56 am, Andris Pavenis<andris.pave...@iki.fi> wrote:
>
>> On 05/25/2009 03:41 PM, Rugxulo wrote:> Hi,
>>
>>
>>> Thanks! (Now to figure out and test the "optimize" and "target"
>>> #pragmas.)
>>>
>> Never used those.
>>
> They're new. :-)
>
>
>> Perhaps the best source is the documentation (archives
>> present at specified URL even if not montioned in earlier post) or gcc-help
>> mailing list if the information is not found in documentation.
>>
> Yes, I know. I tried (and tried and tried ...). What I discovered is
> that "__attribute__((optimize(2)))" works on function prototypes
> (only), good!, but "#pragma GCC optimize" seems to be a complete no-
> op, does nothing (or else I did it wrong, searching didn't really help
> for that). Same results with unofficial MinGW GCC 4.4.0, also.
>
>
If there is no help from the documentation then You can ask in gcc-help
mailing list (search archives at first: http://gcc.gnu.org/lists.html).

I myself usually avoid using constructions specific to GCC only even if
I do not use different compilers. The exception is
'__attribute__((format(...'
which allows to have printf or scanf style argument list cheking.

>> When I tried to specify that sockets are not
>> supported, I got build errors for libada. I do not have enough time
>> for fixing that (I do not know Ada well enough either), so the help is
>> appreciated.
>>
> I wish I could help, but I don't know Ada at all, and obviously don't
> have the skills to participate more. :-(
>

The message was sent to mailing list, so maybe somebody who can and want
it will read the message. I'm afraid however that the probability of this
happening is rather small unfortunatelly.

Andris

Rugxulo

unread,
May 26, 2009, 2:21:10 AM5/26/09
to
Hi,

On May 26, 12:39 am, Andris Pavenis <andris.pave...@iki.fi> wrote:
> On 05/26/2009 12:17 AM, Rugxulo wrote:
>
> > On May 25, 7:56 am, Andris Pavenis<andris.pave...@iki.fi>  wrote:
>

> >> Perhaps the best source is the documentation (archives
> >> present at specified URL even if not montioned in earlier post) or gcc-help
> >> mailing list if the information is not found in documentation.
>
> > Yes, I know. I tried (and tried and tried ...). What I discovered is
> > that "__attribute__((optimize(2)))" works on function prototypes
> > (only), good!, but "#pragma GCC optimize" seems to be a complete no-
> > op, does nothing (or else I did it wrong, searching didn't really help
> > for that). Same results with unofficial MinGW GCC 4.4.0, also.
>
> If there is no help from the documentation then You can ask in gcc-help
> mailing list (search archives at first:http://gcc.gnu.org/lists.html).

I did search there (well, May at least), not easy to find otherwise. I
also found an old (11-month old?) patch regarding this, didn't shed a
lot of light. I tried a bunch of variations, still nothing. And also
read some hint somewhere that some ICEs were a result of this new
feature, so maybe they did disable it (partially / fully) on some /
all targets, who knows. Anyways, it's not a big deal. Although, for
the record, I did find my app that previously ran fastest with -O3
(4.3.2) now runs fastest with 4.4.0's -O2 (12% slower with -O3), hence
some interest on my part. But I'm just lucky I benchmarked it first
instead of blindly assuming anything!

> >> When I tried to specify that sockets are not
> >> supported, I got build errors for libada. I do not have enough time
> >> for fixing that (I do not know Ada well enough either), so the help is
> >> appreciated.
>
> > I wish I could help, but I don't know Ada at all, and obviously don't
> > have the skills to participate more.   :-(
>
> The message was sent to mailing list, so maybe somebody who can and want
> it will read the message. I'm afraid however that the probability of this
> happening is rather small unfortunatelly.

BTW, thanks again for building 4.4.0, I actually was quite eager for
it for no huge reason (although I had already heard about "target" and
"optimize" pragmas), even downloading the unofficial MinGW 4.4.0
(blech, MSVCRT.DLL). ;-)

In short, being "stuck" to 4.3.2 / 4.3.3 for Ada wouldn't be the end
of the world. I mean, hey, it's Ada 83 / 95 / partial 2005, right? Not
too shabby. So thanks for what you've built so far. At least with
Gautier's 3d engine, DOS has at least one good publicly available
DJGPP Ada app! I mean, if people can still use TC++ 1.01 (and FreeDOS
does, somewhat), they can use "old" GCC 4.3.3 for many years. Worst
case scenario. :-)

Rugxulo

unread,
May 26, 2009, 5:35:09 PM5/26/09
to
Hi again,

On May 25, 12:22 am, Andris Pavenis <andris.pave...@iki.fi> wrote:
>
> Built GCC-4.4.0 for DJGPP. This time had to leave Ada out as the
> Ada library fails to build. At least I did not found easily enough
> how to get it to build for system without sockets support.
>
> All stuff is at
>
> http://ap1.pp.fi/djgpp/gcc/

This may be a silly thing to report, but it seems you left out the
GCC440B.MFT (etc.) files. Easy to create manually though ("unzip -
Z1"). Just FYI.

CBFalconer

unread,
May 26, 2009, 7:31:42 PM5/26/09
to
Rugxulo wrote:
>
... snip ...

>
> In short, being "stuck" to 4.3.2 / 4.3.3 for Ada wouldn't be the
> end of the world. I mean, hey, it's Ada 83 / 95 / partial 2005,
> right? Not too shabby. So thanks for what you've built so far.
> At least with Gautier's 3d engine, DOS has at least one good
> publicly available DJGPP Ada app! I mean, if people can still
> use TC++ 1.01 (and FreeDOS does, somewhat), they can use "old"
> GCC 4.3.3 for many years. Worst case scenario. :-)

I would suggest hunting down whoever originally ported Ada to
DJGPP.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.


Rugxulo

unread,
May 26, 2009, 11:49:26 PM5/26/09
to
Hi again,

On May 26, 12:39 am, Andris Pavenis <andris.pave...@iki.fi> wrote:
>
> >> Perhaps the best source is the documentation (archives
> >> present at specified URL even if not montioned in earlier post) or gcc-help
> >> mailing list if the information is not found in documentation.
>
> > Yes, I know. I tried (and tried and tried ...). What I discovered is
> > that "__attribute__((optimize(2)))" works on function prototypes

> > (only) ...


>
> If there is no help from the documentation then You can ask in gcc-help
> mailing list (search archives at first:http://gcc.gnu.org/lists.html).
>
> I myself usually avoid using constructions specific to GCC only even if
> I do not use different compilers.

More searching didn't really turn up anything, but here's the (old
old) June '08 patch for quick glance if you're curious:

http://gcc.gnu.org/ml/gcc-patches/2008-06/msg01435.html

So here's some more interesting info. Does the function attribute
work? Yes. I #ifdef'd around it just to be sure. As you can see,
there's an obvious speed difference, so something is getting
optimized! Good, proof it works! :-) But I also noticed the .EXE
size was bigger than my build yesterday for no obvious reason. It
seems the "optimize" attribute is adding 30k to the code size!! I
suspect this is a bug since I can't imagine needing to store any extra
info (even if LD did optimize for COFF, which I don't think it does,
only ELF).

EDIT: Unofficial MinGW 4.4.0 doesn't have this problem (actually,
its .EXE is < 1k smaller instead of bigger).

P.S. Using "-O3" on the cmdline always overrides "O2" in the pragma
(which is only bad because it's slower with -O3 here ... oh well).

=====================================================
#ifndef SLOW
#if GCC_VERSION >= 40400 // see CPP.INFO for the GCC_VERSION
define
#define FUNC_OPTIMIZE __attribute__((__optimize__("O2")))
int dot_product_noasm(short *t, short *w, int n) FUNC_OPTIMIZE ;
void train_noasm(short *t, short *w, int n, int err) FUNC_OPTIMIZE ;
#endif
#endif
=====================================================

-----------------------------------------------------
[ Vista/DJGPP ] - Tue 05/26/2009 >gmake paq8o8z CXXFLAGS="-DNOASM -s -
DSLOW" &
paq8o8z doydoy *.cpp & v *.exe & del paq8o8z paq8o8z.exe
gpp -DNOASM -s -DSLOW paq8o8z.cpp -o paq8o8z

paq8o8z compiled May 26 2009 by DJGPP 2.04 / G++ 4.4.0 for FreeDOS

514187264 bytes DPMI available
Creating archive doydoy.paq8o8z via level 1 with 1 file(s)...
paq8o8z.cpp 152203 -> 36049
152203 -> 36083
Time 27.86 sec, used 37286742 bytes of memory

-rwxr-xr-x 1 Rugxulo root 656896 May 26 22:06 paq8o8z.exe

[ Vista/DJGPP ] - Tue 05/26/2009 >gmake paq8o8z CXXFLAGS="-DNOASM -s"
&
paq8o8z doydoy *.cpp & v *.exe & del paq8o8z paq8o8z.exe
gpp -DNOASM -s paq8o8z.cpp -o paq8o8z

paq8o8z compiled May 26 2009 by DJGPP 2.04 / G++ 4.4.0 for FreeDOS

518434816 bytes DPMI available
Creating archive doydoy.paq8o8z via level 1 with 1 file(s)...
paq8o8z.cpp 152203 -> 36049
152203 -> 36083
Time 15.77 sec, used 37286742 bytes of memory

-rwxr-xr-x 1 Rugxulo root 686592 May 26 22:08 paq8o8z.exe

[ Vista/DJGPP ] - Tue 05/26/2009 >echo Notice the 30k size difference!
Notice the 30k size difference!

-----------------------------------------------------

Hope this helps in some way!

0 new messages