diff --git a/src/makefiles/Makefile.freebsd b/src/makefiles/Makefile.freebsd index 90543b7016a..a9e59604d5a 100644 --- a/src/makefiles/Makefile.freebsd +++ b/src/makefiles/Makefile.freebsd @@ -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 diff --git a/src/makefiles/Makefile.netbsd b/src/makefiles/Makefile.netbsd index 59ab7a791fd..531fc1356b5 100644 --- a/src/makefiles/Makefile.netbsd +++ b/src/makefiles/Makefile.netbsd @@ -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 diff --git a/src/makefiles/Makefile.openbsd b/src/makefiles/Makefile.openbsd index 3709d24bdc2..66671e675fb 100644 --- a/src/makefiles/Makefile.openbsd +++ b/src/makefiles/Makefile.openbsd @@ -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