CMake invokes the assembler /bin/as with -pthread, which fails
I'm encountering an issue where if find_package(Threads)
is called with set(THREADS_PREFER_PTHREAD_FLAG ON)
, as is the recommendation, assembling source files of language ASM-ATT
then fails with
[ 7%] Building ASM-ATT object libs/context/CMakeFiles/boost_context.dir/src/asm/make_x86_64_sysv_elf_gas.S.o
/usr/bin/as: unrecognized option '-pthread'
when the assembler is "GNU":
-- The ASM-ATT compiler identification is GNU
-- Found assembler: /usr/bin/as
(but not with the "Clang" or "AppleClang" assemblers).
There's a possibly related issue #19757, but it's about linking. I don't see one about the compiler.