Skip to content

Conversation

@sbc100
Copy link
Collaborator

@sbc100 sbc100 commented Nov 24, 2021

This code is kind of in the wrong place. If we wanted to keep
it we could move it to emcc.py:2164 where we export symbols needed
by the sanitizers:

  if sanitize:
    settings.USE_OFFSET_CONVERTER = 1
    settings.EXPORTED_FUNCTIONS += [
        '_memalign',
        '_emscripten_builtin_memalign',
        '_emscripten_builtin_malloc',
        '_emscripten_builtin_free',
        '___heap_base',
        '___global_base'
    ]

However, I don't think we do need it. The comment set that memset is
needed for mmap but mmap uses the zeroMemory JS function which
does not depend on memset (perhaps it once did?)

This code is kind of in the wrong place.  If we wanted to keep
it we could move it to emcc.py:2164 where we export symbols needed
by the sanitizers:

```
  if sanitize:
    settings.USE_OFFSET_CONVERTER = 1
    settings.EXPORTED_FUNCTIONS += [
        '_memalign',
        '_emscripten_builtin_memalign',
        '_emscripten_builtin_malloc',
        '_emscripten_builtin_free',
        '___heap_base',
        '___global_base'
    ]
```

However, I don't think we do need.  The comment set that `memset` is
needed for `mmap` but `mmap` uses the `zeroMemory` JS function which
does not depend on `memset` (perhaps it once did?)
@sbc100 sbc100 requested a review from kripken November 24, 2021 00:31
Copy link
Member

@kripken kripken left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I guess once we needed memset but no longer do. lgtm if tests pass.

@sbc100 sbc100 enabled auto-merge (squash) November 24, 2021 00:47
@sbc100 sbc100 disabled auto-merge November 24, 2021 00:47
@sbc100 sbc100 enabled auto-merge (squash) November 24, 2021 00:47
@sbc100 sbc100 merged commit ef44b94 into main Nov 24, 2021
@sbc100 sbc100 deleted the remove_uneeded_export branch November 24, 2021 01:26
sbc100 added a commit that referenced this pull request Nov 30, 2021
I recently landed #15617 which inadvertently broke asan builds because,
under asan, there was a real dependency on `_memset` in the
`withBuiltinMalloc` wrapper.   However this dependency is no longer
needed since the use of `_memset` was removed from the JS library code
in #14441.
sbc100 added a commit that referenced this pull request Nov 30, 2021
I recently landed #15617 which inadvertently broke asan builds because,
under asan, there was a real dependency on `_memset` in the
`withBuiltinMalloc` wrapper.   However this dependency is no longer
needed since the use of `_memset` was removed from the JS library code
in #14441.
sbc100 added a commit that referenced this pull request Nov 30, 2021
I recently landed #15617 which inadvertently broke asan builds because,
under asan, there was a real dependency on `_memset` in the
`withBuiltinMalloc` wrapper.   However this dependency is no longer
needed since the use of `_memset` was removed from the JS library code
in #14441.
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
This code is kind of in the wrong place.  If we wanted to keep
it we could move it to emcc.py:2164 where we export symbols needed
by the sanitizers:

```
  if sanitize:
    settings.USE_OFFSET_CONVERTER = 1
    settings.EXPORTED_FUNCTIONS += [
        '_memalign',
        '_emscripten_builtin_memalign',
        '_emscripten_builtin_malloc',
        '_emscripten_builtin_free',
        '___heap_base',
        '___global_base'
    ]
```

However, I don't think we do need it.  The comment set that `memset` is
needed for `mmap` but `mmap` uses the `zeroMemory` JS function which
does not depend on `memset` (perhaps it once did?)
mmarczell-graphisoft pushed a commit to GRAPHISOFT/emscripten that referenced this pull request Jan 5, 2022
…5654)

I recently landed emscripten-core#15617 which inadvertently broke asan builds because,
under asan, there was a real dependency on `_memset` in the
`withBuiltinMalloc` wrapper.   However this dependency is no longer
needed since the use of `_memset` was removed from the JS library code
in emscripten-core#14441.
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.

3 participants