lowdown: fix musl build

Whenever building a shared library, we need to compile with -fPIC.
(This is sometimes implicitly added by the hardening flags, but not
always, e.g. for pkgsMusl.)
This commit is contained in:
Ryan Burns 2021-08-16 00:07:41 -07:00
parent 739f0b22b7
commit 803abbf2bc

View File

@ -11,10 +11,11 @@ index 955f737..2c9532c 100644
www: $(HTMLS) $(PDFS) $(THUMBS) lowdown.tar.gz lowdown.tar.gz.sha512 www: $(HTMLS) $(PDFS) $(THUMBS) lowdown.tar.gz lowdown.tar.gz.sha512
@@ -101,6 +101,9 @@ lowdown-diff: lowdown @@ -101,6 +101,10 @@ lowdown-diff: lowdown
liblowdown.a: $(OBJS) $(COMPAT_OBJS) liblowdown.a: $(OBJS) $(COMPAT_OBJS)
$(AR) rs $@ $(OBJS) $(COMPAT_OBJS) $(AR) rs $@ $(OBJS) $(COMPAT_OBJS)
+%.o: CFLAGS += -fPIC
+liblowdown.so: $(OBJS) $(COMPAT_OBJS) +liblowdown.so: $(OBJS) $(COMPAT_OBJS)
+ $(CC) -shared -o $@ $(OBJS) $(COMPAT_OBJS) $(LDFLAGS) + $(CC) -shared -o $@ $(OBJS) $(COMPAT_OBJS) $(LDFLAGS)
+ +