* Porting to Alpha
@ 1998-11-10 5:00 Wai-Sun Chia
1998-11-10 5:00 ` Robert Harley
1998-11-10 5:00 ` Einar Floystad Dorum
0 siblings, 2 replies; 3+ messages in thread
From: Wai-Sun Chia @ 1998-11-10 5:00 UTC (permalink / raw)
To anyone who tried to build WindowMaker on Alpha-Linux and failed, just
so that you feel better, you're not alone!
Actually, after a couple of hours of investigation and confirmation,
here's my result:
Kernel: v2.1.125
Egcs: 1.1b
OS: RedHat 5.1, 5.2
Apparently EGCS craps out when a variable is defined as the arch name:
i.e. alpha, i386, arm, m68k, mips, ppc, sparc, sparc64
I've confirmed it with i386 and alpha. To test yourself, try to compile
the following simple program:
******************** try.c *********************
#include <stdio.h>
int main()
{
int alpha = 1;
printf("alpha = %d\n", alpha);
return 0;
}
************************************************
You will get a "parse error before `1'". If you change alpha to nalpha
or beta or anything other than alpha, then it'll work!!!
Furthermore, if you s/alpha/i386/g in an Intel Linux box, guess what?
Same problem!!!
Perhaps the GCC/EGCS developers think that any programmer which defines
a variable with the name as "i386" ought to be shot, but "alpha" is a
pretty common variable. This is especially so in the graphics world
where there is such a thing as an alpha-channel: in fact if you were to
do a recursive grep in the WindowMaker sources, you'd be swamped!
At first, I tried to rename the alpha variables to something else one by
one, after the 10th file in the first subdirectory, I gave up. I tried
to be smart and put this is the WindowMaker's system header file,
"wraster.h" (this is WindowMaker 0.20.2):
#define alpha wmalpha
And voila! WM compiles OK! albeit tons and tons of warning messages, it
runs too! But the graphics (icons and colors) and totally kaput!
Apparently my "smart hack" changed the semantics of the system.... :-(
This is what I see our options:
1. Make sure _ALL_ apps don't use arch names as variables (if
cross-platform is important)
2. Ask politely GCC/EGCS developers to kindly remove this constraint
from the compilers.
I haven't sent any emails to neither GCC/EGCS nor WindowMaker
developers. Want to see what other people think...
BTW, libpng also suffers from this "alpha" variable syndrome....
--
Wai-Sun
^ permalink raw reply [flat|nested] 3+ messages in thread* Re: Porting to Alpha
1998-11-10 5:00 Porting to Alpha Wai-Sun Chia
@ 1998-11-10 5:00 ` Robert Harley
1998-11-10 5:00 ` Einar Floystad Dorum
1 sibling, 0 replies; 3+ messages in thread
From: Robert Harley @ 1998-11-10 5:00 UTC (permalink / raw)
Wai-Sun Chia <waisun@msa.dec.com> writes:
> Apparently EGCS craps out when a variable is defined as the arch name:
> i.e. alpha, i386, arm, m68k, mips, ppc, sparc, sparc64
>
> I've confirmed it with i386 and alpha. To test yourself, try to compile
> the following simple program:
> [...]
Well I had no such problem, but I can guess what the cause is. Try
compiling with the "-v" flag and you'll probably see that your spec
file causes a "-Dalpha" to be put on the command-line. In my case it
has "-D__alpha -D__alpha__" which is fine because identifiers starting
with __ are reserved for such uses. On the other hand it does have
"-Dlinux -Dunix" which is very naughty!
Also, send a report to egcs-bugs@cygnus.com.
Rob.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Porting to Alpha
1998-11-10 5:00 Porting to Alpha Wai-Sun Chia
1998-11-10 5:00 ` Robert Harley
@ 1998-11-10 5:00 ` Einar Floystad Dorum
1 sibling, 0 replies; 3+ messages in thread
From: Einar Floystad Dorum @ 1998-11-10 5:00 UTC (permalink / raw)
Wai-Sun Chia <waisun@msa.dec.com> writes:
> And voila! WM compiles OK! albeit tons and tons of warning messages, it
> runs too! But the graphics (icons and colors) and totally kaput!
> Apparently my "smart hack" changed the semantics of the system.... :-(
Your hack is not the problem here, the couple of latest WM releases
have had a problem with shared pixmaps not working on alpha. Try to
compile it without shared pixmaps support.
--
"I never knew anyone who understood my innermost feeling the way you
do." He looked at her affectionaly." "How do you do it?" "I have
infrared scanners," she said "I read the pattern of blood flow in your
face." Bruce Sterling Twenty Evocations
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~1998-11-10 5:00 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1998-11-10 5:00 Porting to Alpha Wai-Sun Chia
1998-11-10 5:00 ` Robert Harley
1998-11-10 5:00 ` Einar Floystad Dorum
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox