all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Static Glib included in shared library's pkg-config file
@ 2024-06-14 16:29 Michael Zappa
  0 siblings, 0 replies; only message in thread
From: Michael Zappa @ 2024-06-14 16:29 UTC (permalink / raw)
  To: help-guix

Hello,
I have packaged libbson via the mongo-c-driver(https://github.com/mongodb/mongo-c-driver) but am having a curious issue with the pkg-config files generated as part of its CMake build system. It has two outputs, shared and static, but both pkg-config files include static glibc in their "Libs:" which are accessed via `pkg-config --libs ...`. Thus, when attempting to use the package in compiling a dynamic executable, the static glibc is linked in, causing immediate segfaults upon execution.

I am wondering if anyone more familiar with cmake-build-system or CMake as a whole has any ideas about why the static glibc is ending up as the associated lib instead of the shared version. I am on commit `bb73faea` of Guix.

The guix package:
```
(use-modules
((guix licenses) #:prefix licenses:)
(guix build-system cmake)
(guix git-download)
(guix packages))
 
(define-public libbson
  (package
    (name "libbson")
    (version "1.27.2")
    (home-page "https://github.com/mongodb/mongo-c-driver")
    (source (origin
              (method git-fetch)
              (uri (git-reference
                    (url home-page)
                    (commit version)))
              (file-name (git-file-name name version))
              (sha256
               (base32
                "176qksl6zd8ffryics2pgaxji3fnqqmy4842dmyr1ycqxrx9jy4p"))))
    (build-system cmake-build-system)
    (arguments
     '(#:configure-flags
       `("-DENABLE_MONGOC=OFF"
         "-DENABLE_EXTRA_ALIGNMENT=OFF"
         "-DENABLE_AUTOMATIC_INIT_AND_CLEANUP=OFF"
         ,(string-append "-DBUILD_VERSION=" "1.27.2"))))
    (synopsis #f)
    (description #f)
    (license licenses:asl2.0)))
```

The pkg-config file for the shared output of libbson:
```
# pkg-config .pc file generated by CMake 3.24.2 for libbson-1.27.2. DO NOT EDIT!
prefix=/gnu/store/2bryf1infbhskkab3czymhbyqhhng8ns-libbson-1.27.2
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
 
Name: libbson
Description: The libbson BSON serialization library
Version: 1.27.2
 
Libs: -L${libdir} -lbson-1.0 -L/gnu/store/i2g0is6wjq3ccs6m1l6w9mhf44k4042h-glibc-2.35-static/lib -lrt
Cflags:  -I${prefix}/include/libbson-1.0
```

Thank you,
Michael

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2024-06-16 13:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-14 16:29 Static Glib included in shared library's pkg-config file Michael Zappa

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.