Skip to content

fix: allow creating static libraries with LTO - #244

Open
ljessendk wants to merge 1 commit into
f0rmiga:mainfrom
ljessendk:fix_lto_linking
Open

ljessendk wants to merge 1 commit into
f0rmiga:mainfrom
ljessendk:fix_lto_linking

Conversation

@ljessendk

Copy link
Copy Markdown
Contributor

When building with "--cxxopt=-flto" to enable "link-time-optimization" (LTO) the build will fail with 'undefined reference' linker errors when linking with static libraries.

Instead of using 'ar' and 'nm' use 'gcc-ar' and 'gcc-nm' as these tools will use the proper LTO plugin.

Fixes: #243

When building with "--cxxopt=-flto" to enable "link-time-optimization"
(LTO) the build will fail with 'undefined reference' linker errors when
linking with static libraries.

Instead of using 'ar' and 'nm' use 'gcc-ar' and 'gcc-nm' as these tools
will use the proper LTO plugin.

Fixes: f0rmiga#243
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.

'undefined reference' linker errors when using LTO and static libraries

1 participant