Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[libunwind,gperftools] Fix dependencies #41893

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions ports/gperftools/libunwind.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/configure.ac b/configure.ac
index 65a4e24..fc0d7d6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -278,9 +278,24 @@ AM_CONDITIONAL(ENABLE_STATIC, test "$enable_static" = yes)
# We want to link in libunwind if it is enabled and exists.
UNWIND_LIBS=
if test "$enable_libunwind" = yes; then
+ save_CFLAGS="$CFLAGS"
+ save_LIBS="$LIBS"
+ PKG_PROG_PKG_CONFIG
+ PKG_CHECK_MODULES([PC_UNWIND],[libunwind],[
+ CFLAGS="$PC_UNWIND_CFLAGS"
+ LIBS="$PC_UNWIND_LIBS"
+ ],[
+ PC_UNWIND_CFLAGS=""
+ LIBS="-lunwind"
+ ])
AC_CHECK_HEADERS([libunwind.h],
- [AC_CHECK_LIB(unwind, backtrace, UNWIND_LIBS=-lunwind)
+ [AC_SEARCH_LIBS(backtrace, [], [
+ save_CFLAGS="$CFLAGS $PC_UNWIND_CFLAGS"
+ UNWIND_LIBS="$LIBS"
+ ])
will_use_libunwind=yes])
+ CFLAGS="$save_CFLAGS"
+ LIBS="$save_LIBS"
fi
AC_SUBST(UNWIND_LIBS)

6 changes: 6 additions & 0 deletions ports/gperftools/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ vcpkg_from_github(
REF gperftools-2.10
SHA512 4400711723be9401f519d85b3b69c026e4715473cbed48ab0573df17abdf895fb971ee969875fe5127a2e8b9aba90d858285e50c8e012384c2c36d5a76b1f0c4
HEAD_REF master
PATCHES
libunwind.diff
)

if(VCPKG_TARGET_IS_WINDOWS)
Expand Down Expand Up @@ -54,6 +56,10 @@ else()
set(BUILD_OPTS --enable-static --disable-shared)
endif()

if(VCPKG_TARGET_IS_LINUX)
vcpkg_find_acquire_program(PKGCONFIG)
endif()

vcpkg_configure_make(
SOURCE_PATH ${SOURCE_PATH}
AUTOCONFIG
Expand Down
6 changes: 5 additions & 1 deletion ports/gperftools/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
{
"name": "gperftools",
"version": "2.10",
"port-version": 1,
"port-version": 2,
"description": "A set of tools for performance profiling and memory checking",
"homepage": "https://github.com/gperftools/gperftools",
"supports": "!(arm & windows) & !uwp & !android",
"dependencies": [
{
"name": "libunwind",
"platform": "linux"
},
{
"name": "vcpkg-cmake",
"host": true,
Expand Down
30 changes: 30 additions & 0 deletions ports/libunwind/liblzma.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
diff --git a/configure.ac b/configure.ac
index 82caaa7..a17b7a1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -443,9 +443,11 @@ AC_MSG_CHECKING([whether to support LZMA-compressed symbol tables])
AC_ARG_ENABLE(minidebuginfo,
AS_HELP_STRING([--enable-minidebuginfo], [Enables support for LZMA-compressed symbol tables]),, [enable_minidebuginfo=auto])
AC_MSG_RESULT([$enable_minidebuginfo])
+PKG_PROG_PKG_CONFIG
if test x$enable_minidebuginfo != xno; then
- AC_CHECK_LIB([lzma], [lzma_mf_is_supported],
- [LIBLZMA=-llzma
+ PKG_CHECK_MODULES([LZMA],[liblzma],
+ [LIBLZMA="$LZMA_LIBS"
+ CFLAGS="$CFLAGS $LZMA_CFLAGS"
AC_DEFINE([HAVE_LZMA], [1], [Define if you have liblzma])
enable_minidebuginfo=yes],
[if test x$enable_minidebuginfo = xyes; then
diff --git a/src/unwind/libunwind.pc.in b/src/unwind/libunwind.pc.in
index 9a65faf..bb351f7 100644
--- a/src/unwind/libunwind.pc.in
+++ b/src/unwind/libunwind.pc.in
@@ -7,5 +7,6 @@ Name: libunwind
Description: libunwind base library
Version: @VERSION@
Libs: -L${libdir} -lunwind
-Libs.private: @LIBLZMA@ @LIBZ@
+Libs.private: @LIBZ@
+Requires.private: liblzma
Cflags: -I${includedir}
7 changes: 5 additions & 2 deletions ports/libunwind/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,22 @@ vcpkg_from_github(
HEAD_REF master
SHA512 dd8332b7a2cbabb4716c01feea422f83b4a7020c1bee20551de139c3285ea0e0ceadfa4171c6f5187448c8ddc53e0ec4728697d0a985ee0c3ff4835b94f6af6f
PATCHES
liblzma.diff
"${CURRENT_BUILDTREES_DIR}/src/libunwind.diff"
)

vcpkg_find_acquire_program(PKGCONFIG)

vcpkg_configure_make(
SOURCE_PATH "${SOURCE_PATH}"
AUTOCONFIG
OPTIONS
--disable-documentation
--disable-tests
--disable-zlibdebuginfo
--enable-minidebuginfo
)
vcpkg_install_make()
vcpkg_fixup_pkgconfig()


file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE")
6 changes: 0 additions & 6 deletions ports/libunwind/usage

This file was deleted.

2 changes: 1 addition & 1 deletion ports/libunwind/vcpkg.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "libunwind",
"version": "1.8.1",
"port-version": 2,
"port-version": 3,
"description": "Unix libray for portable stack unwinding",
"homepage": "https://www.nongnu.org/libunwind",
"license": "MIT",
Expand Down
4 changes: 2 additions & 2 deletions versions/baseline.json
Original file line number Diff line number Diff line change
Expand Up @@ -3222,7 +3222,7 @@
},
"gperftools": {
"baseline": "2.10",
"port-version": 1
"port-version": 2
},
"gpgme": {
"baseline": "1.23.2",
Expand Down Expand Up @@ -5254,7 +5254,7 @@
},
"libunwind": {
"baseline": "1.8.1",
"port-version": 2
"port-version": 3
},
"liburing": {
"baseline": "2.7",
Expand Down
5 changes: 5 additions & 0 deletions versions/g-/gperftools.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "9de2b6bb7a1d0a80fe402a8561161e3cac4ede19",
"version": "2.10",
"port-version": 2
},
{
"git-tree": "ebb8ef920067346d4633cc78ee176f7ed9bc89d4",
"version": "2.10",
Expand Down
5 changes: 5 additions & 0 deletions versions/l-/libunwind.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
{
"versions": [
{
"git-tree": "535c5df0f63ffbfd8bb48e564758d20e2bad192c",
"version": "1.8.1",
"port-version": 3
},
{
"git-tree": "d9bd4526e93e77c007518879e00a2cc163a87d20",
"version": "1.8.1",
Expand Down
Loading