On Tue, May 02, 2000 at 11:10:32PM +0100, Gary V. Vaughan wrote:
> On Sat, Apr 22, 2000 at 09:53:42AM -0500, Bob Friesenhahn wrote:
> > The IRIX C/C++ compiler accepts aguments of the form "-LANG:std".
> > Options of this form must be specified in order to compile and link
> > C++ code, and possibly strict ANSI code.  Unfortunately, libtool
> > parses these options as being linker path options and does not supply
> > them properly to the compiler and linker.
> 
> This is a known problem with a workaround:  when building the libtool
> compile line, you should use -Wc,-LANG:std

I don't think it is so simple. The comments below pertain only to IRIX
C++ 7.3.1.1m. This compiler des not understand -Wc. From the man page
CC(1) it only understands the following arguments:
     -W c,arg1[,arg2...]
             Passes the argument(s) argi to the compiler pass c where c is
             one of [pKMfbal].  The c selects the compiler pass according
             to the following table:

             Name (-n32 or -64)            Character
             preprocessor                  p
             pca                           K (Automatic Parallelization
                                           Option Only; O32 ABI only)
             mpc
             fec                           f (See below)
             be                            b
             asm                           a
             ld                            l

             Sets of these phase names can be used to select any
             combination of phases.  For example, -Wba,-o,foo passes the
             option -o foo to the b and a phases.

The 7.3 compilers from SGI are more standards compliant than the 7.2
compilers. This compliance is enabled with "-LANG:std". This option
must be used when compiling and linking. So the following C++ program
will not compile under 7.3 without the -LANG:std switch:
  #include <iostream>

  int
  main (void) {
    std::cout << "Hello\n";

    return (1);
  }

  % CC std.cc
cc-1035 CC: WARNING File = /usr/include/CC/iosfwd, Line = 18
  #error directive:  This header file requires the -LANG:std option

  #error This header file requires the -LANG:std option
   ^

So we use the -LANG:std option:
  % CC -LANG:std std.cc

And everything works. Now, to satisfy libtool, we cannot use -LANG:std
because it eats it (this is the "multi-language-branch" of libtool).
So, we try to work around it with your solution above:

  % CC -Wf,-LANG:std std.cc

--- C++ prelinker: std.o ---
 /usr/bin/CC -c -DEFAULT:abi=n32:isa=mips3 -Wf,-LANG:std -n32 std.cc

--- C++ prelinker: std.o ---
 /usr/bin/CC -DEFAULT:abi=n32:isa=mips3 -c -DEFAULT:abi=n32:isa=mips3
-Wf,-LANG:std -n32 std.cc
ld32: ERROR   33 : Unresolved text symbol
"std::ios_base::_S_initialize(void)" -- 1st referenced by std.o.
        Use linker option -v to see when and which objects, archives
and dsos are loaded.  
ld32: ERROR   33 : Unresolved text symbol
"std::ios_base::_S_uninitialize(void)" -- 1st referenced by std.o.
        Use linker option -v to see when and which objects, archives
and dsos are loaded.  
  ...

So, that doesn't work. As -W[x] options can be combined, we use them
all in the hopes that one of them must work:
  % CC -WpKfbal,-LANG:std std.cc
ld32: ERROR   33 : Unresolved text symbol
"std::ios_base::_S_initialize(void)" -- 1st referenced by std.o.
        Use linker option -v to see when and which objects, archives
and dsos are loaded.  
  ...

So, I do not think it is possible to coerce the IRIX C++ compiler to
work without patching libtool to understand -LANG:.

-- 
albert chin ([EMAIL PROTECTED])

Reply via email to