From c82785473d01f73fe69e951f7cfe670a2d3f1900 Mon Sep 17 00:00:00 2001 From: Vincent Hanquez Date: Wed, 10 Feb 2016 12:05:42 +0000 Subject: [PATCH] Workaround bug with old distributions c99 issue When in c99 mode (which is needed for some of our newer additions), old distributions has an glibc inlining bug which triggers lots of duplicated symbols. Add a cabal flag to revert the inliner to c89 mode. Fixes #64 --- cryptonite.cabal | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cryptonite.cabal b/cryptonite.cabal index d9ffc3e..4c1cf06 100644 --- a/cryptonite.cabal +++ b/cryptonite.cabal @@ -80,6 +80,11 @@ Flag support_deepseq Default: True Manual: True +Flag old_toolchain_inliner + Description: use -fgnu89-inline to workaround an old compiler / linker / glibc issue. + Default: False + Manual: True + Library Exposed-modules: Crypto.Cipher.AES Crypto.Cipher.Blowfish @@ -187,6 +192,8 @@ Library ghc-options: -Wall -fwarn-tabs -optc-O3 -fno-warn-unused-imports default-language: Haskell2010 cc-options: -std=gnu99 + if flag(old_toolchain_inliner) + cc-options: -fgnu89-inline C-sources: cbits/cryptonite_chacha.c , cbits/cryptonite_salsa.c , cbits/cryptonite_rc4.c