tomsfastmath icon indicating copy to clipboard operation
tomsfastmath copied to clipboard

allow tomsfastmath to be built without stdlib

Open ryancdotorg opened this issue 1 year ago • 2 comments

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.

ryancdotorg avatar Jan 06 '24 13:01 ryancdotorg

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=1 regardless 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)

ryancdotorg avatar Sep 16 '24 06:09 ryancdotorg

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=1 regardless 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)

levitte avatar Sep 16 '24 07:09 levitte