Skip to content

Comments

Hide symbols by default for mac/linux#3057

Merged
zcbenz merged 2 commits intoml-explore:mainfrom
zcbenz:posix-hidden-symbols
Jan 25, 2026
Merged

Hide symbols by default for mac/linux#3057
zcbenz merged 2 commits intoml-explore:mainfrom
zcbenz:posix-hidden-symbols

Conversation

@zcbenz
Copy link
Collaborator

@zcbenz zcbenz commented Jan 24, 2026

Change the default symbol visibility to hidden for mac/linux, and require using MLX_API macro for exporting symbols. This makes all platforms use the same symbol visibility, which can reduce the cases that code works for mac/linux but fails for windows.

Hiding symbols by default also has some benefits:

  • Smaller binary size: libmlx.so shrinks from 81M to 79M.
  • Faster loading of shared library.

Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

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

Awesome, thanks!

@zcbenz zcbenz force-pushed the posix-hidden-symbols branch from ca88424 to 5bc5fef Compare January 25, 2026 03:28
@zcbenz zcbenz merged commit 3ac892b into ml-explore:main Jan 25, 2026
16 checks passed
@zcbenz zcbenz deleted the posix-hidden-symbols branch January 25, 2026 05:30
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