Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cfi .a's can't be used #2522

Open
nekopsykose opened this issue Jul 18, 2024 · 0 comments
Open

cfi .a's can't be used #2522

nekopsykose opened this issue Jul 18, 2024 · 0 comments

Comments

@nekopsykose
Copy link
Member

currently if you try link against a cfi-built .a you merely get

ld: error: inconsistent LTO Unit splitting (recompile with -fsplit-lto-unit)

this is because fsanitize=cfi implies -fsplit-lto-unit, and -fsplit-lto-unit requires everything built with lto to also have it set.

it works to merely add

--- a/src/cbuild/core/profile.py
+++ b/src/cbuild/core/profile.py
@@ -113,6 +113,7 @@ def _get_archflags(prof, tmpl, hard):
         sflags.append("-fno-sanitize-recover")
 
     if lto:
+        sflags.append("-fsplit-lto-unit")
         if tmpl.options["ltofull"]:
             sflags.append("-flto")
         else:

but that requires a world rebuild

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

No branches or pull requests

1 participant