From 7306c5ff46e165d5fafaace99fc0259bfd3ec17c Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Sat, 8 Dec 2012 08:00:03 +0100 Subject: [PATCH] build: fix `make libuv.so CFLAGS=` 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. --- config-unix.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config-unix.mk b/config-unix.mk index 66c7f3fa..24705b6a 100644 --- a/config-unix.mk +++ b/config-unix.mk @@ -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)