swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: crossed ABIs


From: Jayshree Sarma
Subject: Re: crossed ABIs
Date: Tue, 23 Mar 1999 13:28:30 -0500 (EST)


On Tue, 23 Mar 1999, Jonathan Impett wrote:

> I've just got back to work to find several helpful suggestions as to an
> -n32 problem I was having making the NeuroLib demos. I'm not quite sure
> at what level it's best to fix the ABI, and just how to do it. I had
> trouble when my original compilation of swarm didn't use the -n32
> version of xpm, and found a way around with a link. Now something is
> trying to link with the -o32 libc.so.1.
>     Can anyone suggest a strategy. Is it something that should be set at
> the environment level, a flag that gets set in swarm, or a flag that in
> should give in the makefile or command line? (and - while you're there -
> how do I express this desire?)

  I guess you are talking about IRIX6.5 machine.

On our IRIX 6.5 machines the /etc/compiler.defaults file contains
the following line:

-DEFAULT:abi=n32:isa=mips4:proc=r10k

So when I use gcc to compile a file it seems to automatically compile
to the default n32 bits.  

When I use the file command to look at files I either get :

ELF N32 MSB mips-4 relocatable (not stripped) MIPS - version 1 (a *.o
file)

ELF N32 MSB mips-4 dynamic lib MIPS - version 1  (a lib file)

o32 compiled files show up as:

ELF 32-bit MSB mips-4 .....


First look at your compiler defaults to see what it is set for.
Then check your files to see what is compiled for. I have attached
a file I found at the comp.sys.sgi site when I ran into the same
problem. It has a few pointers.

Hope this helps.

Jayshree

Subject: Re: Force cc not to use o32
Date: 17 Mar 1999 00:00:00 GMT
From: address@hidden (David B Anderson)
Organization: Silicon Graphics, Inc., Mountain View, CA
Newsgroups: comp.sys.sgi.admin

In article <address@hidden>,
Frank B. Pound <address@hidden> wrote:
>Is there way compiler switch which will completely avoid linking
>with anything in the /usr/lib directory?
>I am having problems with old source picking up o32 libs, I
>know if they aren't there it looks in /usr/lib32.
>I have specified -n32 and SGI_ABI -n32 etc. etc.
>but somehow I keep picking up the old /usr/lib stuff.

>Frank B. Pound                    Phone: 703-560-5000 ext. 4008

>E-mail: address@hidden

If you have SGI_ABI set in the environment to -n32, and
are still getting /usr/lib, one guesses that
some Makefile or script explicitly mentions /usr/lib.

It would help if you posted the command (if it's cc, CC, f77, or f90,
add -show so you (we) get to see the real ld command).

You should probably also create the file
/etc/compiler.defaults

and put in it
-DEFAULT:abi=n32:isa=mips3

Unfortunately, the man page describing compiler.defaults
got packaged with pe_environ in the f90 package.
Oops.
And it is a bit too n32/64-centric too.

Here is an ascii version of the compiler.defaults part of the man page:

                    The compiler.defaults file contains the following line:

     -DEFAULT [:abi=abi] [:isa=mips_num] [:proc=proc_num] [:opt=opt_lvl]
     [:arith=arith_lvl]

                    The information in this file is used when compiling
                    code unless it is overridden by command line options.
                    The following list indicates the values to be specified
                    on the -DEFAULT line and the command line options that
                    supercede the -DEFAULT line specification:

                    abi       Specifies the Application Binary Interface
                    ___
                              (ABI).  The -n32 and -64 options to the
                              f90(1) command override this specification.
                              Specify either n32 or 64 for abi.

                    mips_num  Specifies the Instruction Set Architecture
                              (ISA).  The -mips4 and -mips4 options to the
                              f90(1) command override this specification.
                              Specify either mips3 or mips4 for mips_num.

                    proc_num  Specifies the processor number.  The -r4k,
                              -r5k, -r8k, and -r10k options to the f90(1)
                              command override this specification.  Specify
                              one of the following for proc_num:  r4k, r5k,
                              r8k, r10k.

                    opt_lvl   Specifies the general optimization level used
                              when compiling.  The -O0, -O1, -O2, and -O3
                              options to the f90(1) command override this
                              specification.  Specify one of the following
                              for opt_lvl:  0, 1, 2, 3.

                    arith_lvl Specifies the IEEE arithmetic level used when
                              compiling.  The -OPT:IEEE_arith option to the
                              f90(1) command overrides this specification.
                              Specify one of the following for arith_lvl:
                              1, 2, 3.

                    If no file is present, or if this environment variable
                    is not set, the compiler looks in the default
                    directory, which is /etc.

                    For example, the following command line:

                         %f90 -64 myfile.f

                    overrides a compiler.defaults file that contains:

                         -DEFAULT:abi=n32:isa=mips4:proc=r10k

                    and performs a -64, -mips4, -r10000 compilation.

Hope this helps.
David B. Anderson address@hidden address@hidden http://reality.sgi.com/davea/

reply via email to

[Prev in Thread] Current Thread [Next in Thread]