[openwrt/openwrt] tools/elfutils: add more pkg-config library info

LEDE Commits lede-commits at lists.infradead.org
Wed Jun 19 02:22:28 PDT 2024


robimarko pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/f560588b05b90df55bd0cf516ec22f2d6ce5516e

commit f560588b05b90df55bd0cf516ec22f2d6ce5516e
Author: Michael Pratt <mcpratt at pm.me>
AuthorDate: Tue Jun 18 00:01:31 2024 -0400

    tools/elfutils: add more pkg-config library info
    
    In order for linking the static libraries from elfutils to work,
    other libraries need to be included to handle the references
    to functions made in the library's objects that are not included
    as they would already be if the library was a shared object instead.
    
    A shared object library stores this list of libraries when it was made,
    so that the dynamic linker can refer to that list at runtime,
    but a static library has no such functionality so the list of libraries
    for missing functions must be included at link time.
    
    This information was already added to the pc file for libelf
    using the definitions in src/Makefile.am,
    so extend this to the rest of the pc files in the project.
    
    For situations where the libraries may be used
    without pkg-config setting the flags and library list,
    this patch and the pc files can serve as a quick reference.
    
    Signed-off-by: Michael Pratt <mcpratt at pm.me>
    Link: https://github.com/openwrt/openwrt/pull/15690
    Signed-off-by: Robert Marko <robimarko at gmail.com>
---
 tools/elfutils/patches/100-portability.patch | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tools/elfutils/patches/100-portability.patch b/tools/elfutils/patches/100-portability.patch
index 35e29cfcc9..be97f95faa 100644
--- a/tools/elfutils/patches/100-portability.patch
+++ b/tools/elfutils/patches/100-portability.patch
@@ -204,6 +204,26 @@
  #include <libdw.h>
  #include <dwarf.h>
  
+--- a/config/libdebuginfod.pc.in
++++ b/config/libdebuginfod.pc.in
+@@ -8,5 +8,5 @@ Description: elfutils library to query d
+ Version: @VERSION@
+ URL: http://elfutils.org/
+ 
+-Libs: -L${libdir} -ldebuginfod
++Libs: -L${libdir} -ldebuginfod -lpthread
+ Cflags: -I${includedir}
+--- a/config/libdw.pc.in
++++ b/config/libdw.pc.in
+@@ -8,7 +8,7 @@ Description: elfutils library for DWARF
+ Version: @VERSION@
+ URL: http://elfutils.org/
+ 
+-Libs: -L${libdir} -ldw
++Libs: -L${libdir} -ldw -lz -lelf -lz -ldl -lpthread
+ Cflags: -I${includedir}
+ 
+ # We need the exact matching elfutils libelf version since internal data
 --- a/config/libelf.pc.in
 +++ b/config/libelf.pc.in
 @@ -8,7 +8,7 @@ Description: elfutils libelf library to




More information about the lede-commits mailing list