Skip to content

Fix snmalloc linking regression#7161

Merged
achamayou merged 1 commit intomicrosoft:mainfrom
achamayou:fix_snmalloc_linking_regression
Aug 4, 2025
Merged

Fix snmalloc linking regression#7161
achamayou merged 1 commit intomicrosoft:mainfrom
achamayou:fix_snmalloc_linking_regression

Conversation

@achamayou
Copy link
Copy Markdown
Member

Fix for regression introduced in #7137 that resulted in end to end binaries no longer actually using snmalloc, because the setting of SNMALLOC_STATIC_LIBRARY_PREFIX is scoped too narrowly and does not result in a static libraries with the un-prefixed malloc, free etc symbols being produced.

@achamayou achamayou requested a review from a team as a code owner August 4, 2025 14:59
@achamayou achamayou added this pull request to the merge queue Aug 4, 2025
Merged via the queue into microsoft:main with commit cba9a90 Aug 4, 2025
16 checks passed
@achamayou achamayou deleted the fix_snmalloc_linking_regression branch August 4, 2025 17:11
@achamayou
Copy link
Copy Markdown
Member Author

Basic JS, pre and post:

image

mjp41 added a commit to mjp41/snmalloc that referenced this pull request Aug 5, 2025
The use of CACHE in the SNMALLOC_STATIC_LIBRARY_PREFIX was not correctly handled by cmake before 3.21.

> The “set(CACHE)” command no longer removes a normal variable of the
same name, if any. See policy “CMP0126”.

Changing the minimum version means that containing projects can do:

```CMake
set(SNMALLOC_STATIC_LIBRARY_PREFIX "my_prefix")
```

Without this, there were weird behaviours that the first compile used "sn_" and then subsequent compiles used "my_prefix".

Thanks to @achamayou for debugging this in CCF. microsoft/CCF#7161
mjp41 added a commit to microsoft/snmalloc that referenced this pull request Aug 5, 2025
The use of CACHE in the SNMALLOC_STATIC_LIBRARY_PREFIX was not correctly handled by cmake before 3.21.

> The “set(CACHE)” command no longer removes a normal variable of the
same name, if any. See policy “CMP0126”.

Changing the minimum version means that containing projects can do:

```CMake
set(SNMALLOC_STATIC_LIBRARY_PREFIX "my_prefix")
```

Without this, there were weird behaviours that the first compile used "sn_" and then subsequent compiles used "my_prefix".

Thanks to @achamayou for debugging this in CCF. microsoft/CCF#7161
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