EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

1994  1995  1996  <19971998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024  Index 1994  1995  1996  <19971998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
<== Date ==> <== Thread ==>

Subject: gnu cross-compiler problem
From: Rolf Keitel <[email protected]>
To: andrew_johnson <[email protected]>
Cc: [email protected]
Date: Tue, 15 Apr 1997 10:02:56 -0700
Hello Andrew,

I am trying to get our CAN-bus system going and ran into the following
problem with our
GNU cross-compiler. I am running Solaris 2.5,  and the cross-compiler
version is:

> cc68k -v
Reading specs from
/usr/local/gnu/solaris.68k/lib/gcc-lib/m68k-wrs-vxworks/cygnus-2.2.3.1/specs
gcc version cygnus-2.2.3.1


The offending code is in drvIpac.c in the routine ipmCheck:

    if (id->asciiI != 'I' || id->asciiP != 'P' || id->asciiA != 'A' ||
id->asciiC != 'C')
    {
	return S_IPAC_noIpacId;
    }
    return OK;

This piece of code returns S_IPAC_noIpacId. 

A control printout of the involved variables shows that the return
should be OK:

    printf("\n%x: %c %c %c %c\n", id, id->asciiI, id->asciiP,
id->asciiA, id->asciiC);
    printf("%x %x %x %x\n", id->asciiI, id->asciiP, id->asciiA,
id->asciiC);
    printf("%x %x %x %x\n", 'I', 'P', 'A', 'C');

-- start of control printout 
fff58080: I P A C
49 50 41 43
49 50 41 43
 
ipmCheck returns 2580006
value = 39321606 = 0x2580006
-- end of control printout

If I change the code to individual comparisons,
the return is OK: 

    if (id->asciiI != 'I')
    {
	return S_IPAC_noIpacId;
    }
    if (id->asciiP != 'P')
    {
	return S_IPAC_noIpacId;
    }
    if (id->asciiA != 'A')
    {
	return S_IPAC_noIpacId;
    }
    if (id->asciiC != 'C')
    {
	return S_IPAC_noIpacId;
    }
    return OK;

If I define intermediate variables, the return is also OK:

    uchar_t I, P, A, C;

    I = id->asciiI;
    P = id->asciiP;
    A = id->asciiA;
    C = id->asciiC;

    if (id->asciiI != 'I' || id->asciiP != 'P' || id->asciiA != 'A' ||
id->asciiC != 'C')
    {
	return S_IPAC_noIpacId;
    }
    return OK;

My make file produces the following compiler command line.

 > make
/usr/local/gnu/solaris.68k/bin/cc68k
-B/usr/local/gnu/solaris.68k/lib/gcc-lib/
  -c -O -W -m68040 -nostdinc -DV5_vxWorks -DvxWorks -DTARGET_OS=vxWorks
-DCPU=MC68040 
  -DV5_vxWorks -DCPU_FAMILY=MC680X0  -I../src -I../epicsH
-I../epicsH/rec 
  -I../vw/h ../src/drvIpac.c



Is this a known problem? 

				- rolf -

-- 
+----------------------------------------------------------+
: Rolf Keitel                |    [email protected]           :
: TRIUMF                     |    Tel: (604) 222-7453      :
: 4004 Wesbrook Mall         |    Fax: (604) 222-7307      :
: Vancouver, B.C., V6T 2A3   |    www.triumf.ca            :
+----------------------------------------------------------+

Replies:
gnu cross-compiler problem Peregrine McGehee
Re: gnu cross-compiler problem Andrew Johnson

Navigate by Date:
Prev: Buffer copying? Peregrine McGehee
Next: gnu cross-compiler problem Peregrine McGehee
Index: 1994  1995  1996  <19971998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
Navigate by Thread:
Prev: Re: Buffer copying? Jeff Hill
Next: gnu cross-compiler problem Peregrine McGehee
Index: 1994  1995  1996  <19971998  1999  2000  2001  2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014  2015  2016  2017  2018  2019  2020  2021  2022  2023  2024 
ANJ, 10 Aug 2010 Valid HTML 4.01! · Home · News · About · Base · Modules · Extensions · Distributions · Download ·
· Search · EPICS V4 · IRMIS · Talk · Bugs · Documents · Links · Licensing ·