invalid value 'auto' in '-flto=auto' when building with Clang 11.0.1
Issue description
Successfully built in Ubuntu 20.04, Ubuntu 20.10, but failed in Ubuntu 21.04 with same rules. Seems to be an issue when building with Clang 11.0.1:
-- The C compiler identification is Clang 11.0.1
-- The CXX compiler identification is Clang 11.0.1
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/bin/clang-11
-- Check for working C compiler: /usr/bin/clang-11 - broken
CMake Error at /usr/share/cmake-3.18/Modules/CMakeTestCCompiler.cmake:66 (message):
The C compiler
"/usr/bin/clang-11"
is not able to compile a simple test program.
It fails with the following output:
Change Dir: /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp
Run Build Command(s):/usr/bin/gmake cmTC_c3b22/fast && gmake[2]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
/usr/bin/gmake -f CMakeFiles/cmTC_c3b22.dir/build.make CMakeFiles/cmTC_c3b22.dir/build
gmake[3]: Entering directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_c3b22.dir/testCCompiler.c.o
/usr/bin/clang-11 -g -O2 -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto -ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -o CMakeFiles/cmTC_c3b22.dir/testCCompiler.c.o -c /<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp/testCCompiler.c
clang: warning: optimization flag '-ffat-lto-objects' is not supported [-Wignored-optimization-argument]
error: invalid value 'auto' in '-flto=auto'
gmake[3]: *** [CMakeFiles/cmTC_c3b22.dir/build.make:85: CMakeFiles/cmTC_c3b22.dir/testCCompiler.c.o] Error 1
gmake[3]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
gmake[2]: *** [Makefile:140: cmTC_c3b22/fast] Error 2
gmake[2]: Leaving directory '/<<PKGBUILDDIR>>/obj-x86_64-linux-gnu/CMakeFiles/CMakeTmp'
Environment
Operating System: Ubuntu 21.04 Hirsute Hippo.
JPEG XL software version: version 0.3.7 release tarball .tar.gz
Compilation: [command used to compile the program]
CPU / architecture / device: launchpad build farm.