summaryrefslogtreecommitdiffstats
path: root/config
AgeCommit message (Collapse)Author
2018-10-12Bugfix: Math function checkingAlex Ozdemir
We had config machinery that determined which math functions are available in libc. If a c math function was missing on the host system, then the corresponding jq function would be removed from the source, enabling the build to proceed anyway. The detection machinery was broken in a subtle way, as was shown after glibc updated to 2.27, dropping the `pow10` function. This caused compilation to fail. The essential problem was that we detected whether a math function was available by compiling and linking a small program evaluating that function on constants. However, since gcc's optimization machinery has special knowledge of some math functions (e.g. `pow10`), it can optimize them away, even if they don't exist in the library and are not linkable. That is, the following example compiles and links against glibc 2.27, even though `pow10` has been removed: ``` int main () { printf("%f", pow10(0.5)); return 0; } ``` What?! On the other hand, this program does not link: ``` int main () { double f; printf("%f", &f); printf("%f", pow10(f)); return 0; } ``` In the first program the call to `pow10` can be optimized away as a constant expression. This requires GCC to know about `pow10` (which it does!), but it does not require `pow10` to be in the library (and actually linkable). The solution is to use autoconf's machinery for detecting function presence, instead of our own (buggy) machinery. This has the added benefit of simplifying the code. The bug was reported in issue #1659
2015-06-27Add `pow`, better libm detection (fix #443)Nicolas Williams
2014-06-01Update .gitignore and config/.gitignoreNicolas Williams
2014-04-16Add autoconf checks for pthreads; fix #340Nicolas Williams
2013-12-20Ignore the config/test-driver filePhilipp Hagemeister
This file is automatically generated and does not need to be committed.
2013-06-23Move libtool m4 junk to config/ and delete some autogenerated files.Stephen Dolan
2013-05-08Check in a pile of Autotools junk, including the configure script.Stephen Dolan