corsis / clock

High-resolution clock functions: monotonic, realtime, cputime.
Other
58 stars 25 forks source link

Fix linking issues on 32-bit Windows #52

Closed RyanGlScott closed 6 years ago

RyanGlScott commented 6 years ago

Since clock compiles its bundled C code with -O3, gcc will optimize a division followed by a modulo calculation to a single 64-bit divmod. This isn't natively supported on 32-bit architectures, which can lead to bizarre linking errors (as in #50). To avoid this, we simply prevent gcc from doing this optimization using an __attribute__.

For more information, see the discussion at https://ghc.haskell.org/trac/ghc/ticket/15094.