PG Extensions: Must be statically linked? - Mailing list pgsql-hackers

From Craig A. James
Subject PG Extensions: Must be statically linked?
Date
Msg-id 44076707.8030804@modgraph-usa.com
Whole thread Raw
Responses Re: PG Extensions: Must be statically linked?  (Peter Eisentraut <peter_e@gmx.net>)
Re: PG Extensions: Must be statically linked?  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
I'm creating user-defined server extensions, written in C per the manual "31.9. C-Language Functions".  Everything
workswell, but only if I fully link the .so such that there are *no* unresolved external references at all.  Not even
thestuff in libstdc++.a can be left out.  I've tried setting LD_LIBRARY_PATH everywhere possible, with no luck.  Here's
themake(1) line I have to use to link:
 

libmyfuncs.so.0.0:gcc -Wall -Wmissing-prototypes -Wpointer-arith \  -Wdeclaration-after-statement
-Wold-style-definition-Wendif-labels \  -fno-strict-aliasing -fpic -shared -Wl,-soname,libmyfuncs.so.0  \  $(OBJS) \
$(MYLIB)/lib/libmylibs.a\  /usr/lib/gcc/i386-redhat-linux/3.4.2/libstdc++.a \  -o libmyfuncs.so.0.0
 

Is this correct?  Do Postgres extension need to be fully statically linked?  Or is there some configuration that will
specifyLD_LIBRARY_PATH (or perhaps a Postgres-specific equivalent).
 

The manual's instructions are good regarding writing code, but don't say much about linking.

Thanks,
Craig


pgsql-hackers by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Uninstall script errors
Next
From: Peter Eisentraut
Date:
Subject: Re: PG Extensions: Must be statically linked?