From: Colin Watson <cjwatson@debian.org>
Date: Mon, 29 Sep 2025 19:24:27 +0100
Subject: Link with -latomic as needed

This works around https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81358 on
armel; it can be dropped once Debian has the fix for that bug.

Last-Update: 2025-09-29
---
 CMakeLists.txt | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5caa7c6..f987709 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -27,6 +27,8 @@ project(
   VERSION "${OPENTELEMETRY_VERSION_NUMBER}"
   LANGUAGES CXX)
 
+link_libraries(-Wl,--push-state,--as-needed atomic -Wl,--pop-state)
+
 # Mark variables as used so cmake doesn't complain about them
 mark_as_advanced(CMAKE_TOOLCHAIN_FILE)
 
