Red Hat axp-list: Linux on Alpha (1995-2022)
 help / color / mirror / Atom feed
From: Peter Rye <prye@picu-sgh.demon.co.uk>
To: axp-list@redhat.com
Subject: Re: More Apps porting to Alpha
Date: 10 Nov 1998 07:56:18 -0000	[thread overview]
Message-ID: <19981110075618.8800.qmail@picu-sgh.demon.co.uk> (raw)
In-Reply-To: <3647BE4B.2DC89988@msa.dec.com> (message from Wai-Sun Chia on Tue, 10 Nov 1998 12:17:15 +0800)

>>>>> "Wai-Sun" == Wai-Sun Chia <waisun@msa.dec.com> writes:

    Wai-Sun> To anyone who tried to build WindowMaker on Alpha-Linux and
    Wai-Sun> failed, just so that you feel better, you're not alone!

    Wai-Sun> Actually, after a couple of hours of investigation and
    Wai-Sun> confirmation, here's my result:

    Wai-Sun> Kernel: v2.1.125 Egcs: 1.1b OS: RedHat 5.1, 5.2

    Wai-Sun> Apparently EGCS craps out when a variable is defined as the
    Wai-Sun> arch name: i.e. alpha, i386, arm, m68k, mips, ppc, sparc,
    Wai-Sun> sparc64

    Wai-Sun> I've confirmed it with i386 and alpha. To test yourself, try
    Wai-Sun> to compile the following simple program:

    Wai-Sun> ******************** try.c ********************* #include
    Wai-Sun> <stdio.h>

    Wai-Sun> int main() { int alpha = 1; printf("alpha = %d\n", alpha);
    Wai-Sun> return 0; } 
    Wai-Sun> ************************************************
    Wai-Sun> You will get a "parse error before `1'". If you change alpha
    Wai-Sun> to nalpha or beta or anything other than alpha, then it'll
    Wai-Sun> work!!!

This is very interesting.
I'm running WindowMaker here and it compiled without problems.

Kernel: 2.1.126 Egcs: 1.1b OS: Red Hat 5.0 +patches

picu-sgh:~$ uname -a
Linux picu-sgh.demon.co.uk 2.1.126 #2 Sat Oct 24 22:00:26 BST 1998 alpha unknown
picu-sgh:~$ gcc --version
egcs-2.91.57
picu-sgh:~$ cat junk.c
#include <stdio.h>

int main()
{
	int alpha = 1;
	printf("alpha = %d\n", alpha);
	return 0;
}
picu-sgh:~$ gcc -o junk -Wall -ansi -pedantic junk.c
picu-sgh:~$ ./junk
alpha = 1



    Wai-Sun> Furthermore, if you s/alpha/i386/g in an Intel Linux box,
    Wai-Sun> guess what?  Same problem!!!

    Wai-Sun> Perhaps the GCC/EGCS developers think that any programmer
    Wai-Sun> which defines a variable with the name as "i386" ought to be
    Wai-Sun> shot, but "alpha" is a pretty common variable. This is
    Wai-Sun> especially so in the graphics world where there is such a
    Wai-Sun> thing as an alpha-channel: in fact if you were to do a
    Wai-Sun> recursive grep in the WindowMaker sources, you'd be swamped!

    Wai-Sun> At first, I tried to rename the alpha variables to something
    Wai-Sun> else one by one, after the 10th file in the first
    Wai-Sun> subdirectory, I gave up. I tried to be smart and put this is
    Wai-Sun> the WindowMaker's system header file, "wraster.h" (this is
    Wai-Sun> WindowMaker 0.20.2):

    Wai-Sun> #define alpha wmalpha


    Wai-Sun> And voila! WM compiles OK! albeit tons and tons of warning
    Wai-Sun> messages, it runs too! But the graphics (icons and colors) and
    Wai-Sun> totally kaput!  Apparently my "smart hack" changed the
    Wai-Sun> semantics of the system.... :-(

    Wai-Sun> This is what I see our options: 1. Make sure _ALL_ apps don't
    Wai-Sun> use arch names as variables (if cross-platform is important)
    Wai-Sun> 2. Ask politely GCC/EGCS developers to kindly remove this
    Wai-Sun> constraint from the compilers.

    Wai-Sun> I haven't sent any emails to neither GCC/EGCS nor WindowMaker
    Wai-Sun> developers. Want to see what other people think...

    Wai-Sun> BTW, libpng also suffers from this "alpha" variable
    Wai-Sun> syndrome....


    Wai-Sun> -- Wai-Sun

    Wai-Sun> -- To unsubscribe: send e-mail to axp-list-request@redhat.com
    Wai-Sun> with 'unsubscribe' as the subject.  Do not send it to
    Wai-Sun> axp-list@redhat.com


  parent reply	other threads:[~1998-11-10 10:00 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1998-11-10  4:17 More Apps porting to Alpha Wai-Sun Chia
1998-11-10  5:21 ` B. James Phillippe
1998-11-10  5:27   ` Peter Petrakis
1998-11-10  8:26     ` Wai-Sun Chia
1998-11-10  5:27   ` Peter Petrakis
1998-11-10  8:50   ` philb
1998-11-10  5:34 ` Alex Pilosov
1998-11-10  8:16   ` Wai-Sun Chia
1998-11-10  7:56 ` Peter Rye [this message]
1998-11-10 10:06   ` Wai-Sun Chia
1998-11-10 12:51 ` Paul Tomblin
1998-11-10 13:59 ` Alvin Starr
read-only archive

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox