diff --git a/libm/Android.mk b/libm/Android.mk index d7d8bc1e9..4dfb21658 100644 --- a/libm/Android.mk +++ b/libm/Android.mk @@ -239,6 +239,7 @@ libm_common_cflags := \ -Wno-sign-compare \ -Wno-uninitialized \ -Wno-unknown-pragmas \ + -fvisibility=hidden \ libm_common_includes := $(LOCAL_PATH)/upstream-freebsd/lib/msun/src/ diff --git a/libm/include/fenv.h b/libm/include/fenv.h index 6966e0d6b..73ecc8039 100644 --- a/libm/include/fenv.h +++ b/libm/include/fenv.h @@ -34,6 +34,7 @@ #include __BEGIN_DECLS +#pragma GCC visibility push(default) int feclearexcept(int); int fegetexceptflag(fexcept_t *, int); @@ -64,6 +65,7 @@ int fegetexcept(void); extern const fenv_t __fe_dfl_env; #define FE_DFL_ENV (&__fe_dfl_env) +#pragma GCC visibility pop __END_DECLS #endif /* ! _FENV_H_ */ diff --git a/libm/include/math.h b/libm/include/math.h index c26458310..4faec333f 100644 --- a/libm/include/math.h +++ b/libm/include/math.h @@ -20,6 +20,9 @@ #include #include +__BEGIN_DECLS +#pragma GCC visibility push(default) + /* * ANSI/POSIX */ @@ -165,7 +168,7 @@ extern int signgam; * effect of raising floating-point exceptions, so they are not declared * as __pure2. In C99, FENV_ACCESS affects the purity of these functions. */ -__BEGIN_DECLS + /* * ANSI/POSIX */ @@ -282,6 +285,7 @@ double trunc(double); double drem(double, double); int finite(double) __pure2; int isnanf(float) __pure2; +long double significandl(long double); /* * Reentrant version of gamma & lgamma; passes signgam back by reference @@ -464,6 +468,7 @@ void sincosf(float, float*, float*); void sincosl(long double, long double*, long double*); #endif /* _GNU_SOURCE */ +#pragma GCC visibility pop __END_DECLS #endif /* !_MATH_H_ */ diff --git a/tests/math_test.cpp b/tests/math_test.cpp index 63ac71977..b0d541ad1 100644 --- a/tests/math_test.cpp +++ b/tests/math_test.cpp @@ -1067,8 +1067,6 @@ TEST(math, significandf) { ASSERT_FLOAT_EQ(1.5375f, significandf(12.3f)); } -extern "C" long double significandl(long double); // BSD's doesn't declare this. - TEST(math, significandl) { ASSERT_DOUBLE_EQ(0.0L, significandl(0.0L)); ASSERT_DOUBLE_EQ(1.2L, significandl(1.2L));