Index: head/devel/dwarves/Makefile =================================================================== --- head/devel/dwarves/Makefile (revision 556512) +++ head/devel/dwarves/Makefile (revision 556513) @@ -1,63 +1,63 @@ # Created by: Conrad Meyer # $FreeBSD$ PORTNAME= dwarves -DISTVERSION= 1.17 +DISTVERSION= 1.19 CATEGORIES= devel MASTER_SITES= https://fedorapeople.org/~acme/dwarves/ MAINTAINER= cem@FreeBSD.org COMMENT= Debugging Information Manipulation Tools (pahole & friends) LICENSE= BSD2CLAUSE GPLv2 LGPL21 LICENSE_COMB= multi LICENSE_FILE_BSD2CLAUSE= ${WRKSRC}/lib/bpf/LICENSE.BSD-2-Clause LICENSE_FILE_GPLv2= ${WRKSRC}/COPYING LICENSE_FILE_LGPL21= ${WRKSRC}/lib/bpf/LICENSE.LPGL-2.1 IGNORE_FreeBSD_11= inherited from dependency devel/elfutils BUILD_DEPENDS= gnulib>=0:devel/gnulib LIB_DEPENDS= libargp.so:devel/argp-standalone \ libdw.so:devel/elfutils USES= cmake gettext python:3.7+,env shebangfix tar:xz USE_GCC= 9+ 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 OPTIONS_SUB= yes post-patch: ${REINPLACE_CMD} -e 's,#include ,#include ,' \ ${WRKSRC}/*.c @${MKDIR} ${WRKSRC}/asm \ ${WRKSRC}/bits \ ${WRKSRC}/linux ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/asm/bitsperlong.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/asm/errno.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/asm/posix_types.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/asm/types.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/asm/unistd.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/bits/reg.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/endian.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/exitfail.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/gettext.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/linux/limits.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/linux/types.h ${LN} -s ${WRKSRC}/freebsd_compat.h ${WRKSRC}/vasnprintf.h pre-configure: ${CP} -a \ ${LOCALBASE}/share/gnulib/lib/obstack.c \ ${LOCALBASE}/share/gnulib/lib/obstack.h \ ${WRKSRC} ${REINPLACE_CMD} -e 's,_GL_ATTRIBUTE_PURE,__attribute__((pure)),g' \ ${WRKSRC}/obstack.c ${WRKSRC}/obstack.h .include Index: head/devel/dwarves/distinfo =================================================================== --- head/devel/dwarves/distinfo (revision 556512) +++ head/devel/dwarves/distinfo (revision 556513) @@ -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 Index: head/devel/dwarves/files/patch-dutil.h =================================================================== --- head/devel/dwarves/files/patch-dutil.h (nonexistent) +++ head/devel/dwarves/files/patch-dutil.h (revision 556513) @@ -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 Property changes on: head/devel/dwarves/files/patch-dutil.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/dwarves/files/patch-dwarves__fprintf.c =================================================================== --- head/devel/dwarves/files/patch-dwarves__fprintf.c (revision 556512) +++ head/devel/dwarves/files/patch-dwarves__fprintf.c (revision 556513) @@ -1,25 +1,25 @@ ---- 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 */ +#include + #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) { - long sys_cacheline_size = sysconf(_SC_LEVEL1_DCACHE_LINESIZE); - - if (sys_cacheline_size > 0) - cacheline_size = sys_cacheline_size; - else - cacheline_size = 64; /* Fall back to a sane value */ + cacheline_size = CACHE_LINE_SIZE; } else cacheline_size = user_cacheline_size; } Index: head/devel/dwarves/files/patch-lib_bpf_src_btf.c =================================================================== --- head/devel/dwarves/files/patch-lib_bpf_src_btf.c (revision 556512) +++ head/devel/dwarves/files/patch-lib_bpf_src_btf.c (revision 556513) @@ -1,47 +1,86 @@ ---- 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; } +#endif /* !FreeBSD */ 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; } +#endif /* !FreeBSD */ 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); } +#endif /* !FreeBSD */ Index: head/devel/dwarves/files/patch-lib_bpf_src_libbpf.c =================================================================== --- head/devel/dwarves/files/patch-lib_bpf_src_libbpf.c (revision 556512) +++ head/devel/dwarves/files/patch-lib_bpf_src_libbpf.c (revision 556513) @@ -1,48 +1,61 @@ ---- 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 -#include #include #include -#include -#include -#include -#include #include #include #include #include -#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); } +#ifndef __FreeBSD__ 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); } +#endif /* !__FreeBSD__ */ Index: head/devel/dwarves/files/patch-pahole__strings.h =================================================================== --- head/devel/dwarves/files/patch-pahole__strings.h (nonexistent) +++ head/devel/dwarves/files/patch-pahole__strings.h (revision 556513) @@ -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_ */ Property changes on: head/devel/dwarves/files/patch-pahole__strings.h ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/devel/dwarves/pkg-plist =================================================================== --- head/devel/dwarves/pkg-plist (revision 556512) +++ head/devel/dwarves/pkg-plist (revision 556513) @@ -1,48 +1,48 @@ bin/btfdiff bin/codiff bin/ctracer bin/dtagnames bin/fullcircle bin/pahole bin/pdwtags bin/pfunct bin/pglobal bin/prefcnt bin/scncopy bin/syscse bin/ostra-cg include/dwarves/btf_encoder.h include/dwarves/config.h include/dwarves/ctf_encoder.h include/dwarves/ctf.h include/dwarves/dutil.h include/dwarves/dwarves.h include/dwarves/dwarves_emit.h include/dwarves/dwarves_reorganize.h include/dwarves/elfcreator.h include/dwarves/elf_symtab.h include/dwarves/gobuffer.h 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 lib/libdwarves_emit.so lib/libdwarves_emit.so.1 lib/libdwarves_emit.so.1.0.0 lib/libdwarves_reorganize.so lib/libdwarves_reorganize.so.1 lib/libdwarves_reorganize.so.1.0.0 %%DATADIR%%/runtime/Makefile %%DATADIR%%/runtime/linux.blacklist.cu %%DATADIR%%/runtime/ctracer_relay.c %%DATADIR%%/runtime/ctracer_relay.h %%DATADIR%%/runtime/python/ostra.py %%DOCSDIR%%/changes-v1.17 %%DOCSDIR%%/README %%DOCSDIR%%/README.btf %%MANPAGES%%man/man1/pahole.1.gz