inline problems at -O0
I wrote Rust bindings to softfloat (https://crates.io/crates/softfloat-sys), however I ran into linking problems since a lot of internal functions are declared inline but there is no out-of-line version of them. As a workaround, I had to make -O1 the minimum optimization level.
Note that I am not using softfloat's makefiles, I instead wrote the build.rs build script based on them.
All of the inline-defined functions are believed to have out-of-line versions, assuming you make all the files correctly. If you can name a specific function for which this is not true, I will look into it.
Please note the difference between the FAST_INT64 and not-FAST_INT64 versions of the builds. It's possible you're not getting the out-of-line function versions because your build script is based on the wrong example Makefile.
softfloat_countLeadingZeros32 is defined when build/Linux-x86_64-GCC/platform.h is included, so the out-of-line version in source/s_countLeadingZeros32.c is #ifdef-ed out.
softfloat_countLeadingZeros32is defined whenbuild/Linux-x86_64-GCC/platform.his included, so the out-of-line version insource/s_countLeadingZeros32.cis#ifdef-ed out.
Okay, I see the problem; it's the inline functions in opts-GCC.h, which were added in the last release. Those functions don't currently have non-inline equivalents.
For now, if you really want to compile with -O0, you can simply remove or comment out these lines from platform.h:
#define SOFTFLOAT_BUILTIN_CLZ 1
#define SOFTFLOAT_INTRINSIC_INT128 1
#include "opts-GCC.h"
As the source documentation explains, including opts-GCC.h is only an optimization improvement.
I imagine the reason this hasn't come up before is because the set of people who use SoftFloat and don't want their compiler to optimize the code is pretty small.