[Buildroot] [PATCH v1 2/3] package/libtomcrypt: compile with -fPIC to enable linking to dynamic libraries/exectuables

Peter Seiderer ps.report at gmx.net
Mon Apr 12 19:55:26 UTC 2021


Fixes:

  .../x86_64-buildroot-linux-gnu/bin/ld: .../host/x86_64-buildroot-linux-gnu/sysroot/usr/lib/libtomcrypt.a(md5.o): relocation R_X86_64_32 against `.rodata.str1.1' can not be used when making a shared object; recompile with -fPIC

Signed-off-by: Peter Seiderer <ps.report at gmx.net>
---
 package/libtomcrypt/libtomcrypt.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package/libtomcrypt/libtomcrypt.mk b/package/libtomcrypt/libtomcrypt.mk
index fa6dde64cd..b6ad77daec 100644
--- a/package/libtomcrypt/libtomcrypt.mk
+++ b/package/libtomcrypt/libtomcrypt.mk
@@ -17,7 +17,7 @@ LIBTOMCRYPT_DEPENDENCIES = libtommath
 # 0001-fix-CVE-2019-17362.patch
 LIBTOMCRYPT_IGNORE_CVES += CVE-2019-17362
 
-LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -DLTC_SOURCE -DLTM_DESC
+LIBTOMCRYPT_CFLAGS = -I./src/headers $(TARGET_CFLAGS) -fPIC -DLTC_SOURCE -DLTM_DESC
 
 define LIBTOMCRYPT_BUILD_CMDS
 	$(TARGET_MAKE_ENV) $(MAKE) -C $(@D) $(TARGET_CONFIGURE_OPTS) CFLAGS="$(LIBTOMCRYPT_CFLAGS)"
-- 
2.31.1



More information about the buildroot mailing list