git.iko.soy/typeable/entropy
on main help sign in
Include cpp options as cc options

Most versions of cabal are not sending the options as one might hope and expect.

commit80f7d6b885a279b598d2bd6263e7b8f7c96997e4 authorThomas M. DuBuisson <tommd@galois.com> dateWed 11 Jun 2014, 07:54 (12 years ago) parentb1dd48b
2 files changed+4−1
cbits/rdrand.c+1−1 entropy.cabal+3
cbits/rdrand.c+1−1
@@ -11,6 +11,7 @@ int cpu_has_rdrand()
1111 return (cx & 0x40000000);
1212}
1313
14+#ifdef arch_x86_64
1415// Returns 1 on success
1516inline int _rdrand64_step(uint64_t *therand)
1617{
@@ -20,7 +21,6 @@ inline int _rdrand64_step(uint64_t *therand)
2021 return (int) err;
2122}
2223
23−#ifdef arch_x86_64
2424// Returns 0 on success, non-zero on failure.
2525int get_rand_bytes(uint8_t *therand, size_t len)
2626{
entropy.cabal+3
@@ -45,13 +45,16 @@ library
4545 cc-options: -DXEN -DHAVE_RDRAND
4646 if arch(x86_64)
4747 cpp-options: -Darch_x86_64
48+ cc-options: -Darch_x86_64
4849 -- gcc 4.8.2 on i386 fails to compile rdrand.c when using -fPIC!
4950 c-sources: cbits/rdrand.c
5051 include-dirs: cbits
5152 if arch(i386)
5253 cpp-options: -Darch_i386
54+ cc-options: -Darch_i386
5355 if os(windows)
5456 cpp-options: -DisWindows
57+ cc-options: -DisWindows
5558 extra-libraries: advapi32
5659 else
5760 if !flag(halvm)