Patch from Aurora SPARC linux project -- -fpic verus -fPIC.
I received a patch the other day from Tom Callaway ('spot'), who is the lead
for the Aurora SPARC Linux project (auroralinux.org). He is working through
updating Aurora to a Red Hat 9 base, up from the current (very stable) Red
Hat 7.3 base.
I am an Aurora user, and am using PostgreSQL 7.2.4 on Aurora 1.0 in
production.
The patch is attached, but brings up a question that I have already briefly
discussed with Tom Lane, who's suggestion was interesting. The patch is
intended to change the existing '-fpic' gcc option to '-fPIC' for sparc, for
the CFLAGS_SL in src/makefiles/Makefile.linux. Tom's suggestion, which I had
given cursory thought to when I received the patch, is to change to -fPIC
across the board instead of -fpic.
Is there a good reason to use -fpic instead of -fPIC? PostgreSQL 7.2.4
compiles and links fine on SPARC under the gcc 2.96RH compiler; 7.3.2 does
not link OK under the gcc 3.2 compiler, both with -fpic.
--
Lamar Owen
WGCR Internet Radio
1 Peter 4:11
Attachments:
postgresql-732-sparc.patchtext/x-diff; charset=us-ascii; name=postgresql-732-sparc.patchDownload
--- postgresql-7.3.2/src/makefiles/Makefile.linux.BAD Wed Aug 29 15:14:40 2001
+++ postgresql-7.3.2/src/makefiles/Makefile.linux Tue Apr 29 00:32:55 2003
@@ -1,10 +1,15 @@
AROPT = crs
+ARCH := $(patsubst ppc64,ppc,$(patsubst sparc64,sparc,$(patsubst i%86,i386,$(shell uname -m))))
export_dynamic = -export-dynamic
rpath = -Wl,-rpath,$(libdir)
shlib_symbolic = -Wl,-Bsymbolic
allow_nonpic_in_shlib = yes
DLSUFFIX = .so
+ifeq (sparc,$(ARCH))
+CFLAGS_SL = -fPIC
+else
CFLAGS_SL = -fpic
+endif
%.so: %.o
$(CC) -shared -o $@ $<