Skip to content
  • Luite Stegeman's avatar
    14ed9727
    JS: Improve compatibility with recent emsdk · 14ed9727
    Luite Stegeman authored and Ben Gamari's avatar Ben Gamari committed
    The JavaScript code in libraries/base/jsbits/base.js had some
    hardcoded offsets for fields in structs, because we expected
    the layout of the data structures to remain unchanged. Emsdk
    3.1.42 changed the layout of the stat struct, breaking this
    assumption, and causing code in .hsc files accessing the
    stat struct to fail.
    
    This patch improves compatibility with recent emsdk by
    removing the assumption that data layouts stay unchanged:
    
        1. offsets of fields in structs used by JavaScript code are
           now computed by the configure script, so both the .js and
           .hsc files will automatically use the new layout if anything
           changes.
        2. the distrib/configure script checks that the emsdk version
           on a user's system is the same version that a bindist was
           booted with, to avoid data layout inconsistencies
    
    See #23641
    
    (cherry picked from commit aa07402e)
    14ed9727
    JS: Improve compatibility with recent emsdk
    Luite Stegeman authored and Ben Gamari's avatar Ben Gamari committed
    The JavaScript code in libraries/base/jsbits/base.js had some
    hardcoded offsets for fields in structs, because we expected
    the layout of the data structures to remain unchanged. Emsdk
    3.1.42 changed the layout of the stat struct, breaking this
    assumption, and causing code in .hsc files accessing the
    stat struct to fail.
    
    This patch improves compatibility with recent emsdk by
    removing the assumption that data layouts stay unchanged:
    
        1. offsets of fields in structs used by JavaScript code are
           now computed by the configure script, so both the .js and
           .hsc files will automatically use the new layout if anything
           changes.
        2. the distrib/configure script checks that the emsdk version
           on a user's system is the same version that a bindist was
           booted with, to avoid data layout inconsistencies
    
    See #23641
    
    (cherry picked from commit aa07402e)
Loading