Skip to content

Instructing the compilers to produce slightly smaller binaries (-ffunction-sections)#238

Open
lemire wants to merge 3 commits intomasterfrom
dlemire/build_strip
Open

Instructing the compilers to produce slightly smaller binaries (-ffunction-sections)#238
lemire wants to merge 3 commits intomasterfrom
dlemire/build_strip

Conversation

@lemire
Copy link
Member

@lemire lemire commented May 4, 2023

This has a marginal effect on the binary size, but it saves a few kilobytes so it might be worth it.

On the negative size, it makes the library we produce larger...

From...

-rw-r--r--. 1 dlemire dlemire 447316 May  4 16:59 build/src/libsimdutf.a

to ...

-rw-r--r--. 1 dlemire dlemire 519332 May  4 17:08 buildstrip/src/libsimdutf.a

So I am not sure it is such win.

@krk
Copy link
Contributor

krk commented Jun 4, 2024

-ffunction-sections and -fdata-section will enable the linker to remove any unused sections in the binary that consumes simdutf statically.

This may benefit the end-user of libsimdutf.a more than it does libsimdutf.a itself.

@lemire
Copy link
Member Author

lemire commented Jun 4, 2024

will enable the linker to remove any unused sections in the binary that consumes simdutf statically. This may benefit the end-user of libsimdutf.a more than it does libsimdutf.a itself.

It makes libsimdutf.a larger and it makes the generated binaries slightly smaller.

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