Use -fPIC not -fpic for BSDen on Sparc. Also switch from

$(LD) -x -Bshareable to $(CC) -shared on OpenBSD (I suspect this
should be carried over to the other two as well, but will refrain
pending suggestions from people who actually use those platforms).
Per Stefan Kaltenbrunner.
REL8_0_STABLE
Tom Lane 22 years ago
parent 26112850ec
commit d10a406fe8
  1. 6
      src/makefiles/Makefile.freebsd
  2. 9
      src/makefiles/Makefile.netbsd
  3. 11
      src/makefiles/Makefile.openbsd

@ -7,7 +7,13 @@ shlib_symbolic = -Wl,-Bsymbolic -lc
endif
DLSUFFIX = .so
ifeq ($(findstring sparc,$(host_cpu)), sparc)
CFLAGS_SL = -fPIC -DPIC
else
CFLAGS_SL = -fpic -DPIC
endif
%.so: %.o
ifdef ELF_SYSTEM

@ -9,7 +9,13 @@ rpath = -R$(libdir)
endif
DLSUFFIX = .so
ifeq ($(findstring sparc,$(host_cpu)), sparc)
CFLAGS_SL = -fPIC -DPIC
else
CFLAGS_SL = -fpic -DPIC
endif
%.so: %.o
ifdef ELF_SYSTEM
@ -21,8 +27,7 @@ else
@${AR} cq $@.pic `lorder $<.obj | tsort`
${RANLIB} $@.pic
@rm -f $@
$(LD) -x -Bshareable -Bforcearchive \
-o $@ $@.pic
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
endif
sqlmansect = 7

@ -7,11 +7,17 @@ shlib_symbolic = -Wl,-Bsymbolic
endif
DLSUFFIX = .so
ifeq ($(findstring sparc,$(host_cpu)), sparc)
CFLAGS_SL = -fPIC -DPIC
else
CFLAGS_SL = -fpic -DPIC
endif
%.so: %.o
ifdef ELF_SYSTEM
$(LD) -x -Bshareable -o $@ $<
$(CC) -shared -o $@ $<
else
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
@echo building shared object $@
@ -19,8 +25,7 @@ else
@${AR} cq $@.pic `lorder $<.obj | tsort`
${RANLIB} $@.pic
@rm -f $@
$(LD) -x -Bshareable -Bforcearchive \
-o $@ $@.pic
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
endif
sqlmansect = 7

Loading…
Cancel
Save