brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 6201f4d Raw
23 lines · plain
1! In release 2.34, glibc removed libpthread as a separate library. All the2! pthread_* functions were subsumed into libc, so linking that is sufficient.3! However, when linking against older glibc builds, the explicit link of4! -pthread will be required. More details are here:5!6! https://developers.redhat.com/articles/2021/12/17/why-glibc-234-removed-libpthread#the_developer_view7!8! This makes it difficult to write a test that requires the -pthread flag in9! order to pass. Checking for the presence of -lpthread in the linker flags is10! not reliable since the linker could just skip the flag altogether if it is11! linking against a new libc implementation.12 13! RUN: %flang -### -pthread /dev/null -o /dev/null 2>&1 | FileCheck %s14! RUN: %flang -### -Xflang -pthread /dev/null -o /dev/null 2>&1 | FileCheck %s15 16! How the -pthread flag is handled is very platform-specific. A lot of that17! functionality is tested by clang, and the flag itself is handled by clang's18! driver that flang also uses. Instead of duplicating all that testing here,19! just check that the presence of the flag does not raise an error. If we need20! more customized handling of -pthread, the tests for that can be added here.21!22! CHECK-NOT: error:23