Skip to content

Conversation

@adamziel
Copy link
Collaborator

No description provided.

@adamziel adamziel merged commit 36b362e into trunk Dec 13, 2022
@adamziel adamziel deleted the rename-to-playground branch December 13, 2022 20:05
bgrgicak pushed a commit that referenced this pull request May 7, 2025
## Motivation for the change, related issues

We currently live with the following undefined symbol warnings when
linking with Emscripten:
```
#84 1.878 warning: undefined symbol: SharpYuvConvert (referenced by root reference (e.g. compiled C/C++ code))                                                                                              
#84 1.878 warning: undefined symbol: SharpYuvGetConversionMatrix (referenced by root reference (e.g. compiled C/C++ code))
#84 1.878 warning: undefined symbol: SharpYuvInit (referenced by root reference (e.g. compiled C/C++ code))                 
#84 1.880 warning: undefined symbol: getcontext (referenced by root reference (e.g. compiled C/C++ code))                       
#84 1.880 warning: undefined symbol: getdtablesize (referenced by root reference (e.g. compiled C/C++ code))                                                                                                
#84 1.880 warning: undefined symbol: makecontext (referenced by root reference (e.g. compiled C/C++ code))                                                                                                  
#84 1.880 warning: undefined symbol: swapcontext (referenced by root reference (e.g. compiled C/C++ code)) 
```

If any new undefined symbols come up, we would not notice them because
we set `ERROR_ON_UNDEFINED_SYMBOLS=0`. Let's change this to error so we
do not quietly miss new undefined symbols.

## Implementation details

Set ERROR_ON_UNDEFINED_SYMBOLS=1 so the Emscripten linker fails if there
are any undefined symbols.

We have been living with a number of undefined symbols. Some are
undefined because Emscripten does not provide them, and others are
undefined because we needed to link to an additional library. This PR
addresses both cases.

In order to be explicit and intentional about undefined symbols we know
and accept, this PR adds a JS library for Emscripten that explicitly
lists known undefined symbols and declares stubs for them that fail if
called. This way, we document the undefined symbols we know about and
avoid complaints from Emscripten.

## Testing Instructions (or ideally a Blueprint)

- CI
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants