Re: AIX 4.3.1, 7.0.3 build annoyances: C++ comments, make all, macro problem - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: AIX 4.3.1, 7.0.3 build annoyances: C++ comments, make all, macro problem
Date
Msg-id Pine.LNX.4.30.0101022122570.758-100000@peter.localdomain
Whole thread Raw
In response to Re: AIX 4.3.1, 7.0.3 build annoyances: C++ comments, make all, macro problem  ("Travis W. Pouarz" <twp1@duke.edu>)
List pgsql-bugs
Travis W. Pouarz writes:

> ar crs libpgtcl.a pgtcl.o pgtclCmds.o pgtclId.o
> touch libpgtcl.a
> ../../../src/backend/port/aix/mkldexport.sh libpgtcl.a > libpgtcl.exp
> cc -O -qtune=p2sc -qmaxmem=8192 -Wl,-H512 -Wl,-bM:SRE
> -Wl,-bI:../../../src/backend/postgres.imp -Wl,-bE:libpgtcl.exp -o
> libpgtcl.so libpgtcl.a
> -L/.../austin.ibm.com/fs/projects/gsys/pkg/readline-4.1/lib
> -L/.../austin.ibm.com/fs/projects/gsys/lib
> -L/.../austin.ibm.com/fs/projects/gsys/pkg/readline-4.1/lib
> -L/.../austin.ibm.com/fs/projects/gsys/lib
> -L../../../src/interfaces/libpq -lpq  -lc
> ...
> ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetVar2
> ld: 0711-317 ERROR: Undefined symbol: .Tcl_SetVar
> ld: 0711-317 ERROR: Undefined symbol: .Tcl_AppendResult
> ld: 0711-317 ERROR: Undefined symbol: .Tcl_Preserve
> ...

On other platforms it is not an error if a shared library link leaves
unresolved symbols.  (I'm not totally convinced whether this is desirable,
but that's the way we have set them up.)  On AIX >=4 it should work to add
the option -Wl,-berok ("external references okay") at an opportune place
in src/makefiles/Makefile.aix.  Please try that.

>   so I added -ltcl8.0 to LDFLAGS in src/Makefile.global:

Hmm, I guess one reason that this is not done by default is to allow using
libpgtcl with various Tcl versions, to be decided at the time the
executable is linked.  Not sure if this is really feasible, though.

> /.../austin.ibm.com/fs/projects/gsys/lib/tcl8.0/ldAix /bin/ld -bhalt:4
> -bM:SRE -bE:lib.exp -H512 -T512 -bnoentry -o pltcl.so pltcl.o
> -L/.../austin.ibm.com/fs/projects/gsys/lib -ltcl8.0 -lld  -lm -lbsd -lc
> noDotA="pltcl.so"
> ld: 0711-317 ERROR: Undefined symbol: .nocachegetattr
> ld: 0711-317 ERROR: Undefined symbol: .heap_getsysattr
> ld: 0711-317 ERROR: Undefined symbol: .SearchSysCache
> ld: 0711-317 ERROR: Undefined symbol: .elog
> ld: 0711-317 ERROR: Undefined symbol: .ReleaseSysCache
> ld: 0711-317 ERROR: Undefined symbol: .OidFunctionCall3
> ld: 0711-317 ERROR: Undefined symbol: .pfree
> ld: 0711-317 ERROR: Undefined symbol: Warn_restart
> ld: 0711-317 ERROR: Undefined symbol: .FunctionCall3
> ld: 0711-317 ERROR: Undefined symbol: .SPI_execp
> ld: 0711-317 ERROR: Undefined symbol: SPI_processed
> ld: 0711-317 ERROR: Undefined symbol: SPI_tuptable
> ...

Okay, same answer as above here really, but unfortunately we're using the
magic flags provided by Tcl here, so either we override them (or augment
them) in the AIX case, or we do something like

>   so I added -bI:/tmp/postgresql-snapshot/src/backend/postgres.imp to TCL_SHLIB_LD
>   in src/pl/tcl/Makefile.tcldefs:

The -Wl,-berok will lose on AIX 3*, so if anyone cares run run PG with Tcl
on that platform we'll have to think harder.

--
Peter Eisentraut      peter_e@gmx.net       http://yi.org/peter-e/

pgsql-bugs by date:

Previous
From: "Travis W. Pouarz"
Date:
Subject: Re: AIX 4.3.1, 7.0.3 build annoyances: C++ comments, make all, macro problem
Next
From: Bruce Momjian
Date:
Subject: Re: PostgreSQL 7.0.3: Memory leak in ESQL library