Skip to content

Why is '--no-gc-sections' added in build with MAIN_MODULE/SIDE_MODULE=1? #16926

Answered by sbc100
alexander-veselov asked this question in Q&A
Discussion options

You must be logged in to vote

Because with -sMAIN_MODULE=1 we explicitly want to include everything. If you want to DCE your main module you need to build with MAIN_MODULE=2. That is the main difference between =1 and =2. One does DCE and the other conservatively keeps everything alive in case it is needed at runtime.

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@Maksim-Bozhko
Comment options

@Maksim-Bozhko
Comment options

@Maksim-Bozhko
Comment options

@sbc100
Comment options

@sbc100
Comment options

Answer selected by alexander-veselov
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants