From 08edce4ec776b91bea78169e5cd86ef828ee5ee6 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Tue, 5 Jan 2016 22:56:29 +0000 Subject: [PATCH] C-Sources are not kept in the order they are defined. fix #58 Cabal links to all C-sources defined unconditionally, then conditionally append blocks that defined C-Sources; This lead to bug when the order of .c files are important, like for cabal repl. Workaround this bug, by defining everything aes related in the conditional part. --- cryptonite.cabal | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/cryptonite.cabal b/cryptonite.cabal index b9a3ec5..c3f9b9b 100644 --- a/cryptonite.cabal +++ b/cryptonite.cabal @@ -191,9 +191,6 @@ Library , cbits/cryptonite_salsa.c , cbits/cryptonite_rc4.c , cbits/cryptonite_cpu.c - , cbits/aes/generic.c - , cbits/aes/gf.c - , cbits/cryptonite_aes.c , cbits/curve25519/curve25519-donna.c , cbits/ed25519/ed25519.c , cbits/p256/p256.c @@ -239,7 +236,14 @@ Library CC-options: -mssse3 -maes -DWITH_AESNI if flag(support_pclmuldq) CC-options: -msse4.1 -mpclmul -DWITH_PCLMUL - C-sources: cbits/aes/x86ni.c + C-sources: cbits/aes/x86ni.c + , cbits/aes/generic.c + , cbits/aes/gf.c + , cbits/cryptonite_aes.c + else + C-sources: cbits/aes/generic.c + , cbits/aes/gf.c + , cbits/cryptonite_aes.c if arch(x86_64) || flag(support_blake2_sse) C-sources: cbits/blake2/sse/blake2s.c