Skip to content

Remove internal settings.LTO in favor of options.lto - #27422

Open
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove_lto_setting
Open

Remove internal settings.LTO in favor of options.lto#27422
sbc100 wants to merge 1 commit into
emscripten-core:mainfrom
sbc100:remove_lto_setting

Conversation

@sbc100

@sbc100 sbc100 commented Jul 27, 2026

Copy link
Copy Markdown
Collaborator

Followup to #27407

Because settings.LTO was an internal setting not used anywhere in JavaScript libraries or runtime code. This change removes LTO from src/settings_internal.js and stores -flto / -fno-lto state in options.lto on EmccOptions instead.

In the long run I hope to use internal settings only for values that need to flow out the the JS compiler.

@sbc100
sbc100 requested a review from kripken July 27, 2026 22:24
Comment thread tools/building.py Outdated


def lld_flags_for_executable(external_symbols):
from .cmdline import options

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Is this cleaner than using a Setting?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

As I mentioned in the PR description the goal here is really: "In the long run I hope to use internal settings only for values that need to flow out the the JS compiler."

If a certain setting is only used in python code there is no need for it to be setting at all. Hopefully we can make more use of cmdline.options instead.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

You we right though this import here is kind of ugly, it should be at the top level.

@sbc100
sbc100 force-pushed the remove_lto_setting branch from 20e97bd to 918b083 Compare July 28, 2026 23:58
Followup to emscripten-core#27407

Because `settings.LTO` was an internal setting not used anywhere
in JavaScript libraries or runtime code.  This change removes `LTO` from
`src/settings_internal.js` and stores `-flto` / `-fno-lto` state in
`options.lto` on `EmccOptions` instead.
@sbc100
sbc100 force-pushed the remove_lto_setting branch from 918b083 to 9e96101 Compare July 28, 2026 23:59

@kripken kripken left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

lgtm otherwise

Comment thread tools/cache.py


def get_lib_dir(absolute):
from .cmdline import options

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Same here

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