Fix lack of pthread linking in ubuntu 20.04

Ubuntu 20.04 saw a regression that caused the pthread library to no longer be
a part of libvulkan.so's linked libraries. This didn't cause the loader to fail
to load, rather any library that used pthread functions without linking to pthreads
themselves would fail to run, for example the Vulkan-ValidationLayers (VVL).
While it is currently unclear why VVL were trying to link to these symbols, this
would make loading validation layers impossible.

The issue turns out to be this line of CMake
`set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)`. Specifically, that line of
code appearing *before* `find_package(Threads REQUIRED)` causes CMake to 'find'
CMAKE_HAVE_LIBC_PTHREAD successfully, whereas previously it would fail. Since
this variable indicates that linking to libc is enough to get threading
capabilities, CMake no longer links to pthread.

This commit is an effort to prevent breaking ABI due to changing the link library
list in Ubuntu 20.04. It should be noted that in Ubuntu 23.10, the location of
`find_package(Threads)` has no bearing on the value of CMAKE_HAVE_LIBC_PTHREAD.
1 file changed
tree: a18d58a2ecd4042d1898a66c8689d36c0f0f6045
  1. .github/
  2. docs/
  3. loader/
  4. scripts/
  5. tests/
  6. .clang-format
  7. .gitattributes
  8. .gitignore
  9. BUILD.gn
  10. BUILD.md
  11. CMakeLists.txt
  12. CODE_OF_CONDUCT.md
  13. CONTRIBUTING.md
  14. GOVERNANCE.md
  15. LICENSE.txt
  16. README.md
  17. SECURITY.md
README.md

Vulkan Loader

This project provides the Khronos official Vulkan Loader for all platforms except Android

Introduction

Vulkan is an explicit API, enabling direct control over how GPUs actually work. As such, Vulkan supports systems that have multiple GPUs, each running with a different driver, or ICD (Installable Client Driver). Vulkan also supports multiple global contexts (instances, in Vulkan terminology). The ICD loader is a library that is placed between a Vulkan application and any number of Vulkan drivers, in order to support multiple drivers and the instance-level functionality that works across these drivers. Additionally, the loader manages inserting Vulkan layer libraries, such as validation layers, between an application and the drivers.

This repository contains the Vulkan loader that is used for Linux, Windows, MacOS, and iOS. There is also a separate loader, maintained by Google, which is used on Android.

The following components are available in this repository:

Contact Information

Information for Developing or Contributing

Please see the CONTRIBUTING.md file in this repository for more details. Please see the GOVERNANCE.md file in this repository for repository management details.

How to Build and Run

BUILD.md includes directions for building all components.

Architecture and interface information for the loader is in docs/LoaderInterfaceArchitecture.md.

Version Tagging Scheme

Updates to this repository which correspond to a new Vulkan specification release are tagged using the following format: v<version> (e.g., v1.3.266).

Note: Marked version releases have undergone thorough testing but do not imply the same quality level as SDK tags. SDK tags follow the vulkan-sdk-<version>.<patch> format (e.g., vulkan-sdk-1.3.266.0).

This scheme was adopted following the 1.3.266 Vulkan specification release.

License

This work is released as open source under a Apache-style license from Khronos including a Khronos copyright.

Acknowledgements

While this project has been developed primarily by LunarG, Inc., there are many other companies and individuals making this possible: Valve Corporation, funding project development; Khronos providing oversight and hosting of the project.