From 2e5617c9a6d76b5acd2f04c8567c47803599e843 Mon Sep 17 00:00:00 2001 From: David Sterba Date: Mon, 28 Aug 2017 13:33:19 +0200 Subject: [PATCH] btrfs-progs: build: fix building libbtrfs.so with tsan Except libbtrfs.so object, all other tools compile fine. The error is: ld: send-stream.o: relocation R_X86_64_PC32 against symbol `stderr@@GLIBC_2.2.5' can not be used when making a shared object; recompile with -fPIC Compiling with -fPIC fixes the problem. Signed-off-by: David Sterba --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3d55203f..3bc9bb40 100644 --- a/Makefile +++ b/Makefile @@ -167,7 +167,7 @@ ifneq (,$(findstring asan,$(D))) endif ifneq (,$(findstring tsan,$(D))) - DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIE + DEBUG_CFLAGS_INTERNAL += -fsanitize=thread -fPIC DEBUG_LDFLAGS_INTERNAL += -fsanitize=thread -ltsan -pie endif