From 85613ac74b6ec77727dcd43e01aa46774d91df93 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Lal?= Date: Sat, 19 Jul 2025 16:36:13 +0200 Subject: [PATCH] Export map for shared library symbols --- CMakeLists.txt | 3 +++ Makefile | 1 + libllhttp.map | 6 ++++++ 3 files changed, 10 insertions(+) create mode 100644 libllhttp.map diff --git a/CMakeLists.txt b/CMakeLists.txt index 2ed65d0d..347b64f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,6 +27,9 @@ endif() option(BUILD_SHARED_LIBS "Build shared libraries (.dll/.so)" ON) option(BUILD_STATIC_LIBS "Build static libraries (.lib/.a)" OFF) +# Shared library versioning support +set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--version-script=${CMAKE_CURRENT_SOURCE_DIR}/libllhttp.map") + # Source code set(LLHTTP_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/src/llhttp.c diff --git a/Makefile b/Makefile index addb9161..a923f488 100644 --- a/Makefile +++ b/Makefile @@ -54,6 +54,7 @@ release: clean generate cp -rf src/common.gypi release/ sed s/_RELEASE_/$(RELEASE)/ CMakeLists.txt > release/CMakeLists.txt cp -rf libllhttp.pc.in release/ + cp -rf libllhttp.map release/ cp -rf README.md release/ cp -rf LICENSE release/ diff --git a/libllhttp.map b/libllhttp.map new file mode 100644 index 00000000..86894254 --- /dev/null +++ b/libllhttp.map @@ -0,0 +1,6 @@ +{ + global: + *; + local: + llhttp__internal_*; +};