Skip to content

Math symbols - #70

Merged
Amjad50 merged 2 commits into
masterfrom
math_stuff
Feb 23, 2024
Merged

Amjad50 merged 2 commits into
masterfrom
math_stuff

Conversation

@Amjad50

@Amjad50 Amjad50 commented Feb 23, 2024 •

Copy link
Copy Markdown
Owner

Summary

Linked missing math libraries manually for now until rust-lang/compiler-builtins#577 is merged.

This fixes math symbols not found during linkage, as it relies on libc or other sources, that provide math functions from the OS (of course we don't have that)

Related issue

None

Changes

Added math libraries and linked it so that it can be included in std, since std uses emerald_std as a dep.

Checklist

  • The changes are tested and works as expected (mention if not)
  • Documentation
    • not needed
  • Needed README changes
    • not needed

This adds the missing functions `rust/std` require
that are normally available in `libc`

We will update `rust` as well to use these new functions.

We have modified `libm` in the PR: rust-lang/libm#290
to enable building `std`.
This is clunky, as in `std`, we are using a relative path to
`emerald_std`, and I don't really like that. But just to get this done,
since the PRs are very slow.

Here, we are using unstable feature to add all the math symbols, but
with `weak` linking, so that the linker won't panic when it finds two of
them defined (as some of them are already defined).
@Amjad50
Amjad50 enabled auto-merge February 23, 2024 12:16
@Amjad50 Amjad50 changed the title Math stuff Math symbols Feb 23, 2024
@Amjad50
Amjad50 merged commit b2c4a19 into master Feb 23, 2024
@Amjad50
Amjad50 deleted the math_stuff branch February 23, 2024 12:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant