From: Mathieu Othacehe <othacehe@gnu.org>
To: John Soo <jsoo1@asu.edu>
Cc: Help Guix <help-guix@gnu.org>
Subject: Re: BPF in linux-libre
Date: Fri, 26 Jun 2020 12:50:17 +0200 [thread overview]
Message-ID: <87wo3uxfrq.fsf@gnu.org> (raw)
In-Reply-To: <87zh8wph7h.fsf@asu.edu> (John Soo's message of "Sun, 21 Jun 2020 08:32:50 -0700")
[-- Attachment #1: Type: text/plain, Size: 1321 bytes --]
Hello John,
> ld: /gnu/store/80y2wbx9lrhvwp41nnyjjsb4g9ff8avn-clang-toolchain-9.0.1/lib/libbfd.a(compress.o): undefined reference to symbol 'inflateEnd'
> ld: /gnu/store/80y2wbx9lrhvwp41nnyjjsb4g9ff8avn-clang-toolchain-9.0.1/lib/libz.so.1: error adding symbols: DSO missing from command line
>
> I added zlib to the inputs of bpftrace but still the same error. Are
> there any CMake experts out there that can tell if there is a flag or
> option to use here? Is this an upstream issue?
By default, a dynamic version of bpftrace is built. However, as we do
not provide a libbpf.so, it falls back on libbpf.a.
There's a comment in FindLibBfd.cmake which says:
--8<---------------cut here---------------start------------->8---
# libbfd.a is not statically linked with libiberty.a or libz.a so we must manually
# do it. Furthermore, libbfd uses some libc symbols that we must manually
# link against if we're not using static libc (which includes such symbols).
--8<---------------cut here---------------end--------------->8---
So when STATIC_LINKING is ON, they add "libz" to the required
libraries. It would be preferable to avoid building a static bpftrace,
so I tried to provide a dynamic version of libbpf.
There's still a failure at validate-runpath phase that need to be
fixed, not sure why.
Thanks,
Mathieu
[-- Attachment #2: diff --]
[-- Type: application/octet-stream, Size: 2029 bytes --]
diff --git a/gnu/packages/base.scm b/gnu/packages/base.scm
index 50e426fadf..42bba03b2a 100644
--- a/gnu/packages/base.scm
+++ b/gnu/packages/base.scm
@@ -601,6 +601,17 @@ included.")
(inputs
`(("gcc:lib" ,gcc "lib")))))
+(define-public binutils-shared
+ (package
+ (inherit binutils)
+ (name "binutils-shared")
+ (arguments
+ `(#:validate-runpath? #f
+ ,@(substitute-keyword-arguments (package-arguments binutils)
+ ((#:configure-flags flags)
+ `(cons "--enable-shared" ,flags)))))
+ (properties '())))
+
(define* (make-ld-wrapper name #:key
(target (const #f))
binutils
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index 8f0b9ac018..7f30e3750c 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -7169,6 +7169,7 @@ persistent over reboots.")
(list
(string-append "PREFIX=''")
(string-append "DESTDIR=" (assoc-ref %outputs "out"))
+ (string-append "LIBDIR=/lib")
(string-append
"CC=" (assoc-ref %build-inputs "gcc") "/bin/gcc"))
#:phases
@@ -7272,8 +7273,11 @@ Linux 4.1 and above.")
(inputs
`(("bcc" ,bcc)
("bison" ,bison)
+ ("binutils" ,binutils-shared)
("clang-toolchain" ,clang-toolchain)
("elfutils" ,elfutils)
+ ("libiberty" ,libiberty)
+ ("libbpf" ,libbpf)
("flex" ,flex)
;; FIXME: Tests require googletest but not from system
;; ("googletest" ,googletest)
@@ -7282,7 +7286,8 @@ Linux 4.1 and above.")
`(#:configure-flags
'(;; FIXME: Make tests not clone the googletest repository
"-DBUILD_TESTING=OFF"
- "-DLIBBFD_DISASM_FOUR_ARGS_SIGNATURE=ON")))
+ "-DLIBBFD_DISASM_FOUR_ARGS_SIGNATURE=ON")
+ #:tests? #f))
(home-page "https://github.com/iovisor/bpftrace")
(synopsis "High-level tracing language for Linux eBPF")
(description
next prev parent reply other threads:[~2020-06-26 10:50 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-14 3:21 BPF in linux-libre John Soo
2020-06-14 9:23 ` Mathieu Othacehe
2020-06-14 15:11 ` John Soo
2020-06-17 10:16 ` Mathieu Othacehe
2020-06-17 13:42 ` John Soo
2020-06-21 15:32 ` John Soo
2020-06-26 10:50 ` Mathieu Othacehe [this message]
2020-06-28 20:24 ` John Soo
2020-07-01 5:40 ` John Soo
2020-07-03 16:01 ` John Soo
2020-07-05 8:18 ` Mathieu Othacehe
2020-07-05 8:20 ` Mathieu Othacehe
2020-07-06 0:44 ` John Soo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://guix.gnu.org/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87wo3uxfrq.fsf@gnu.org \
--to=othacehe@gnu.org \
--cc=help-guix@gnu.org \
--cc=jsoo1@asu.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).