[BUG]: FLTO command line typo results in clang error
gpapan opened this issue · comments
George Papandreou commented
Required prerequisites
- Make sure you've read the documentation. Your issue may be addressed there.
- Search the issue tracker and Discussions to verify that this hasn't already been reported. +1 or comment there if it has.
- Consider asking first in the Gitter chat room or in a Discussion.
What version (or hash if on master) of pybind11 are you using?
2.12.0
Problem description
I think a bug/typo was introduced in L309 of https://github.com/pybind/pybind11/pull/4642/files. Instead of
HAS_FLTO_THIN "-flto${thin}${cxx_append}" "-flto=${thin}${linker_append}"
it should be
HAS_FLTO_THIN "-flto${thin}${cxx_append}" "-flto${thin}${linker_append}"
This change landed in https://github.com/pybind/pybind11/releases/tag/v2.12.0. The bug is still there in pybind11's current master: tools/pybind11Common.cmake#L328.
The issue above results in linker command containing -flto=
or -flto==thin
, which result in clang errors like the one below:
clang: error: unsupported argument '' to option '-flto='
Reproducible example code
See discussion above.
Is this a regression? Put the last known working version here if it is.
2.11.1