[Bug 1958330] Review Request: rust-libbpf-sys - Rust bindings to libbpf from the Linux kernel

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



https://bugzilla.redhat.com/show_bug.cgi?id=1958330



--- Comment #5 from Robert-André Mauchin 🐧 <zebob.m@xxxxxxxxx> ---
I,ve changed this to:

diff -Naur a/bindings.h b/bindings.h
--- a/bindings.h        2021-01-19 11:12:47.000000000 -0800
+++ b/bindings.h        2021-05-09 10:40:12.043397710 -0700
@@ -1,8 +1,8 @@
-#include "libbpf/include/uapi/linux/if_link.h"
-#include "libbpf/src/bpf.h"
-#include "libbpf/src/btf.h"
-#include "libbpf/src/libbpf.h"
-#include "libbpf/src/xsk.h"
+#include <linux/if_link.h>
+#include <bpf/bpf.h>
+#include <bpf/btf.h>
+#include <bpf/libbpf.h>
+#include <bpf/xsk.h>

 extern __u64 *_xsk_ring_prod__fill_addr(struct xsk_ring_prod *fill, __u32
idx);

@@ -32,4 +32,4 @@

 extern __u64 _xsk_umem__extract_offset(__u64 addr);

-extern __u64 _xsk_umem__add_offset_to_addr(__u64 addr);
\ No newline at end of file
+extern __u64 _xsk_umem__add_offset_to_addr(__u64 addr);
diff -Naur a/build.rs b/build.rs
--- a/build.rs  2021-01-19 11:12:47.000000000 -0800
+++ b/build.rs  2021-05-09 10:41:00.968869985 -0700
@@ -10,39 +10,16 @@ fn main() {
     let out_dir_str = out_dir.to_str().unwrap();

     if cfg!(target_os = "linux") {
-        let status = Command::new("make")
-            .arg("install")
-            .env("BUILD_STATIC_ONLY", "y")
-            .env("PREFIX", "/")
-            .env("LIBDIR", "")
-            .env("OBJDIR", out_dir.join("obj").to_str().unwrap())
-            .env("DESTDIR", out_dir_str)
-            .env("CFLAGS", "-g -O2 -Werror -Wall -fPIC")
-            .current_dir(src_dir.join("libbpf/src"))
-            .status()
-            .unwrap();
-
-        assert!(status.success());
-
-        let status = Command::new("make")
-            .arg("clean")
-            .current_dir(src_dir.join("libbpf/src"))
-            .status()
-            .unwrap();
-
-        assert!(status.success());
-
         cc::Build::new()
             .file("bindings.c")
-            .include(src_dir.join("libbpf/include"))
-            .include(src_dir.join("libbpf/include/uapi"))
             .out_dir(out_dir_str)
             .compile("bindings");

         println!("cargo:rustc-link-search=native={}", out_dir_str);
         println!("cargo:rustc-link-lib=elf");
         println!("cargo:rustc-link-lib=z");
-        println!("cargo:rustc-link-lib=static=bpf");
+        println!("cargo:rustc-link-lib=static=bpf");
+        println!("cargo:rustc-link-search=native={}", "/usr/lib64");
         println!("cargo:include={}/include", out_dir_str);
     }
 }


and it works but it shouldn't be hard-coded to "/usr/lib64", Maybe passed
through an environment variable?


-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are always notified about changes to this product and component
_______________________________________________
package-review mailing list -- package-review@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to package-review-leave@xxxxxxxxxxxxxxxxxxxxxxx
Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/
List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines
List Archives: https://lists.fedoraproject.org/archives/list/package-review@xxxxxxxxxxxxxxxxxxxxxxx
Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure




[Index of Archives]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Yosemite Conditions]     [KDE Users]

  Powered by Linux