Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit d10a406

Browse files
committed
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.
1 parent 2611285 commit d10a406

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/makefiles/Makefile.freebsd

+6
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,13 @@ shlib_symbolic = -Wl,-Bsymbolic -lc
77
endif
88

99
DLSUFFIX = .so
10+
11+
ifeq ($(findstring sparc,$(host_cpu)), sparc)
12+
CFLAGS_SL = -fPIC -DPIC
13+
else
1014
CFLAGS_SL = -fpic -DPIC
15+
endif
16+
1117

1218
%.so: %.o
1319
ifdef ELF_SYSTEM

src/makefiles/Makefile.netbsd

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,13 @@ rpath = -R$(libdir)
99
endif
1010

1111
DLSUFFIX = .so
12+
13+
ifeq ($(findstring sparc,$(host_cpu)), sparc)
14+
CFLAGS_SL = -fPIC -DPIC
15+
else
1216
CFLAGS_SL = -fpic -DPIC
17+
endif
18+
1319

1420
%.so: %.o
1521
ifdef ELF_SYSTEM
@@ -21,8 +27,7 @@ else
2127
@${AR} cq $@.pic `lorder $<.obj | tsort`
2228
${RANLIB} $@.pic
2329
@rm -f $@
24-
$(LD) -x -Bshareable -Bforcearchive \
25-
-o $@ $@.pic
30+
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
2631
endif
2732

2833
sqlmansect = 7

src/makefiles/Makefile.openbsd

+8-3
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,25 @@ shlib_symbolic = -Wl,-Bsymbolic
77
endif
88

99
DLSUFFIX = .so
10+
11+
ifeq ($(findstring sparc,$(host_cpu)), sparc)
12+
CFLAGS_SL = -fPIC -DPIC
13+
else
1014
CFLAGS_SL = -fpic -DPIC
15+
endif
16+
1117

1218
%.so: %.o
1319
ifdef ELF_SYSTEM
14-
$(LD) -x -Bshareable -o $@ $<
20+
$(CC) -shared -o $@ $<
1521
else
1622
$(LD) $(LDREL) $(LDOUT) $<.obj -x $<
1723
@echo building shared object $@
1824
@rm -f $@.pic
1925
@${AR} cq $@.pic `lorder $<.obj | tsort`
2026
${RANLIB} $@.pic
2127
@rm -f $@
22-
$(LD) -x -Bshareable -Bforcearchive \
23-
-o $@ $@.pic
28+
$(LD) -x -Bshareable -Bforcearchive -o $@ $@.pic
2429
endif
2530

2631
sqlmansect = 7

0 commit comments

Comments
 (0)