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

Makefile.uk: Include missing cpow* functions #64

Closed
wants to merge 2 commits into from

Conversation

andreittr
Copy link
Contributor

The complex number library was previously missing the implementation of cpow* functions. This change corrects this omission.

@razvand razvand added the enhancement New feature or request label Aug 5, 2023
@razvand razvand self-assigned this Aug 5, 2023
Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@andreittr I get the following errors when building with the musl-complex library enabled:

/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpow':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpow.c:7: undefined reference to `__muldc3'
/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpowf':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpowf.c:5: undefined reference to `__mulsc3'
/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpowl':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpowl.c:11: undefined reference to `__mulxc3'

Is there anything I'm missing?

@andreittr
Copy link
Contributor Author

@andreittr I get the following errors when building with the musl-complex library enabled:

/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpow':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpow.c:7: undefined reference to `__muldc3'
/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpowf':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpowf.c:5: undefined reference to `__mulsc3'
/usr/bin/ld: workdir/apps/nginx/build/libmusl.o: in function `cpowl':
workdir/apps/nginx/build/libmusl/origin/musl-1.2.3//src/complex/cpowl.c:11: undefined reference to `__mulxc3'

Is there anything I'm missing?

These functions are emitted by the compiler and implemented in lib-compiler-rt (especially if you're building with clang, does it happen with GCC as well?). More details here.
You might want to grab unikraft/lib-compiler-rt#14 as well to not have to pull in an entire C++ runtime.

The complex number library was previously missing the implementation of
cpow* functions. This change corrects this omission.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
@StefanJum
Copy link
Member

These functions are emitted by the compiler and implemented in lib-compiler-rt (especially if you're building with clang, does it happen with GCC as well?). More details here. You might want to grab unikraft/lib-compiler-rt#14 as well to not have to pull in an entire C++ runtime.

Yes, it happens on gcc too. Should we then do a select or depends on for the compiler-rt library in case LIBMUSL_COMPLEX is selected?

The cpow* functions provided by libcomplex make use of the `__mul?c3`
functions, implemented by libcompiler-rt, when building with either
Clang or GCC.
Therefore, this change makes musl unconditionally select libcompiler-rt
when building libcomplex.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
@andreittr
Copy link
Contributor Author

Yes, it happens on gcc too. Should we then do a select or depends on for the compiler-rt library in case LIBMUSL_COMPLEX is selected?

Updated w/ new commit; had libcomplex select compiler-rt.

Copy link
Member

@StefanJum StefanJum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All good, thank you.
Reviewed-by: Stefan Jumarea stefanjumarea02@gmail.com

Copy link
Contributor

@razvand razvand left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved-by: Razvan Deaconescu razvand@unikraft.io

unikraft-bot pushed a commit that referenced this pull request Aug 9, 2023
The cpow* functions provided by libcomplex make use of the `__mul?c3`
functions, implemented by libcompiler-rt, when building with either
Clang or GCC.
Therefore, this change makes musl unconditionally select libcompiler-rt
when building libcomplex.

Signed-off-by: Andrei Tatar <andrei@unikraft.io>
Reviewed-by: Stefan Jumarea <stefanjumarea02@gmail.com>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #64
nderjung added a commit to nderjung/unikraft that referenced this pull request Aug 9, 2023
Following the merge of [0], the use of complex numbers requires the
external microlibrary `compiler-rt`[1].  Without this inclusion, builds
that set `CONFIG_LIBMUSL_COMPLEX` will fail.

[0]: unikraft/lib-musl#64
[1]: https://github.com/unikraft/lib-compiler-rt

Signed-off-by: Alexander Jung <alex@unikraft.io>
unikraft-bot pushed a commit to unikraft/unikraft that referenced this pull request Aug 9, 2023
Following the merge of [0], the use of complex numbers requires the
external microlibrary `compiler-rt`[1].  Without this inclusion, builds
that set `CONFIG_LIBMUSL_COMPLEX` will fail.

[0]: unikraft/lib-musl#64
[1]: https://github.com/unikraft/lib-compiler-rt

Signed-off-by: Alexander Jung <alex@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1033
@andreittr andreittr deleted the ttr/cpow branch August 9, 2023 19:54
craciunoiuc pushed a commit to unikraft-bananatree/unikraft that referenced this pull request Mar 26, 2024
Following the merge of [0], the use of complex numbers requires the
external microlibrary `compiler-rt`[1].  Without this inclusion, builds
that set `CONFIG_LIBMUSL_COMPLEX` will fail.

[0]: unikraft/lib-musl#64
[1]: https://github.com/unikraft/lib-compiler-rt

Signed-off-by: Alexander Jung <alex@unikraft.io>
Reviewed-by: Razvan Deaconescu <razvand@unikraft.io>
Approved-by: Razvan Deaconescu <razvand@unikraft.io>
Tested-by: Unikraft CI <monkey@unikraft.io>
GitHub-Closes: #1033
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/merged enhancement New feature or request
Projects
Status: Done!
Development

Successfully merging this pull request may close these issues.

None yet

4 participants