Reputation: 451
Recently, glibc (namely with glibc 2.31, included in Ubuntu 20.04) seems to have removed families of functions like __exp_finite()
.
These functions were used when compiling with gcc's option -ffinite-math-only
(or -ffast-math
, which enables the said option).
My problem is that I have compiled closed sources static libraries provided by third parties which have been presumably compiled with this flag and those libraries generate linking errors to missing math functions like __exp_finite()
.
My question is what is my better solution?
I would prefer to omit solutions which involes compiling in a different environment than the native one provided by Ubuntu (and later probably other distribution as they upgrade glibc).
Hopefully I have understood the problem correctly and any help is appreciated.
Upvotes: 2
Views: 1695
Reputation: 451
I added the following c++ file to our main project, defining the missing functions:
#include <math.h>
extern "C" {
double __exp_finite(double x) { return exp(x); }
double __log_finite(double x) { return log(x); }
double __pow_finite(double x, double y) { return pow(x, y); }
float __expf_finite(float x) { return expf(x); }
float __logf_finite(float x) { return logf(x); }
float __powf_finite(float x, float y) { return powf(x, y); }
}
It's by far the quickest solution.
Upvotes: 4