Skip to content

[3.6] bpo-28015: Support LTO build with clang (GH-9908) #10922

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

Merged
merged 1 commit into from
Dec 9, 2018

Conversation

stratakis
Copy link
Contributor

@stratakis stratakis commented Dec 5, 2018

.o generated by clang in LTO mode actually are LLVM bitcode files, which
leads to a few errors during configure/build step:

  • add lto flags to the BASECFLAGS instead of CFLAGS, as CFLAGS are used
    to build autoconf test case, and some are not compatible with clang LTO
    (they assume binary in the .o, not bitcode)
  • force llvm-ar instead of ar, as ar is not aware of .o files generated
    by clang -flto
    (cherry picked from commit 5ad36f9)

Co-authored-by: serge-sans-paille [email protected]

https://bugs.python.org/issue28015

.o generated by clang in LTO mode actually are LLVM bitcode files, which
leads to a few errors during configure/build step:

- add lto flags to the BASECFLAGS instead of CFLAGS, as CFLAGS are used
  to build autoconf test case, and some are not compatible with clang LTO
  (they assume binary in the .o, not bitcode)
- force llvm-ar instead of ar, as ar is not aware of .o files generated
  by clang -flto
(cherry picked from commit 5ad36f9)

Co-authored-by: serge-sans-paille <[email protected]>
@ned-deily ned-deily merged commit f83ee47 into python:3.6 Dec 9, 2018
@stratakis stratakis deleted the clang_lto branch December 10, 2018 22:23
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.

5 participants