-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
23 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
Math C library feature detection now works for wasm | ||
--------------------------------------------------- | ||
The previous feature detection generated C stubs like: | ||
|
||
.. code-block:: C | ||
void exp(void); // incorrect signature! | ||
exp(); | ||
Then checked whether compiling and linking these worked. This generates warnings | ||
that complain that ``exp`` actually has signature ``double exp(double)`` but would | ||
otherwise work. However ``wasm-ld`` creates a hard error in this case, so when | ||
compiling to a wasm target everything is detected as missing. | ||
|
||
This is now fixed: we feature detect instead with code like: | ||
|
||
.. code-block:: C | ||
double exp(double); // correct signature! | ||
exp((double)0); | ||
which ``wasm-ld`` will link. As a side effect, the feature detection code now | ||
works without generating linker warnings. |