Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing extern "C" block in newlib #124

Open
TheDan64 opened this issue Jun 27, 2019 · 0 comments
Open

Missing extern "C" block in newlib #124

TheDan64 opened this issue Jun 27, 2019 · 0 comments
Labels
bug Something isn't working

Comments

@TheDan64
Copy link
Contributor

With the default configuration, newlib will be missing four math functions' extern C "declarations" in rust:

error[E0425]: cannot find function `fabsl` in this scope
  --> src/cephes_subrl.rs:39:24
   |
39 |     if f128::f128::new(fabsl(x)) <= f128::f128::new(0.5) {
   |                        ^^^^^ not found in this scope

error[E0425]: cannot find function `coshl` in this scope
  --> src/cephes_subrl.rs:40:30
   |
40 |         *c = f128::f128::new(coshl(x));
   |                              ^^^^^ not found in this scope

error[E0425]: cannot find function `sinhl` in this scope
  --> src/cephes_subrl.rs:41:30
   |
41 |         *s = f128::f128::new(sinhl(x))
   |                              ^^^^^ not found in this scope

error[E0425]: cannot find function `expl` in this scope
  --> src/cephes_subrl.rs:43:29
   |
43 |         e = f128::f128::new(expl(x));
   |                             ^^^^ not found in this scope

This can be worked around with the --disable-newlib-fno-builtin flag configuration. It seems to be due to including libc/include/math.h which overrides the std math.h (which does work fine)

@TheDan64 TheDan64 added the bug Something isn't working label Jun 27, 2019
@kkysen kkysen changed the title Missing extern "C" block in newlib Missing extern "C" block in newlib Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant