[Cryptech-Commits] [sw/libhal] 03/05: Don't build position-independent code for stm32.

git at cryptech.is git at cryptech.is
Tue Mar 22 03:06:38 UTC 2016


This is an automated email from the git hooks/post-receive script.

paul at psgd.org pushed a commit to branch rpc
in repository sw/libhal.

commit 46793833737e925af47e57d99bd037226d1cb2c4
Author: Paul Selkirk <paul at psgd.org>
AuthorDate: Mon Mar 21 16:14:07 2016 -0400

    Don't build position-independent code for stm32.
---
 GNUmakefile | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/GNUmakefile b/GNUmakefile
index dc518b3..66f04cb 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -59,6 +59,14 @@ else ifeq (${IO_BUS},fmc)
   IO_OBJ = hal_io_fmc.o
 endif
 
+# If we're building for STM32, position-independent code leads to some
+# hard-to-debug function pointer errors. OTOH, if we're building for Linux
+# (even on the Novena), we want to make it possible to build a shared library.
+
+ifneq (${IO_BUS},fmc)
+  CFLAGS += -fPIC
+endif
+
 # RPC_CLIENT = local | remote | mixed
 #   local: Build for Novena or dev-bridge, access FPGA cores directly.
 #   remote: Build for other host, communicate with RPC server.
@@ -148,7 +156,7 @@ else ifeq (${KS},flash)
 endif
 
 TFMDIR		:= $(abspath ../thirdparty/libtfm)
-CFLAGS		+= -g3 -Wall -fPIC -std=c99 -I${TFMDIR} -DHAL_ECDSA_DEBUG_ONLY_STATIC_TEST_VECTOR_RANDOM=1
+CFLAGS		+= -g3 -Wall -std=c99 -I${TFMDIR} -DHAL_ECDSA_DEBUG_ONLY_STATIC_TEST_VECTOR_RANDOM=1
 LDFLAGS		:= -g3 -L${TFMDIR} -ltfm
 
 CFLAGS		+= -DHAL_STATIC_HASH_STATE_BLOCKS=${STATIC_HASH_STATE_BLOCKS}



More information about the Commits mailing list