build: fix make libuv.so CFLAGS=<options>

Running a make target that builds the shared object while overriding the CFLAGS
variable from the command line, would fail with a relocation error:

   relocation R_X86_64_32 against `.text' can not be used when making a shared
   object; recompile with -fPIC

Fix that by adding -fPIC unconditionally.
This commit is contained in:
Ben Noordhuis 2012-12-08 08:00:03 +01:00
parent 2e4488f35a
commit 7306c5ff46

View File

@ -126,7 +126,7 @@ endif
libuv.a: $(OBJS)
$(AR) rcs $@ $^
libuv.$(SOEXT): CFLAGS += -fPIC
libuv.$(SOEXT): override CFLAGS += -fPIC
libuv.$(SOEXT): $(OBJS)
$(CC) -shared -o $@ $^ $(LINKFLAGS)