tomsfastmath
tomsfastmath copied to clipboard
allow tomsfastmath to be built without stdlib
This commit enables tomsfastmath to be built with --no-standard-libraries provided TFM_NO_STDLIB is defined, which happens automatically if a web assembly build target is detected.
The only functionality this disables is the fp_rand function.
This pull request is also contains the required changes in #32 and #33.
I use clang for webasm builds, it does work there. I can add some guards to try to verify the compiler, though.
On September 16, 2024 6:17:20 AM GMT+01:00, Richard Levitte @.***> wrote:
@levitte commented on this pull request.
+#if TFM_NO_STDLIB +/* do nothing */
This worries me a bit, 'cause it allows anyone to defined
-DTOM_NO_STDLIB=1regardless of compiler, and when looking through the code, this feature makes heavy use of GCC features.People might want to build without having to link with stdlib for other reasons than webasm...
It's possible that this should simply be documented with fierce warnings not to try this with other compilers than GCC or derivatives thereof (like clang)
That would be a good thing, methinks
I use clang for webasm builds, it does work there. I can add some guards to try to verify the compiler, though. … On September 16, 2024 6:17:20 AM GMT+01:00, Richard Levitte @.**> wrote: @levitte commented on this pull request. > +#if TFM_NO_STDLIB +/ do nothing */ This worries me a bit, 'cause it allows anyone to defined
-DTOM_NO_STDLIB=1regardless of compiler, and when looking through the code, this feature makes heavy use of GCC features. People might want to build without having to link with stdlib for other reasons than webasm... It's possible that this should simply be documented with fierce warnings not to try this with other compilers than GCC or derivatives thereof (like clang)