Skip to contentSkip to conversation

: Fix linker error on x86_64

PATCH New Patrick McHardy 1 participant 1 message Jan 6, 2005

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 : Fix linker error on x86_64

Hi Rusty,

I have a couple of nfsim fixes for x86_64. Please review and apply the correct ones.

Thanks,
Patrick

This patch fixes a linker error on x86_64 when linking core/fakesockopt.o:

gcc -Wmissing-prototypes -Wstrict-prototypes -Wunused -Wall -g -Wa,-W -shared -Wl,-soname,fakesockopt.so.1 -nostdlib -ldl \
-o core/fakesockopt.so.1.0 core/fakesockopt.o core/utils.o
/usr/bin/ld: core/fakesockopt.o: relocation R_X86_64_32S can not be used when making a shared object; recompile with -fPIC core/fakesockopt.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [core/fakesockopt.so.1.0] Error 1

Makefile.in +6 -0
Index: Makefile.in
===================================================================
@@ -58,6 +58,12 @@
 		-o $@ $^
 	ln -sf core/fakesockopt.so.1.0 ./
 
+core/fakesockopt.o:
+	$(CC) $(CFLAGS) -c -fPIC core/fakesockopt.c -o core/fakesockopt.o
+
+core/utils.o:
+	$(CC) $(CFLAGS) -c -fPIC core/utils.c -o core/utils.o
+
 core/usage.o: core/usage.c
 core/usage.c: $(USAGE_SOURCES) doc/gen-usage
 	doc/gen-usage $(USAGE_SOURCES) >$@