Sorry, previous patch was wrong.

Denis Ustimenko
--------------------------------------
*** orig/postgresql-7.1.3//src/makefiles/Makefile.solaris       О©╫О©╫ О©╫О©╫О©╫ 17
00:14:25 2000
--- postgresql-7.1.3//src/makefiles/Makefile.solaris    О©╫О©╫ О©╫О©╫О©╫ 17 14:33:11
2001
***************
*** 6,12 ****
  export_dynamic = -Wl,-E
  rpath = -Wl,-rpath,$(libdir)
  else
! rpath = -Wl,-R$(libdir)
  endif
  shlib_symbolic = -Wl,-Bsymbolic

--- 6,12 ----
  export_dynamic = -Wl,-E
  rpath = -Wl,-rpath,$(libdir)
  else
! rpath = -R$(libdir)
  endif
  shlib_symbolic = -Wl,-Bsymbolic

*** orig/postgresql-7.1.3//src/Makefile.shlib   О©╫О©╫ О©╫О©╫О©╫ 15 10:25:07 2001
--- postgresql-7.1.3//src/Makefile.shlib        О©╫О©╫ О©╫О©╫О©╫ 17 13:00:29 2001
***************
*** 179,185 ****
    ifeq ($(with_gnu_ld), yes)
      LINK.shared               += -Wl,-soname,$(soname)
    else
!     LINK.shared               += -Wl,-h,$(soname)
    endif
    SHLIB_LINK          += -lm -lc
  endif
--- 179,185 ----
    ifeq ($(with_gnu_ld), yes)
      LINK.shared               += -Wl,-soname,$(soname)
    else
!     LINK.shared               += -h $(soname)
    endif
    SHLIB_LINK          += -lm -lc
  endif



Wed, 17 Oct 2001 15:19:20 +0700 (NOVST)
Denis A Ustimenko <denis@oldham.ru>
compiling libpq++ on Solaris with Sun SPRO6U2 (fixed & tested)
Denis A Ustimenko writes:

[change -Wl,-R to -R and -Wl,-h to -h]

I'm having a difficult time understanding this.  Both -R and -h are linker
options, not compiler options.  So while the compiler driver might be nice
enough to recognize them as the former and pass them through, this change
just pushes these chances, and it doesn't add any theoretical change of
functionality.

So, if you want this to be fixed, you're going to have to start with
explaining your problem, and then we can start looking for solutions.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Wed, 17 Oct 2001 22:34:47 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed


whats wrong with kill -9' the postmaster
works fine for me hahahaa.



> Date: Wed, 17 Oct 2001 22:34:47 +0200 (CEST)
> From: Peter Eisentraut <peter_e@gmx.net>
> To: Denis A Ustimenko <denis@oldham.ru>
> Cc: pgsql-hackers@postgresql.org
> Subject: Re: [HACKERS] compiling libpq++ on Solaris with Sun SPRO6U2
>     (fixed
>
> Denis A Ustimenko writes:
>
> [change -Wl,-R to -R and -Wl,-h to -h]
>
> I'm having a difficult time understanding this.  Both -R and -h are linker
> options, not compiler options.  So while the compiler driver might be nice
> enough to recognize them as the former and pass them through, this change
> just pushes these chances, and it doesn't add any theoretical change of
> functionality.
>
> So, if you want this to be fixed, you're going to have to start with
> explaining your problem, and then we can start looking for solutions.
>
> --
> Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


Wed, 17 Oct 2001 15:19:11 -0700 (PDT)
Dan <dphoenix@bravenet.com>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed


On Wed, 17 Oct 2001, Peter Eisentraut wrote:

> Denis A Ustimenko writes:
>
> [change -Wl,-R to -R and -Wl,-h to -h]
>
> I'm having a difficult time understanding this.  Both -R and -h are linker
> options, not compiler options.  So while the compiler driver might be nice

Oh, no Peter:

denis@tracer$ CC -help|grep "\-h"
-h<name>              Assign <name> to generated dynamic shared library
-help                 Same as -xhelp=flags
denis@tracer$ CC -help|grep "\-R"
-R<p>[:<p>...]        Build runtime search path list into executable
denis@tracer$ cc -flags|grep "\-h"
-h <name>       Assign <name> to generated dynamic shared library
denis@tracer$ cc -flags|grep "\-R"
-R<dir[:dir]>   Build runtime search path list into executable

> enough to recognize them as the former and pass them through, this change
> just pushes these chances, and it doesn't add any theoretical change of
> functionality.
>
> So, if you want this to be fixed, you're going to have to start with
> explaining your problem, and then we can start looking for solutions.

The problem is simple. I can't compile libpq++.so with latest Sun's
compiler:
$ make
.........
CC  -KPIC -G -Wl,-h,libpq++.so.3 pgconnection.o pgdatabase.o pgtransdb.o
pgcursordb.o pglobject.o  -L../../../src/interfaces/libpq -lpq -lm -lc
-Wl,-R/usr/local/pgsql/lib -o libpq++.so.3.1
CC: Warning: Option -Wl,-h,libpq++.so.3 passed to ld, if ld is invoked,
ignored otherwise
CC: Warning: Option -Wl,-R/usr/local/pgsql/lib passed to ld, if ld is
invoked, ignored otherwise
/usr/ccs/bin/ld: illegal option -- W
/usr/ccs/bin/ld: illegal option -- W
usage: ld [-6:abc:d:e:f:h:il:mo:p:rstu:z:B:D:F:GI:L:M:N:P:Q:R:S:VY:?]
file(s)
        [-64]           enforce a 64-bit link-edit
.........

But "CC  -KPIC -G -h libpq++.so.3 ... -R/usr/local/pgsql/lib ..."
works fine for me.

Regards
Denis Ustimenko


Thu, 18 Oct 2001 10:07:42 +0700 (NOVST)
Denis A Ustimenko <denis@oldham.ru>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
It's really quite simple, the Sun C compiler (acc) does not understand
the -Wl flag, rather it passes the -R and -h options onto the linker
verbatim.

Given the only two (realistic) compiler choices under Solaris are gcc
and acc it makes sense to support then both 'out of the box'.

I keep a similar patch to Denis's (without the wierd hi-ascii
characters in his) lying around for when i build a Solaris version.

Regards, Lee Kindness.

Peter Eisentraut writes:
 > Denis A Ustimenko writes:
 > 
 > [change -Wl,-R to -R and -Wl,-h to -h]
 > 
 > I'm having a difficult time understanding this.  Both -R and -h are linker
 > options, not compiler options.  So while the compiler driver might be nice
 > enough to recognize them as the former and pass them through, this change
 > just pushes these chances, and it doesn't add any theoretical change of
 > functionality.
 > 
 > So, if you want this to be fixed, you're going to have to start with
 > explaining your problem, and then we can start looking for solutions.
 > 
 > -- 
 > Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter
 > 
 > 
 > ---------------------------(end of broadcast)---------------------------
 > TIP 4: Don't 'kill -9' the postmaster

Thu, 18 Oct 2001 09:17:55 +0100 (BST)
Lee Kindness <lkindness@csl.co.uk>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
For your information I've attached the man page for the Sun C
compiler, which explicitly lists the -h and -R flags.

Regards, Lee Kindness.

Lee Kindness writes:
 > It's really quite simple, the Sun C compiler (acc) does not understand
 > the -Wl flag, rather it passes the -R and -h options onto the linker
 > verbatim.
 > Peter Eisentraut writes:
 >  > I'm having a difficult time understanding this.  Both -R and -h are linker
 >  > options, not compiler options.  So while the compiler driver might be nice
 >  > enough to recognize them as the former and pass them through, this change
 >  > just pushes these chances, and it doesn't add any theoretical change of
 >  > functionality.


User Commands                                              acc(1)

NAME
     acc - C compiler

SYNOPSIS
     acc [ -Aname [(tokens) ] ] [ -a ] [ -B [static|dynamic] ]
     [ -C ] [ -c ] [ -cg89 ] [ -cg92 ] [ -Dname [=token ] ]
     [ -dalign ] [ -d [y|n] ] [ -dryrun ] [ -E ] [ -fast ]
     [ -fd ] [ -flags ] [ -fnonstd ] [ -fns ] [ -fround=r ]
     [ -fsimple[=n] ] [ -fsingle ] [ -ftrap=t ] [ -G ]
     [ -g ] [ -H ] [ -help ] [ -hname ] [ -Idir ]
     [ -inline=[f1,...,fn] ] [ -KPIC ] [ -Kpic ] [ -keeptmp ]
     [ -Ldir ] [ -lname ] [ -libmieee ] [ -libmil ] [ -M ]
     [ -misalign ] [ -misalign2 ] [ -mt ] [ -native ] [ -nolib  ]
     [ -nolibmil ] [ -noqueue ] [ -O[1|2|3|4|5] ]
     [ -o outputfile ] [ -P ] [ -p ] [ -pg ] [ -PIC ] [ -pic ]
     [ -Qdir dir ] [ -Qoption c arg ] [ -Qpath dir ]
     [ -Qproduce srctype ] [ -qdir dir ] [ -qoption c arg ]
     [ -qpath dir ] [ -qproduce srctype ]
     [ -R dir[:dir] ] [ -S ] [ -s ] [ -sb ] [ -sbfast ]
     [ -strconst ] [ -temp=dir ] [ -time ] [ -Uname ]
     [ -unroll =n ] [ -V ] [ -v ] [ -vc ] [ -w ]
     [ -X [a |c |s |t ]] [ -xa ] [ -xarch=a ] [ -xautopar ]
     [ -xcache=c ] [ -xCC ] [ -xcg89 ] [ -xcg92 ] [ -xchip=c ]
     [ -xdepend ] [ -xe ] [ -xexplicitpar ]
     [ -xF ] [ -xhelp=f ] [ -xildoff ]
     [ -xildon ] [ -xinline=[f1,...,fn] ] [ -xlibmieee ]
     [ -xlibmil ] [ -xlicinfo ] [ -xloopinfo ] [ -xM ] [ -xM1 ]
     [ -xMerge ] [ -xnolib ] [ -xnolibmil ] [ -xO[1|2|3|4|5] ]
     [ -xP ] [ -xparallel ] [ -xpg ] [ -xprofile=p ]
     [ -xreduction ] [ -xregs=r ]
     [ -xrestrict=f ] [ -xs ] [ -xsafe=mem ] [ -xsb ]
     [ -xsbfast ] [ -xsfpconst ] [ -xspace ]
     [ -xstrconst ] [ -xtarget=t ] [ -xtemp=dir ] [ -xtime ]
     [ -xtransition ] [ -xunroll=n ] [ -xvpara ] [ -Y,dir ]
     [ -Zll ] [ -Zlp ] [ -Ztha ]

DESCRIPTION
     acc (SPARC only) is not intended  to  be  used  directly  on
     Solaris  2.x.  The  sole  purpose for making it available on
     Solaris 2.x is to enable /usr/ucb/cc.  The package  SUNWscpu
     must  be installed to use this.  The options for /usr/ucb/cc
     are the same as for acc and are described here.

     acc is the C compiler. It translates programs written in the
     C programming language into executable load modules, or into
     relocatable binary programs for subsequent loading with  the
     ld(1) link editor.

     In addition to the many options, acc accepts  several  types
     of  filename arguments.  For instance, files with names end-
     ing in .c are taken to be C source programs. They  are  com-
     piled,  and  each  resulting object program is placed in the
     current directory.  The  object  file  is  named  after  its
     source  file - the suffix .o replacing .c in the name of the
     object.  In the same way, files whose names end with .s  are
     taken  to  be assembly source programs.  They are assembled,
     and produce .o files. Filenames ending in .il are  taken  to
     be  inline  expansion code template files; these are used to
     expand calls to selected routines in-line when code  optimi-
     zation  is enabled.  See FILES, below for a complete list of
     compiler-related filename suffixes.

     Other arguments refer to assembler or loader options, object
     programs,  or  object  libraries.   Unless  -c, -S, -E -P or
     -Qproduce  is  specified,  these  programs  and   libraries,
     together  with  the results of any specified compilations or
     assemblies, are linked (in the order given)  to  produce  an
     output  file  named  a.out.   You can specify a name for the
     executable by using the -o option.

     If a single file is compiled and linked  all  at  once,  the
     intermediate files are deleted.

OPTIONS
     When debugging or profiling objects are compiled  using  the
     -g  or -pg options, respectively, the ld command for linking
     them should also contain the appropriate option.

     See ld(1) for link-time options.

     -a   Insert code to count how many times each basic block is
          executed.  This is the old style of basic block profil-
          ing for tcov. See -xprofile=tcov for information on the
          new  style  of  profiling  and the tcov(1) man page for
          more details.

          Invokes a runtime recording mechanism that creates a .d
          file for every .c file (at normal termination).  The .d
          file accumulates execution data for  the  corresponding
          source  file.   The  tcov(1) utility can then be run on
          the source file to generate statistics about  the  pro-
          gram. This option is incompatible with -g .

     -Aname[(tokens)]
          Associate name as a predicate with the specified tokens
          as if by a #assert preprocessing directive.
          Preassertions:
                   system(unix)
                   cpu(sparc)
                   machine(sparc)

          The above are not predefined in -Xc mode.

          If -A is followed by a dash (-)  only,  it  causes  all
          predefined macros (other than those that begin with __)
          and predefined assertions to be forgotten.

     -B [static|dynamic]
          -B dynamic causes the link editor  to  look  for  files
          named  libx.so  and  then  for  files named libx.a when
          given the -lx option.  -B static causes the link editor
          to  look  only for files named libx.a.  This option may
          be specified multiple times on the command  line  as  a
          toggle.  This option and its argument are passed to ld.

     -C   Cause the preprocessor to pass along all comments other
          than those on preprocessing directive lines.

     -c   Suppress linking with ld(1) and produce a .o  file  for
          each  source  file.   A single object file can be named
          explicitly using the -o option.

     -cg89
          This option is a macro for:
          =xarch=v7 -xchip=old -xcache=64/32/1.

     -cg92
          This option is a macro for:
          =xarch=v8 -xchip=super -xcache=16/64/4:1024/64/1.

     -Dname[=token]
          Associates name with the specified token  as  if  by  a
          #define  preprocessing  directive.   If  no  =token  is
          specified, the token 1 is supplied.
          Predefinitions:
                   sparc
                   sun
                   unix

          The above are not predefined in -Xc mode.
          These predefinitions are valid in all modes:
                   __sparc,
                   __unix,
                   __sun,
                   __BUILTIN_VA_ARG_INCR
                   __SUNPRO_C=0x400
                   __SVR4
                   __`uname -s` `uname -r`

     -dalign
          Generate double-word load/store  instructions  whenever
          possible  for  improved  performance.  Assumes that all
          double and long long type data are double-word aligned,
          and  should  not  be used when correct alignment is not
          assured.

     -d [y|n]
          -dy specifies dynamic linking, which is the default, in
          the  link  editor.  -dn specifies static linking in the
          link editor.  This option and its argument  are  passed
          to ld.

     -dryrun
          Show but do not execute the commands constructed by the
          compilation driver.

     -E   Preprocess only the named C files and send  the  result
          to  the  standard  output.   The  output  will  contain
          preprocessing directives for use by the  next  pass  of
          the compilation system.

     -fast
          Select the optimum combination of  compilation  options
          for  speed.   This  should provide close to the maximum
          performance for most  realistic  applications.  Modules
          compiled with -fast , must also be linked with -fast .

          It is a convenience option, and it chooses the  fastest
          code  generation  option  available on the compile-time
          hardware, the optimization level -O2, a set  of  inline
          expansion  templates, the -fns option, the -ftrap=%none
          option, and the -dalign option.

          If you combine  -fast  with  other  options,  the  last
          specification applies.  The code generation option, the
          optimization level and using inline template files  can
          be  overridden  by  subsequent  switches.  For example,
          although the optimization part of -fast is  -O2  ,  the
          optimization part of -fast -O1 is -O1 .

          Do not use this option for programs that depend on IEEE
          standard  exception  handling;  you  can  get different
          numerical results, premature  program  termination,  or
          unexpected SIGFPE signals.

     -fd  Report old-style function definitions and declarations.

     -flags
          Print a summary of each compiler option.

     -fnonstd
          This option is a macro for -fns and -ftrap=common.

     -fns Turn on the SPARC nonstandard floating-point mode.

          The default is the SPARC standard floating-point mode.

          If you compile one routine with -fns, then compile  all
          the  program  routines with the -fns option; otherwise,
          you can get unexpected results.

     -fround=r
          Set the IEEE 754 rounding mode that is  established  at
          runtime during the program initialization.

          r must be one of: nearest, tozero, negative, positive.

          The default is -fround=nearest.

          The meanings are the same as those for  the  ieee_flags
          subroutine.

          If you compile one routine with -fround=r, compile  all
          the  program  routines  with the same -fround=r option;
          otherwise, you can get unexpected results.

     -fsimple[=n]
          Allow the optimizer  to  make  simplifying  assumptions
          concerning  floating-point arithmetic. If n is present,
          it must be 0, 1, or 2.

          The defaults are:
          o  With no -fsimple[=n], the compiler uses -fsimple=0.
          o  With only -fsimple, no =n, the compiler uses  -fsim-
          ple=1.

          -fsimple=0
          Permit no simplifying assumptions. Preserve strict IEEE
          754 conformance.

          -fsimple=1
          Allow conservative simplifications. The resulting  code
          does  not  strictly  conform  to  IEEE 754, but numeric
          results of most programs are unchanged.

          With -fsimple=1, the optimizer can assume  the  follow-
          ing:
          o  The IEEE 754 default rounding/trapping modes do  not
          change after process initialization.
          o Computations producing no visible result  other  than
          potential floating- point exceptions may be deleted.
          o Computations with Infinity or NaNs as  operands  need
          not  propagate  NaNs to their results. For example, x*0
          may be replaced by 0.
          o Computations do not depend on sign of zero.

          With -fsimple=1, the optimizer is not allowed to optim-
          ize  completely  without  regard  to roundoff or excep-
          tions. In particular, a floating-point computation can-
          not  be replaced by one that produces different results
          with rounding modes held constant at  run  time.  -fast
          implies -fsimple=1.

          -fsimple=2
          Permit aggressive floating point optimizations that may
          cause   many  programs  to  produce  different  numeric
          results due to changes in rounding. For example, permit
          the  optimizer  to replace all computations of x/y in a
          given loop with x*z, where  x/y  is  guaranteed  to  be
          evaluated  at  least  once  in the loop, z=1/y, and the
          values of y and z are known  to  have  constant  values
          during execution of the loop.

          Even with -fsimple=2, the optimizer still is  not  per-
          mitted  to  introduce  a  floating point exception in a
          program that otherwise produces none.

     -fsingle
          ( -Xt and -Xs  modes  only).  Causes  the  compiler  to
          evaluate  float  expressions as single precision rather
          than double precision.  (This option has no  effect  if
          the  compiler  is  used  in either -Xa or -Xc modes, as
          float expressions are already evaluated as single  pre-
          cision.)

     -ftrap=t
          Set the IEEE 754 trapping mode in effect at startup.

          t is a comma-separated list that  consists  of  one  or
          more   of   the   following:   %all,   %none,   common,
          [no%]invalid,      [no%]overflow,       [no%]underflow,
          [no%]division, [no%]inexact.

          The default is -ftrap=%none.

          This option sets the IEEE 754 trapping modes  that  are
          established  at  program initialization.  Processing is
          left-to-right.  The common exceptions,  by  definition,
          are invalid, division by zero, and overflow.

          Example: -ftrap=%all,no%inexact means  set  all  traps,
          except inexact.

          The meanings are the same as for the ieee_flags subrou-
          tine, except that:
          o %all turns on all the trapping modes.
          o %none, the default, turns off all trapping modes.
          o A no% prefix turns off that specific trapping mode.

          If you compile one routine with -ftrap=t,  compile  all
          routines  of the program with the same -ftrap=t option;
          otherwise, you can get unexpected results.
     -G   Direct the link  editor  to  produce  a  shared  object
          rather  than  a  dynamically  linked  executable.  This
          option is passed to ld.  It cannot be used with the -dn
          option.

     -g   Produce additional symbol table information for dbx(1).

          The -g option makes  -xildon  the  default  incremental
          linker  option. See -xildon.  Invoke ild in place of ld
          unless any of the following are true:  The -G option is
          present,  the  -xildoff  option  is present, any source
          files are named on the command line.

          When used with the  -O  option,  a  limited  amount  of
          debugging is available. The combination, -xO4 -g, turns
          off the inlining that you usually get with -xO4.

     -H   Print, one  per  line,  the  path  name  of  each  file
          included during the current compilation on the standard
          error output.

     -help
          Display a one-line summary of compiler options.

     -hname
          Names a shared  dynamic  library.  The   -hname  option
          assigns  a name to a shared dynamic library.  This pro-
          vides versions of a shared dynamic library. In general,
          the  name  after   -h  should  be exactly what you have
          after the  -o. You may insert a space between   -h  and
          name. This option is passed to  ld.

     -Idir
          Add dir to the list of directories in which  to  search
          for  #include files with relative filenames (not begin-
          ning with slash /).  The  preprocessor  first  searches
          for  #include files in the directory containing source-
          file, then in directories named  with  -I  options  (if
          any), and finally, in /usr/include.

     -inline=[f1,...,fn]
          For user-written routines, try  to  inline  only  those
          named  in the list f1 to fn.  It tries routines only in
          the file being compiled.  The list is a comma-separated
          list of functions and subroutines.

          If compiling with -O3, this can  increase  optimization
          by inlining some routines.  The -O3 option inlines none
          by itself.

          If compiling with -O4, this can  decrease  optimization
          by  restricting  inlining to only those routines in the
          list. With -O4, the compiler normally tries  to  inline
          all  user-written subroutines and functions.  When xin-
          line= is specified with an empty  rlist,  it  indicates
          that  none of the routines in the source file are to be
          inlined.

          A routine is not inlined if any of the following  apply
          (no warning):
          o  Optimization is less than -O3
          o  The routine cannot be found
          o  Inlining the routine does  not  look  profitable  or
          safe to iropt
          o  The source for the routine is not in the file  being
          compiled

     -KPIC
          Like -Kpic, but allows the global offset table to  span
          the range of 32-bit addresses in those rare cases where
          there are too many global data objects for -Kpic.

     -Kpic
          Produce position-independent code.  Each reference to a
          global datum is generated as a dereference of a pointer
          in the global offset table.  Each function call is gen-
          erated  in  pc-relative  addressing mode through a pro-
          cedure linkage table.  The size of  the  global  offset
          table is 8K on SPARC processors.

     -keeptmp
          Retains files created during compilation,  rather  than
          automatically deleting them.

     -Ldir
          Add dir to the list of directories  containing  object-
          library routines (for linking using ld(1).

     -lname
          Link with object library name (for ld(1)).  This option
          must follow the sourcefile arguments.

     -libmieee
          Force IEEE 754 style return values for math routines in
          exceptional  cases.   In such cases, no exeception mes-
          sage will be printed, and errno should  not  be  relied
          on.

     -libmil
          Inlines some library routines for faster execution.

     -M   Run only the macro preprocessor (cpp) on  the  named  C
          programs,  requesting  that it generate makefile depen-
          dencies and send the result to the standard output (see
          make(1) for details about makefiles and dependencies).

     -misalign
          -misalign assumes that data is not properly aligned and
          thus  very  conservative  loads and stores must be used
          for data, that is, one  byte  at  a  time.  Using  this
          option  can  cause  significant performance degradation
          when running the program.

     -misalign2
          -misalign2, like -misalign, assumes that  data  is  not
          properly  aligned,  but that data is at least half-word
          aligned. Though conservative uses of loads  and  stores
          must be used for data, the performance degradation when
          running a program should be less than for -misalign.

     -mt  Passes D_REENTRANT to preprocessor. Appends -l  thread.
          If  you are doing your own multithread coding, you must
          use this option in the  compile  and  link  steps.   To
          obtain  faster  execution,  this option requires a mul-
          tiprocessor system. On a single-processor  system,  the
          resulting executable usually runs more slowly with this
          option.

     -native
          Ascertain which code-generation options  are  available
          on  the  machine  running  the compiler, and direct the
          compiler to generate code targeted for that machine.

          This option is a synonym for -xtarget=native .

          The -fast macro includes -native in its expansion.

     -nolib
          Does not link any libraries by default; that is, no  -l
          options  are  passed  to  ld . Normally, the acc driver
          passes -lm -lansi -lc to ld .

          When you use -nolib , you have to pass all  -l  options
          yourself. For example:
               acc test.c -nolib -lansi  -Bstatic  -lm  -Bdynamic
               -lc
          links libm statically and the other  libraries  dynami-
          cally.

     -nolibmil
          Reset -fast so that it does  not  include  inline  tem-
          plates.   Use  this  after  the  -fast option:  cc fast
          nolibmil ...

     -noqueue
          Tells the compiler not to queue this compile request if
          a license is not available.

     -O[1|2|3|4|5]
          Optimize the object code.  May be used with -g, but not
          with  -xa.  Specifying  -O  is equivalent to specifying
          -O2.  Level is one of:

               1    Do basic local optimization (peephole).

               2    Do basic local and global optimization.  This
                    is  induction variable elimination, local and
                    global  common   subexpression   elimination,
                    algebraic  simplification,  copy propagation,
                    constant propagation, loop-invariant  optimi-
                    zation,   register  allocation,  basic  block
                    merging,  tail  recursion  elimination,  dead
                    code  elimination,  tail call elimination and
                    complex expression expansion.

                    The -O2 level does not assign global,  exter-
                    nal,  or indirect references to registers. It
                    treats these references and definitions as if
                    they  were  declared "volatile."  In general,
                    the -O2 level results in minimum code size.

               3    Beside what -O2  does,  this  also  optimizes
                    references and definitions for external vari-
                    ables.  Loop unrolling and software  pipelin-
                    ing  are  also  performed. The -O3 level does
                    not trace the effects of pointer assignments.
                    When compiling either device drivers, or pro-
                    grams that  modify  external  variables  from
                    within  signal  handlers, you may need to use
                    the volatile type qualifier  to  protect  the
                    object from optimization. In general, the -O3
                    level results in increased code size.

               4    Besides  what  -O3  does,  this   also   does
                    automatic  inlining of functions contained in
                    the same file; this usually  improves  execu-
                    tion  speed.  The  -O4  level  does trace the
                    effects of pointer assignments.  In  general,
                    the -O4 level results in increased code size.

               5    Generate the highest level  of  optimization.
                    Use  optimization  algorithms  that take more
                    compilation time or that do not have as  high
                    a  certainty  of  improving  execution  time.
                    Optimization at this level is more likely  to
                    improve  performance  if it is done with pro-
                    file feedback.

               If the optimizer runs out of memory, it  tries  to
               recover  by  retrying  the  current procedure at a
               lower level of optimization and resumes subsequent
               procedures  at the original level specified in the
               command-line option.

               If you optimize at -O3 or -O4 with very large pro-
               cedures  (thousands  of  lines of code in the same
               procedure), the  optimizer  may  require  a  large
               amount  of virtual memory.  In such cases, machine
               performance may degrade.

     -o outputfile
          Name the output file outputfile.  outputfile must  have
          the  appropriate suffix for the type of file to be pro-
          duced by the compilation (see FILES, below). outputfile
          cannot be the same as sourcefile (the compiler will not
          overwrite the source file).

     -P   Preprocess only.  Puts the output in a file with  a  .i
          suffix.   The  output will not contain any preprocessor
          line directives, unlike the -E option.

     -p   Prepare the object code to collect data  for  profiling
          with  prof(1).   Invokes a run-time recording mechanism
          that produces a mon.out file (at normal termination).

     -pg  Prepare the object code to collect data  for  profiling
          with  gprof(1).  Invokes a run-time recording mechanism
          that produces a gmon.out file (at normal termination).

     -PIC Same as -KPIC.

     -pic Same as -Kpic.

     -Qdir dir
          Look for compiler components in directory dir.

     -Qoption c arg
          Pass the option arg to the  component  c.   The  option
          must  be  appropriate  to  that component and may begin
          with a minus sign.   c  can  be  one  of:   acomp,  fbe
          (Solaris  2.x only) or as (Solaris 1.x only) cg, iropt,
          or ld.

     -Qpath dir
          Insert  directory dir into the compilation search path.
          The path will be searched for alternate versions of the
          compilation programs,  such  as  acomp(1),  and  ld(1).
          This path will also be searched first for certain relo-
          catable object files that are implicitly referenced  by
          the compiler driver, for example *crt*.o and bb_link.o.
     -Qproduce srctype
          Produce source code of the type sourcetype.  sourcetype
          can be one of:
               .i   Preprocessed C source.
               .o   Object file.
               .s   Assembler source.

     -qdir dir
          Same as -Qdir dir.

     -qoption c arg
          Same as -Qoption c arg.

     -qpath dir
          Same as -Qpath dir.

     -qproduce srctype
          Same as -Qproduce srctype.

     -R dir[:dir]
          A colon-separated list of directories used  to  specify
          library  search  directories to the runtime linker.  If
          present and not null, it  is  recorded  in  the  output
          object file and passed to the runtime linker.

          If both LD_RUN_PATH and the -R  option  are  specified,
          the -R option takes precedence.

     -S   Do not assemble the program  but  produce  an  assembly
          source file.

     -s   Remove all symbolic debugging information from the out-
          put object file.  Passed to ld(1).

     -sb  Generate extra symbol table  information  for  the  Sun
          Source Code Browser.

     -sbfast
          Create the database for the Sun  Source  Code  Browser,
          but do not actually compile.

     -strconst
          Insert string literals into the read-only data  section
          of the text segment instead of the data segment.

     -temp=dir
          Set directory for temporary files to be dir.

     -time
          Report execution  times  for  the  various  compilation
          passes.

     -Uname
          Cause any definition of name to be undefined, as if  by
          a  #undef preprocessing directive.  If the same name is
          specified for both -D and  -U,  name  is  not  defined,
          regardless of the order of the options.

     -unroll=n
          Specifies  whether  or  not  the   compiler   optimizes
          (unrolls)  loops.   n is a positive integer.  When n is
          1, it is a command and the compiler unrolls  no  loops.
          When n is greater than 1, the -unroll=n merely suggests
          to the compiler  that  unrolled  loops  be  unrolled  n
          times.

     -V   Print the name and version ID of each pass as the  com-
          piler executes.

     -v   Verbose.  Print the version number of the compiler  and
          the name of each program it executes.

     -vc  Directs  the  compiler  to  perform  stricter  semantic
          checks and enable other lint-like checks.

     -w   Do not print warnings.

     -X[a|c|s|t]
          Specify the degree of conformance to the ANSI  C  stan-
          dard.  The degree of conformance can be one of the fol-
          lowing:

          a (ANSI)
               ANSI C plus Sun C compatibility  extensions,  with
               semantic  changes required by ANSI C.  Where Sun C
               and ANSI C specify  different  semantics  for  the
               same  construct,  the compiler will issue warnings
               about the conflict and use the ANSI C  interpreta-
               tion. This is the default mode.

          c (conformance)
               Maximally conformant ANSI C, without Sun C  compa-
               tibility  extensions.   The  compiler  will  issue
               errors and warnings for programs that use non-ANSI
               C constructs.

          s (Sun C)
               The compiled language includes all features compa-
               tible  with  (pre-ANSI) Sun C.  The compiler tries
               to warn about all language  constructs  that  have
               differing  behavior between Sun ANSI C and the old
               Sun C. Invokes cpp for processing. __STDC__ is not
               defined in this mode.

          t (transition)
               ANSI  C  plus  Sun  C  compatibility   extensions,
               without  semantic  changes  required  by  ANSI  C.
               Where Sun C and ANSI C specify different semantics
               for  the  same  construct, the compiler will issue
               warnings about the conflict  and  use  the  Sun  C
               interpretation.

          The predefined macro __STDC__ has the value 0  for  -Xt
          and  -Xa,  and 1 for -Xc.  (It is not defined for -Xs.)
          All warning messages about differing  behavior  can  be
          eliminated through appropriate coding; for example, use
          of casts can eliminate the  integral  promotion  change
          warnings.

     -xa  Same as -a.

     -xarch=a
          Limit the set of instructions the compiler may use.

          a must  be  one  of:  generic,  v7,  v8a,  v8,  v8plus,
          v8plusa.

          Although this option can be used alone, it is  part  of
          the  expansion  of the -xtarget option; its primary use
          is to override a value supplied by the -xtarget option.

          This option limits the instructions generated to  those
          of the specified architecture, and allows the specified
          set of instructions.  The option does not guarantee the
          specified set is used; however, under optimization, the
          set is usually used.

          If this option is used with optimization, the appropri-
          ate  choice can provide good performance of the execut-
          able on the specified  architecture.  An  inappropriate
          choice  can  result  in  serious degradation of perfor-
          mance.

          v7, v8, and v8a are all binary compatible.  v8plus  and
          v8plusa  are binary compatible with each other and for-
          ward, but not backward. For any particular choice,  the
          generated  executable  can run much more slowly on ear-
          lier architectures (to the left  in  the  above  list).
          See the C 4.0 User's Guide for details.

          The -xarch values are:

          generic
                Get good performance on most  SPARCs,  and  major
                degradation on none. This is the default.

          v7    Limit the instruction set to V7 architecture.

          v8a   Limit the instruction set to the V8a  version  of
                the V8 architecture.

          v8    Limit the instruction set to V8 architecture.

          v8plus
                Limit the instruction set to the  V8plus  version
                of the V9 architecture.

          v8plusa
                Limit the instruction set to the V8plusa  version
                of the V9 architecture.

     -xautopar
          Turn on automatic parallelization for multiple  proces-
          sors.  Does  dependence  analysis  (analyze  loops  for
          inter- iteration data dependence) and loop  restructur-
          ing.  If optimization is not at -xO3 or higher, optimi-
          zation is raised to -xO3 and a warning is emitted.

     -xcache=c
          Define the cache properties for use by the optimizer.

          c must be one of the following:

          o generic

          o s1/l1/a1

          o s1/l1/a1:s2/l2/a2

          o s1/l1/a1:s2/l2/a2:s3/l3/a3

          The si/li/ai are defined as follows:

          si
            The size of the data cache at level i, in kilobytes

          li
            The line size of the data cache at level i, in bytes

          ai
            The associativity of the data cache at level i

          Although this option can be used alone, it is  part  of
          the  expansion  of the -xtarget option; its primary use
          is to override a value supplied by the -xtarget option.

          This option specifies the  cache  properties  that  the
          optimizer  can  use.  It  does  not  guarantee that any
          particular cache property is used.

          The -xcache values are:

          generic
                Define the cache properties for good  performance
                on most SPARCs.  This is the default.

          s1/l1/a1
                Define level 1 cache properties.

          s1/l1/a1:s2/l2/a2
                Define levels 1 and 2 cache properties.

          s1/l1/a1:s2/l2/a2:s3/l3/a3
                Define levels 1, 2, and 3 cache properties.

     -xCC Accept C++-style comments.

     -xcg89
          Same as -cg89.

     -xcg92
          Same as -cg92.

     -xchip=c
          Specify the target processor for use by the optimizer.

          c must be one of: generic, old, super, super2, micro,
          micro2, hyper, hyper2, powerup, ultra.

          Although this option can be used alone, it is part of
          the expansion of the -xtarget option; its primary use
          is to override a value supplied by the -xtarget option.

          This option specifies timing properties by specifying
          the target processor.

          Some effects are:

          o The ordering of instructions, that is, scheduling

          o The way the compiler uses branches

          o The instructions to use in cases where semantically
            equivalent alternatives are available

          The -xchip values are:

          generic
                 Use timing properties for good performance on
                 most SPARCs.
          old    Use timing properties of pre-SuperSPARC proces-
                 sors.

          super  Use timing properties of the SuperSPARC chip.

          super2 Use timing properties of the SuperSPARC II chip.

          micro  Use timing properties of the microSPARC chip.

          micro2 Use timing properties of the microSPARC II chip.

          hyper  Use timing properties of the hyperSPARC chip.

          hyper2 Use timing properties of the hyperSPARC II chip.

          powerup
                 Use timing properties of the Weitek PowerUp
                 chip.

          ultra  Use timing properties of the UltraSPARC chip.

     -xdepend
          Analyze loops for inter-iteration data dependencies and
          do loop restructuring.  Dependence analysis is included
          in -xautopar.  The dependency analysis is done at com-
          pile time.  The -xdepend option is ignored unless
          either -xO3 or -xO4 is on, explicitly, or by another
          option.

     -xe  Performs only syntax and semantic checking on the
          source files, but does not produce any object or exe-
          cutable code.

     -xexplicitpar
          Parallelize the loops that are specified.  You do the
          dependency analysis: analyze and specify loops for
          inter-iteration and data dependencies. The software
          parallelizes the specified loops. If optimization is
          not at -xO3 or higher, then it is raised to -xO3.

          Avoid -xexplicitpar if you do your own thread manage-
          ment.

          The -xexplicitpar option requires the iMPact C mul-
          tiprocessor enhancement package.  To get faster code,
          use this option on a multiprocessor system. On a
          single-processor system, the generated code usually
          runs slower.

          If you identify a loop for parallelization, and the
          loop has dependencies, you can get incorrect results,
          possibly different ones with each run, and with no
          warnings.  Do not apply an explicit parallel pragma to
          a reduction loop.  The explicit parallelization is
          done, but the reduction aspect of the loop is not done,
          and the results can be incorrect.

          If you use -xexplicitpar and compile and link in one
          step, then linking automatically includes the micro-
          tasking library and the threads-safe C runtime library.
          If you use -xexplicitpar and compile and link in
          separate steps, then you must also link with -xexpli-
          citpar.

     -xF  Enables performance analysis of the executable using
          the Analyzer and Debugger.  (See analyzer(1) and
          debugger(1) man pages.)  Produces code that can be
          reordered at the function level.  Each function in the
          file is placed in a separate section; for example,
          functions foo() and bar() will be placed in the sec-
          tions .text%foo and .text%bar , respectively.  Function
          ordering in the executable can be controlled by using
          -xF in conjunction with the -M option to ld (see
          ld(1)).

     -xhelp=f
          Display on-line help information.

          -xhelp=flags displays a summary of the compiler
          options; -xhelp=readme displays the readme file;
          -xhelp=errors displays the Error and Warning Messages
          file.

     -xildoff
          Turn off the incremental linker and force the use of
          ld.  This option is the default if you do not use the
          -g option, or you do use the -G option, or any source
          files are present on the command line.  Override this
          default by using the -xildon option.

     -xildon
          Turn on the incremental linker and force the use of ild
          in incremental mode. This option is the default if you
          use the -g option, and you do not use the -G option,
          and there are no source files present on the command
          line. Override this default by using the -xildoff
          option.

     -xinline=[f1,...,fn]
          Same as -inline.

     -xlibmieee
          Same as -libmieee.

     -xlibmil
          Same as -libmil.

     -xlicinfo
          Returns information about the licensing system.  In
          particular, it returns the name of the license server
          and the userids of users who have licenses checked out.
          When you use this option, the compiler is not invoked
          and a license is not checked out.

     -xloopinfo
          Show which loops are parallelized and which are not.
          This option is normally for use with the -xautopar and
          -xexplicitpar options.  It requires the iMPact C mul-
          tiprocessor enhancement package.

     -xM  Generate makefile dependencies.

     -xM1 Generate makefile dependencies.

     -xMerge
          Directs acc to merge the data segment with the text
          segment for assembler.  Data initialized in the object
          file produced by this compilation is read-only and
          (unless linked with ld-N) is shared between processes.

     -xnolib
          Same as -nolib.

     -xnolibmil
          Same as -nolibmil.

     -xO[1|2|3|4|5]
          Same as -O[1|2|3|4|5].

     -xP  Print prototypes for K&R C function definitions.

     -xparallel
          Parallelize both automatic and explicit loops. This
          option invokes -xautopar, -xdepend, and -xexplicitpar.
          There is a risk of producing incorrect results.

          Avoid -xparallel if you do your own thread management.

          This option requires the iMPact C multiprocessor
          enhancement package.  To get faster code, use this
          option on a multiprocessor SPARC system. On a single-
          processor system, the generated code usually runs more
          slowly.

          The -xautopar option (and therefore the -xparallel
          option) includes dependency analysis; that is, if you
          try a -xautopar both with and without -xdepend, there
          is no noticeable difference.

          If you compile and link in one step, -xparallel links
          with the microtasking library and the threads-safe C
          runtime library.  If you compile and link in separate
          steps, and you compile with -xparallel, then link with
          -xparallel.

     -xpg Same as -pg.

     -xprofile=p
          Collect data for a profile or use a profile to optim-
          ize.

          p must be collect, use[:name], or tcov.

          This option causes execution frequency data to be col-
          lected and saved during execution, then the data can be
          used in subsequent runs to improve performance. This
          option is only valid when a level of optimization is
          specified.

          collect
               Collect and save execution frequency for later use
               by the optimizer.

          use[:name]
               Use execution frequency data saved by the com-
               piler. The name is the name of the executable that
               is being analyzed. This name is optional. If name
               is not specified, a.out is assumed to be the name
               of the executable.

          tcov Correctly collects data for programs that have
               source code in header files or that make use of
               C++ templates.  See also -xa.

     -xreduction
          Analyze loops for reduction in automatic paralleliza-
          tion. To enable parallelization of reduction loops,
          specify both -xreduction and -xautopar.

          If you specify -xreduction without -xautopar, the com-
          piler issues a warning.

          This option requires the iMPact C multiprocessor
          enhancement package.  To get faster code, this option
          also requires a multiprocessor system.  On a single-
          processor system, the generated code usually runs more
          slowly.

          There is always potential for roundoff error with
          reduction.

          If you have a reduction loop to be parallelized, then
          use -xreduction with -xautopar.  Do not use an explicit
          pragma, because the explicit pragma prevents reduction
          for that loop, resulting in wrong answers.

     -xregs=r
          Specify the usage of registers for the generated code.

          r is a comma-separated list that consists of one or
          more of the following: [no%]appl, [no%]float.

          Example: -xregs=appl,no%float

          The -xregs= values are:

          appl   Allow using the registers g2, g3, and g4.

          no%appl
                 Do not use the appl registers.

          float  Allow using the floating-point registers as
                 specified in the SPARC ABI.

          no%float
                 Do not use the floating-point registers.

          The default is:  -regs=appl,float.

     -xrestrict=f
          Treat pointer-valued function parameters as restricted
          pointers. f is a comma-separated list that consists of
          one or more function parameters, %all, %none.  This
          command-line option can be used on its own, but is best
          used with optimization of -xO3 or greater.

          The default is %none. Specifying -xrestrict is
          equivalent to specifying -xrestrict=%all.

     -xs  Disable Auto-Read for dbx. Use this option in case you
          cannot keep the .o files around. It passes the -s
          option to the assembler.

          No Auto-Read is the older way of loading symbol tables.
          It places all symbol tables for dbx in the executable
          file. The linker links more slowly and dbx initializes
          more slowly.

          Auto-Read is the newer and default way of loading sym-
          bol tables. With Auto-Read, the information is
          distributed in the .o files, so that dbx loads the sym-
          bol table information only if and when it is needed.
          Hence, the linker links faster, and dbx initializes
          faster.

          With -xs, if you move the executables to another direc-
          tory, then to use dbx, you can ignore the object (.o)
          files.

          Without -xs, if you move the executables, you must move
          both the sources files and the object (.o) files, or
          set the path with the dbx pathmap or use command.

     -xsafe=mem
          Allow the compiler to assume no memory-based traps
          occur.

          This option grants permission to use the speculative
          load instruction on V9 machines.

     -xsb Same as -sb.

     -xsbfast
          Same as -sbfast.

     -xsfpconst
          Represent unsuffixed floating-point constants as single
          precision, instead of the default mode of double preci-
          sion. Not valid with -Xc.

     -xspace
          Do no optimizations that increase code size.  Example:
          Do not unroll loops.

     -xstrconst
          Same as -strconst.

     -xtarget=t
          Specify the target system for the instruction set and
          optimization.

          t must be one of: native, generic, system-name.

          The -xtarget option permits a quick and easy specifica-
          tion of the -xarch, -xchip, and -xcache combinations
          that occur on real systems.  The only meaning of -xtar-
          get is in its expansion.

          The -xtarget values are:

          native   Get the best performance on the host system.

          generic  Get the best performance for generic architec-
                   ture, chip, and cache.  This is the default.

          system-name
                   Get the best performance for the specified
                   system.
                   Valid system names are: sun4/15, sun4/20,
                   sun4/25, sun4/30, sun4/40, sun4/50, sun4/60,
                   sun4/65, sun4/75, sun4/110, sun4/150,
                   sun4/260, sun4/280, sun4/330, sun4/370,
                   sun4/390, sun4/470, sun4/490, sun4/630,
                   sun4/670, sun4/690, sselc, ssipc, ssipx, sslc,
                   sslt, sslx, sslx2, ssslc, ss1, ss1plus, ss2,
                   ss2p, ss4, ss5, ssvyger, ss10, ss10/hs11,
                   ss10/hs12, ss10/hs14, ss10/20, ss10/hs21,
                   ss10/hs22, ss10/30, ss10/40, ss10/41, ss10/50,
                   ss10/51, ss10/61, ss10/71, ss10/402, ss10/412,
                   ss10/512, ss10/514, ss10/612, ss10/712,
                   ss20/hs11, ss20/hs12, ss20/hs14, ss20/hs21,
                   ss20/hs22, ss20/51, ss20/61, ss20/71,
                   ss20/502, ss20/512, ss20/514, ss20/612,
                   ss20/712, ss600/41, ss600/51, ss600/61,
                   ss600/120, ss600/140, ss600/412, ss600/512,
                   ss600/514, ss600/612, ss1000, sc2000, cs6400,
                   solb5, solb6, ultra, ultra1/140, ultra1/170,
                   ultra1/1170, ultra1/2170, ultra1/2200.
                   See the section on -xtarget=t in the C 4.0
                   User's Guide for the -xtarget expansions that
                   show the mneumonic encodings of the actual
                   system names and numbers.

          This option is a macro.  Each specific value for
          -xtarget expands into a specific set of values for the
          -xarch, -xchip, and -xcache options.  For example:
          -xtarget=sun4/15 is equivalent to:
          -xarch=v8a -xchip=micro -xcache=2/16/1

     -xtemp=dir
          Set directory for temporary files to dir.

     -xtime
          Same as -time.

     -xtransition
          Issue warnings for differences between K&R C and ANSI
          C.

     -xunroll=n
          Same as -unroll.

     -xvpara
          Issue warnings for loops that may not be safe to
          parallelize.  As the compiler detects each explicitly
          parallelized loop that has dependencies, it issues a
          warning message but the loop is parallelized.  Use with
          the -xexplicitpar option and the #pragma MP directive.

          This option requires the iMPact C multiprocessor
          enhancement package.

     -Y,dir
          Change default directories for finding libraries files.

     -Zll Create the lock_lint database files (.ll files), one
          per each .c file compiled for the lock_lint(1) program,
          which is included in the iMPact product. Do not actu-
          ally compile.

     -Zlp Prepare object files for the loop profiler, looptool.
          The looptool(1) utility can then be run to generate
          loop statistics about the program. Use this option with
          -xdepend; if -xdepend is not explicitly or implicitly
          specified, turns on -xdepend and issues a warning. If
          optimization is not at -O3 or higher, optimization is
          raised to -O3 and a warning is issued.

          The -Zlp option requires the iMPact C multiprocessor
          enhancement package.

     -Ztha
          Prepare code for analysis by the thread analyzer, the
          performance analysis tool for multithreaded code.

     acc recognizes -r, -u, -YP,dir, and -z, and passes these
     options and their arguments to ld.  acc also passes any
     unrecognized options to ld with a warning.

  PRAGMAS
     The following #pragmas are recognized by the compilation
     system:
     #prama align, #pragma fini, #prama init, #prama ident,
     #pragma int_to_unsigned, #prama MP serial_loop, #prama MP
     serial_loop_nested, #prama MP taskloop, #prama
     nomemorydepend, #prama no_side_effect, #pragma pack, #prama
     pipeloop, #pragma unknown_control_flow, #prama unroll,
     #prama weak.
     Refer to the C 4.0 User's Guide for more information on
     these pragmas.

FILES
     a.out                         executable output file
     file.a                        library of object files
     file.c                        C source file
     file.d                        tcov(1) test coverage input
                                   file
     file.i                        C source file after prepro-
                                   cessing
     file.il                       inline expansion file
     file.o                        object file
     file.s                        assembler source file
     file.tcov                     output from tcov(1)
     acc                           compiler command line driver
     acomp                         compiler front end
     cg                            code generator
     crt1.o                        runtime startup code
     crti.o                        runtime startup code
     crtn.o                        runtime startup code
     fbe                           assembler
     gcrt1.o                       startup for profiling with
                                   gprof(1)
     gmon.out                      default profile file for -pg
     iropt                         global optimzer
     mcrt1.o                       start-up for profiling with
                                   prof(1) and intro(3)
     mon.out                       default profile file for -p
     .sb                           The directory used to store
                                   sbrowser(1) data when the -xsb
                                   or -xsbfast flag is used.
     .sbinit                       A file containing commands
                                   which can be used to specify
                                   the location of the .sb direc-
                                   tory and to control the execu-
                                   tion of sbcleanup
     sbcleanup                     deletes obsolete files in the
                                   .sb directory and creates an
                                   up-to-date .sb/Index file

SEE ALSO
     ar(1), as(1), cflow(1), ctags(1), cxref(1), dbx(1),
     gprof(1), ld(1), lint(1), m4(1), make(1S), prof(1), tcov(1)

     C 4.0 User's Guide

     B. W. Kernighan and D. M. Ritchie, The C Programming
     Language, Prentice-Hall, 1978

DIAGNOSTICS
     The diagnostics produced by the C compiler are intended to
     be self-explanatory.  Occasional obscure messages may be
     produced by the preprocessor, assembler, or loader.

                  Last change: 5 September 1995                25
Thu, 18 Oct 2001 09:28:19 +0100 (BST)
Lee Kindness <lkindness@csl.co.uk>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
Lee Kindness writes:

> For your information I've attached the man page for the Sun C
> compiler, which explicitly lists the -h and -R flags.

I didn't read much farther than

     acc (SPARC only) is not intended  to  be  used  directly  on
     Solaris  2.x.

;-)

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Thu, 18 Oct 2001 23:03:41 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
Peter Eisentraut writes:
 > Lee Kindness writes:
 > > For your information I've attached the man page for the Sun C
 > > compiler, which explicitly lists the -h and -R flags.
 > I didn't read much farther than
 >      acc (SPARC only) is not intended  to  be  used  directly  on
 >      Solaris  2.x. ;-)

Touche, but the man page for the front-end (plain old cc) doesn't list
options and only refers to the acc man page ;)

Onto another Solaris compilation issue...

After a simple './configure' on a stock Solaris 2.6 box the
compilation of interfaces/ecpg/lib/execute.c fails due to the macro
definition of 'gettext' to ''. This macro is invoked on the prototype
of gettext() in libintl.h (included via locale.h).

A './configure --enable-nls' is needed.

To properly fix the problem either:

 1. Don't include or use locale functions in execute.c unless
    --enable-locale has been specified.

 2. In execute.c the include for locale.h whould be moved above that
    of postgres_fe.h

 3. Replace '#define gettext' in c.h with something more unique
    (PG_gettext perhaps?)

Regards, Lee Kindness.

Fri, 19 Oct 2001 09:40:53 +0100 (BST)
Lee Kindness <lkindness@csl.co.uk>
Compiling on Solaris with Sun compiler
Lee Kindness writes:

> Touche, but the man page for the front-end (plain old cc) doesn't list
> options and only refers to the acc man page ;)

Well, I'm stumped.  All the Solaris compilers I've ever seen did support
and document the -Wl option.

> After a simple './configure' on a stock Solaris 2.6 box the
> compilation of interfaces/ecpg/lib/execute.c fails due to the macro
> definition of 'gettext' to ''. This macro is invoked on the prototype
> of gettext() in libintl.h (included via locale.h).

Fail how and why?

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Sat, 20 Oct 2001 11:27:52 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Compiling on Solaris with Sun compiler
Peter Eisentraut writes:
 > Lee Kindness writes:
 > > Touche, but the man page for the front-end (plain old cc) doesn't list
 > > options and only refers to the acc man page ;)
 > Well, I'm stumped.  All the Solaris compilers I've ever seen did support
 > and document the -Wl option.

Well I never submitted my patch for building using the Sun compilers
since I thought that the newer versions did support the -Wl
option - I'm using an old (version 4) Sun compiler. However it seems
that Denis it using revision 2 of the latest version 6 compiler!

 > > After a simple './configure' on a stock Solaris 2.6 box the
 > > compilation of interfaces/ecpg/lib/execute.c fails due to the macro
 > > definition of 'gettext' to ''. This macro is invoked on the prototype
 > > of gettext() in libintl.h (included via locale.h).
 > Fail how and why?

Well in c.h there is the following define:

 #ifdef ENABLE_NLS
 #include <libintl.h>
 #else
 #define gettext(x) (x)
 #endif
 #define gettext_noop(x) (x)

so gettext() simply is the supplied parameter if --enable-nls is not
supplied. However ecpg/execute.c has the following includes:

 #include "postgres_fe.h"
 #include <stdio.h>
 #include <locale.h>

Via postgres_fe.h gettext() gets defined as above. However locale.h
also pulls in the systems libintl.h which has the following prototype:

 extern char *gettext();

which the preprocessor changes to:

 extern char *();

due to the gettext define in c.h. Naturally this makes the build
fail.

Configuring with --enable-nls gets round this but I don't require that
functionality.

Regards, Lee Kindness.

Tue, 23 Oct 2001 10:28:57 +0100 (BST)
Lee Kindness <lkindness@csl.co.uk>
Re: Compiling on Solaris with Sun compiler
Lee Kindness writes:

> After a simple './configure' on a stock Solaris 2.6 box the
> compilation of interfaces/ecpg/lib/execute.c fails due to the macro
> definition of 'gettext' to ''. This macro is invoked on the prototype
> of gettext() in libintl.h (included via locale.h).

This should be fixed now.

-- 
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter


Wed, 24 Oct 2001 23:54:33 +0200 (CEST)
Peter Eisentraut <peter_e@gmx.net>
Re: Compiling on Solaris with Sun compiler
Lee Kindness writes:
 > Peter Eisentraut writes:
 >  > Lee Kindness writes:
 >  > > Touche, but the man page for the front-end (plain old cc) doesn't list
 >  > > options and only refers to the acc man page ;)
 >  > Well, I'm stumped.  All the Solaris compilers I've ever seen did support
 >  > and document the -Wl option.
 > Well I never submitted my patch for building using the Sun compilers
 > since I thought that the newer versions did support the -Wl
 > option - I'm using an old (version 4) Sun compiler. However it seems
 > that Denis it using revision 2 of the latest version 6 compiler!

Does the patch break Sun compilers which do accept '-Wl'? If it
doesn't it might be worthwhile to apply it so things compile out of
the box for more Sun compilers...

Otherwise it'd be useful to included/mention the patch in the Solaris
FAQ.

Regards, Lee Kindness.

Tue, 30 Oct 2001 10:46:36 +0000 (GMT)
Lee Kindness <lkindness@csl.co.uk>
Re: Compiling on Solaris with Sun compiler

Can I get a status on this?  I see Peter stated:
	
	I didn't read much farther than
	
	     acc (SPARC only) is not intended  to  be  used  directly  on
	     Solaris  2.x.
	

---------------------------------------------------------------------------

> Sorry, previous patch was wrong.
> 
> Denis Ustimenko
> --------------------------------------
> *** orig/postgresql-7.1.3//src/makefiles/Makefile.solaris       ?? ??? 17
> 00:14:25 2000
> --- postgresql-7.1.3//src/makefiles/Makefile.solaris    ?? ??? 17 14:33:11
> 2001
> ***************
> *** 6,12 ****
>   export_dynamic = -Wl,-E
>   rpath = -Wl,-rpath,$(libdir)
>   else
> ! rpath = -Wl,-R$(libdir)
>   endif
>   shlib_symbolic = -Wl,-Bsymbolic
> 
> --- 6,12 ----
>   export_dynamic = -Wl,-E
>   rpath = -Wl,-rpath,$(libdir)
>   else
> ! rpath = -R$(libdir)
>   endif
>   shlib_symbolic = -Wl,-Bsymbolic
> 
> *** orig/postgresql-7.1.3//src/Makefile.shlib   ?? ??? 15 10:25:07 2001
> --- postgresql-7.1.3//src/Makefile.shlib        ?? ??? 17 13:00:29 2001
> ***************
> *** 179,185 ****
>     ifeq ($(with_gnu_ld), yes)
>       LINK.shared               += -Wl,-soname,$(soname)
>     else
> !     LINK.shared               += -Wl,-h,$(soname)
>     endif
>     SHLIB_LINK          += -lm -lc
>   endif
> --- 179,185 ----
>     ifeq ($(with_gnu_ld), yes)
>       LINK.shared               += -Wl,-soname,$(soname)
>     else
> !     LINK.shared               += -h $(soname)
>     endif
>     SHLIB_LINK          += -lm -lc
>   endif
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Tue, 6 Nov 2001 17:40:42 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed &
Bruce Momjian writes:
 > Can I get a status on this?  I see Peter stated:
 > 	I didn't read much farther than
 > 	     acc (SPARC only) is not intended  to  be  used  directly  on
 > 	     Solaris  2.x.

Bruce, see attached message, I think to sum things up:

 1. The patch will not harm Sun compilers which do support -Wl
 2. It will help those who do not
 3. We need to investigate which versions do/don't support the option,
    it seems odd that (my) V4 compiler does not and Denis's V6.2
    doesn't but I imagine Peter Eisentraut's does...

Looking thru the archives for 'Compiling on Solaris with Sun compiler'
should give more background.

Lee.


Lee Kindness writes:
 > Peter Eisentraut writes:
 >  > Lee Kindness writes:
 >  > > Touche, but the man page for the front-end (plain old cc) doesn't list
 >  > > options and only refers to the acc man page ;)
 >  > Well, I'm stumped.  All the Solaris compilers I've ever seen did support
 >  > and document the -Wl option.
 > Well I never submitted my patch for building using the Sun compilers
 > since I thought that the newer versions did support the -Wl
 > option - I'm using an old (version 4) Sun compiler. However it seems
 > that Denis it using revision 2 of the latest version 6 compiler!

Does the patch break Sun compilers which do accept '-Wl'? If it
doesn't it might be worthwhile to apply it so things compile out of
the box for more Sun compilers...

Otherwise it'd be useful to included/mention the patch in the Solaris
FAQ.

Regards, Lee Kindness.
Wed, 7 Nov 2001 10:08:47 +0000 (GMT)
Lee Kindness <lkindness@csl.co.uk>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed &
Lee Kindness writes:

>  1. The patch will not harm Sun compilers which do support -Wl
>  2. It will help those who do not
>  3. We need to investigate which versions do/don't support the option,
>     it seems odd that (my) V4 compiler does not and Denis's V6.2
>     doesn't but I imagine Peter Eisentraut's does...

Okay, I figured it out:

The Solaris C compiler uses -Wl to pass options to the linker (like
everyone else).  But the Solaris C++ compiler uses '-Qoption ld' to pass
options to the linker.  Words are not sufficient...

So I guess that this patch is okay if you can assert that #1 above is
true.  If it isn't we'll find out soon enough.

-- 
Peter Eisentraut   peter_e@gmx.net


Thu, 8 Nov 2001 01:26:14 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed

Was this resolved and applied?

---------------------------------------------------------------------------

> Lee Kindness writes:
> 
> >  1. The patch will not harm Sun compilers which do support -Wl
> >  2. It will help those who do not
> >  3. We need to investigate which versions do/don't support the option,
> >     it seems odd that (my) V4 compiler does not and Denis's V6.2
> >     doesn't but I imagine Peter Eisentraut's does...
> 
> Okay, I figured it out:
> 
> The Solaris C compiler uses -Wl to pass options to the linker (like
> everyone else).  But the Solaris C++ compiler uses '-Qoption ld' to pass
> options to the linker.  Words are not sufficient...
> 
> So I guess that this patch is okay if you can assert that #1 above is
> true.  If it isn't we'll find out soon enough.
> 
> -- 
> Peter Eisentraut   peter_e@gmx.net
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
> http://archives.postgresql.org
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sat, 10 Nov 2001 21:58:22 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed
Bruce Momjian writes:

> Was this resolved and applied?

No.  The proposed patch should still be applied.

>
> ---------------------------------------------------------------------------
>
> > Lee Kindness writes:
> >
> > >  1. The patch will not harm Sun compilers which do support -Wl
> > >  2. It will help those who do not
> > >  3. We need to investigate which versions do/don't support the option,
> > >     it seems odd that (my) V4 compiler does not and Denis's V6.2
> > >     doesn't but I imagine Peter Eisentraut's does...
> >
> > Okay, I figured it out:
> >
> > The Solaris C compiler uses -Wl to pass options to the linker (like
> > everyone else).  But the Solaris C++ compiler uses '-Qoption ld' to pass
> > options to the linker.  Words are not sufficient...
> >
> > So I guess that this patch is okay if you can assert that #1 above is
> > true.  If it isn't we'll find out soon enough.
> >
> > --
> > Peter Eisentraut   peter_e@gmx.net
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 6: Have you searched our list archives?
> >
> > http://archives.postgresql.org
> >
>
>

-- 
Peter Eisentraut   peter_e@gmx.net


Sun, 11 Nov 2001 16:41:18 +0100 (CET)
Peter Eisentraut <peter_e@gmx.net>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed

Patch applied.  Sorry for the delay. I got confused in the resulting
discussion.  This will appear in 7.2 final.

---------------------------------------------------------------------------

> Sorry, previous patch was wrong.
> 
> Denis Ustimenko
> --------------------------------------
> *** orig/postgresql-7.1.3//src/makefiles/Makefile.solaris       ?? ??? 17
> 00:14:25 2000
> --- postgresql-7.1.3//src/makefiles/Makefile.solaris    ?? ??? 17 14:33:11
> 2001
> ***************
> *** 6,12 ****
>   export_dynamic = -Wl,-E
>   rpath = -Wl,-rpath,$(libdir)
>   else
> ! rpath = -Wl,-R$(libdir)
>   endif
>   shlib_symbolic = -Wl,-Bsymbolic
> 
> --- 6,12 ----
>   export_dynamic = -Wl,-E
>   rpath = -Wl,-rpath,$(libdir)
>   else
> ! rpath = -R$(libdir)
>   endif
>   shlib_symbolic = -Wl,-Bsymbolic
> 
> *** orig/postgresql-7.1.3//src/Makefile.shlib   ?? ??? 15 10:25:07 2001
> --- postgresql-7.1.3//src/Makefile.shlib        ?? ??? 17 13:00:29 2001
> ***************
> *** 179,185 ****
>     ifeq ($(with_gnu_ld), yes)
>       LINK.shared               += -Wl,-soname,$(soname)
>     else
> !     LINK.shared               += -Wl,-h,$(soname)
>     endif
>     SHLIB_LINK          += -lm -lc
>   endif
> --- 179,185 ----
>     ifeq ($(with_gnu_ld), yes)
>       LINK.shared               += -Wl,-soname,$(soname)
>     else
> !     LINK.shared               += -h $(soname)
>     endif
>     SHLIB_LINK          += -lm -lc
>   endif
> 
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 3: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
> 

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 11 Nov 2001 14:21:21 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed &
> Bruce Momjian writes:
> 
> > Was this resolved and applied?
> 
> No.  The proposed patch should still be applied.

Thanks.  Applied.

-- 
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026

Sun, 11 Nov 2001 14:21:35 -0500 (EST)
Bruce Momjian <pgman@candle.pha.pa.us>
Re: compiling libpq++ on Solaris with Sun SPRO6U2 (fixed