diff --git a/devel/dwarves/Makefile b/devel/dwarves/Makefile index b7a07fbf5f63..91c519899227 100644 --- a/devel/dwarves/Makefile +++ b/devel/dwarves/Makefile @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= dwarves -DISTVERSION= 1.17 +DISTVERSION= 1.19 CATEGORIES= devel MASTER_SITES= https://fedorapeople.org/~acme/dwarves/ @@ -27,7 +27,7 @@ USE_LDCONFIG= yes SHEBANG_FILES= btfdiff fullcircle ostra/ostra-cg ostra/python/ostra.py -CFLAGS+= -I${WRKSRC} +CFLAGS+= -I${WRKSRC} -Wno-attributes OPTIONS_DEFINE= MANPAGES OPTIONS_DEFAULT= MANPAGES diff --git a/devel/dwarves/distinfo b/devel/dwarves/distinfo index c2c6f5ff0d1c..480e7aae3406 100644 --- a/devel/dwarves/distinfo +++ b/devel/dwarves/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1584128313 -SHA256 (dwarves-1.17.tar.xz) = f196b0604c16a3812031ed2cd4c14d27fef889186b514a16db2d2f52717aef70 -SIZE (dwarves-1.17.tar.xz) = 309028 +TIMESTAMP = 1606511990 +SHA256 (dwarves-1.19.tar.xz) = 9af54663f2bab10d1ea85f97801c8fa045ff62e9b39d4ec6a8541354cb7b6ef3 +SIZE (dwarves-1.19.tar.xz) = 686136 diff --git a/devel/dwarves/files/patch-dutil.h b/devel/dwarves/files/patch-dutil.h new file mode 100644 index 000000000000..a881b76087bf --- /dev/null +++ b/devel/dwarves/files/patch-dutil.h @@ -0,0 +1,28 @@ +--- dutil.h.orig 2020-08-21 14:53:52 UTC ++++ dutil.h +@@ -28,6 +28,9 @@ + #define __pure __attribute__ ((pure)) + #endif + ++#ifdef roundup ++#undef roundup ++#endif + #define roundup(x,y) ((((x) + ((y) - 1)) / (y)) * (y)) + + static inline __attribute__((const)) bool is_power_of_2(unsigned long n) +@@ -35,6 +38,7 @@ static inline __attribute__((const)) bool is_power_of_ + return (n != 0 && ((n & (n - 1)) == 0)); + } + ++#ifndef __FreeBSD__ + /** + * fls - find last (most-significant) bit set + * @x: the word to search +@@ -46,6 +50,7 @@ static __always_inline int fls(int x) + { + return x ? sizeof(x) * 8 - __builtin_clz(x) : 0; + } ++#endif /* !__FreeBSD__ */ + + /** + * fls64 - find last set bit in a 64-bit word diff --git a/devel/dwarves/files/patch-dwarves__fprintf.c b/devel/dwarves/files/patch-dwarves__fprintf.c index 6c24eb7fdaf5..bf79545e8b9a 100644 --- a/devel/dwarves/files/patch-dwarves__fprintf.c +++ b/devel/dwarves/files/patch-dwarves__fprintf.c @@ -1,4 +1,4 @@ ---- dwarves_fprintf.c.orig 2020-05-06 22:11:18 UTC +--- dwarves_fprintf.c.orig 2020-11-19 18:44:29 UTC +++ dwarves_fprintf.c @@ -7,6 +7,8 @@ Copyright (C) 2007..2009 Arnaldo Carvalho de Melo @@ -9,7 +9,7 @@ #include #include #include -@@ -1910,12 +1912,7 @@ void cus__print_error_msg(const char *progname, const +@@ -1956,12 +1958,7 @@ void cus__print_error_msg(const char *progname, const void dwarves__fprintf_init(uint16_t user_cacheline_size) { if (user_cacheline_size == 0) { diff --git a/devel/dwarves/files/patch-lib_bpf_src_btf.c b/devel/dwarves/files/patch-lib_bpf_src_btf.c index d8257580e763..8a5310517553 100644 --- a/devel/dwarves/files/patch-lib_bpf_src_btf.c +++ b/devel/dwarves/files/patch-lib_bpf_src_btf.c @@ -1,14 +1,53 @@ ---- lib/bpf/src/btf.c.orig 2020-03-12 19:57:29 UTC +--- lib/bpf/src/btf.c.orig 2020-11-16 19:49:14 UTC +++ lib/bpf/src/btf.c -@@ -436,6 +436,7 @@ done: - return btf; +@@ -1,8 +1,7 @@ + // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) + /* Copyright (c) 2018 Facebook */ + +-#include +-#include ++#include + #include + #include + #include +@@ -22,6 +21,12 @@ + #include "libbpf_internal.h" + #include "hashmap.h" + ++#ifdef __FreeBSD__ ++#define bswap_16(x) bswap16(x) ++#define bswap_32(x) bswap32(x) ++#define bswap_64(x) bswap64(x) ++#endif ++ + #define BTF_MAX_NR_TYPES 0x7fffffffU + #define BTF_MAX_STR_OFFSET 0x7fffffffU + +@@ -519,12 +524,12 @@ int btf__set_pointer_size(struct btf *btf, size_t ptr_ + + static bool is_host_big_endian(void) + { +-#if __BYTE_ORDER == __LITTLE_ENDIAN ++#if _BYTE_ORDER == _LITTLE_ENDIAN + return false; +-#elif __BYTE_ORDER == __BIG_ENDIAN ++#elif _BYTE_ORDER == _BIG_ENDIAN + return true; + #else +-# error "Unrecognized __BYTE_ORDER__" ++# error "Unrecognized _BYTE_ORDER" + #endif + } + +@@ -1080,6 +1085,7 @@ struct btf *btf__parse_split(const char *path, struct + return btf_parse(path, base_btf, NULL); } +#ifndef __FreeBSD__ - static bool btf_check_endianness(const GElf_Ehdr *ehdr) + static int compare_vsi_off(const void *_a, const void *_b) { - #if __BYTE_ORDER == __LITTLE_ENDIAN -@@ -684,6 +685,7 @@ done: + const struct btf_var_secinfo *a = _a; +@@ -1223,6 +1229,7 @@ done: free(log_buf); return err; } @@ -16,15 +55,15 @@ int btf__fd(const struct btf *btf) { -@@ -704,6 +706,7 @@ const char *btf__name_by_offset(const struct btf *btf, - return NULL; +@@ -1318,6 +1325,7 @@ const char *btf__name_by_offset(const struct btf *btf, + return btf__str_by_offset(btf, offset); } +#ifndef __FreeBSD__ int btf__get_from_id(__u32 id, struct btf **btf) { struct bpf_btf_info btf_info = { 0 }; -@@ -767,6 +770,7 @@ exit_free: +@@ -1381,6 +1389,7 @@ exit_free: return err; } @@ -32,15 +71,15 @@ int btf__get_map_kv_tids(const struct btf *btf, const char *map_name, __u32 expected_key_size, __u32 expected_value_size, -@@ -2936,6 +2940,7 @@ static int btf_dedup_remap_types(struct btf_dedup *d) +@@ -4559,6 +4568,7 @@ static int btf_dedup_remap_types(struct btf_dedup *d) return 0; } +#ifndef __FreeBSD__ - static struct btf *btf_load_raw(const char *path) - { - struct btf *btf; -@@ -3021,3 +3026,4 @@ struct btf *libbpf_find_kernel_btf(void) + /* + * Probe few well-known locations for vmlinux kernel image and try to load BTF + * data out of it to use for target BTF. +@@ -4609,3 +4619,4 @@ struct btf *libbpf_find_kernel_btf(void) pr_warn("failed to find valid kernel BTF\n"); return ERR_PTR(-ESRCH); } diff --git a/devel/dwarves/files/patch-lib_bpf_src_libbpf.c b/devel/dwarves/files/patch-lib_bpf_src_libbpf.c index 76b8b208ec3c..2d80b6bad35e 100644 --- a/devel/dwarves/files/patch-lib_bpf_src_libbpf.c +++ b/devel/dwarves/files/patch-lib_bpf_src_libbpf.c @@ -1,6 +1,6 @@ ---- lib/bpf/src/libbpf.c.orig 2020-03-12 19:57:29 UTC +--- lib/bpf/src/libbpf.c.orig 2020-11-16 19:49:14 UTC +++ lib/bpf/src/libbpf.c -@@ -29,18 +29,12 @@ +@@ -30,18 +30,12 @@ #include #include #include @@ -18,22 +18,20 @@ -#include #include #include - #include -@@ -73,11 +67,13 @@ + #include +@@ -72,9 +66,11 @@ #define __printf(a, b) __attribute__((format(printf, a, b))) +#ifndef __FreeBSD__ static struct bpf_map *bpf_object__add_map(struct bpf_object *obj); - static struct bpf_program *bpf_object__find_prog_by_idx(struct bpf_object *obj, - int idx); static const struct btf_type * skip_mods_and_typedefs(const struct btf *btf, __u32 id, __u32 *res_id); +#endif /* !__FreeBSD__ */ static int __base_pr(enum libbpf_print_level level, const char *format, va_list args) -@@ -111,6 +107,7 @@ void libbpf_print(enum libbpf_print_level level, const +@@ -108,6 +104,7 @@ void libbpf_print(enum libbpf_print_level level, const va_end(args); } @@ -41,7 +39,22 @@ static void pr_perm_msg(int err) { struct rlimit limit; -@@ -8396,3 +8387,4 @@ void bpf_object__destroy_skeleton(struct bpf_object_sk +@@ -8959,12 +8956,14 @@ bpf_object__find_map_by_offset(struct bpf_object *obj, + { + return ERR_PTR(-ENOTSUP); + } ++#endif /* !__FreeBSD__ */ + + long libbpf_get_error(const void *ptr) + { + return PTR_ERR_OR_ZERO(ptr); + } + ++#ifndef __FreeBSD__ + int bpf_prog_load(const char *file, enum bpf_prog_type type, + struct bpf_object **pobj, int *prog_fd) + { +@@ -10860,3 +10859,4 @@ void bpf_object__destroy_skeleton(struct bpf_object_sk free(s->progs); free(s); } diff --git a/devel/dwarves/files/patch-pahole__strings.h b/devel/dwarves/files/patch-pahole__strings.h new file mode 100644 index 000000000000..3d31fc956d8a --- /dev/null +++ b/devel/dwarves/files/patch-pahole__strings.h @@ -0,0 +1,16 @@ +--- pahole_strings.h.orig 2020-10-20 20:25:03 UTC ++++ pahole_strings.h +@@ -1,5 +1,5 @@ +-#ifndef _STRINGS_H_ +-#define _STRINGS_H_ 1 ++#ifndef _PAHOLE_STRINGS_H_ ++#define _PAHOLE_STRINGS_H_ 1 + /* + SPDX-License-Identifier: GPL-2.0-only + +@@ -28,4 +28,4 @@ static inline const char *strings__ptr(const struct st + return btf__str_by_offset(strings->btf, s); + } + +-#endif /* _STRINGS_H_ */ ++#endif /* _PAHOLE_STRINGS_H_ */ diff --git a/devel/dwarves/pkg-plist b/devel/dwarves/pkg-plist index 51272e5e1209..6e83c0a83fbc 100644 --- a/devel/dwarves/pkg-plist +++ b/devel/dwarves/pkg-plist @@ -26,8 +26,8 @@ include/dwarves/hash.h include/dwarves/libbtf.h include/dwarves/libctf.h include/dwarves/list.h +include/dwarves/pahole_strings.h include/dwarves/rbtree.h -include/dwarves/strings.h lib/libdwarves.so lib/libdwarves.so.1 lib/libdwarves.so.1.0.0