diff options
| author | Gleb Popov <arrowd@FreeBSD.org> | 2026-02-06 12:00:10 +0000 |
|---|---|---|
| committer | Gleb Popov <arrowd@FreeBSD.org> | 2026-03-14 15:48:40 +0000 |
| commit | 722188d29b60bb3c34f49e0b6cd5b63dadd97bda (patch) | |
| tree | afc9afc2d2316e3bb6e0d4699a42f2c5ed1a5c83 /devel | |
| parent | 5e698200134f1ff00f0a173a60477b2b8e03e51f (diff) | |
PR: 293431
Approved by: cem (maintainer timeout)
Differential Revision: https://reviews.freebsd.org/D55142
Diffstat (limited to 'devel')
| -rw-r--r-- | devel/dwarves/Makefile | 70 | ||||
| -rw-r--r-- | devel/dwarves/distinfo | 6 | ||||
| -rw-r--r-- | devel/dwarves/files/freebsd_compat.h | 183 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-CMakeLists.txt | 70 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-ctracer.c | 10 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-dtagnames.c | 35 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-dutil.h | 10 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-dwarves__fprintf.c | 25 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-dwarves__reorganize.c | 13 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-lib_bpf_src_btf.c | 86 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-lib_bpf_src_libbpf.c | 61 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-lib_bpf_src_libbpf__internal.h | 28 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-lib_bpf_src_skel__internal.h | 12 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-lib_bpf_src_str__error.c | 18 | ||||
| -rw-r--r-- | devel/dwarves/files/patch-pahole__strings.h | 16 | ||||
| -rw-r--r-- | devel/dwarves/pkg-plist | 6 |
16 files changed, 343 insertions, 306 deletions
diff --git a/devel/dwarves/Makefile b/devel/dwarves/Makefile index a9650f2aede4..96718ed5cf32 100644 --- a/devel/dwarves/Makefile +++ b/devel/dwarves/Makefile @@ -1,6 +1,5 @@ PORTNAME= dwarves -DISTVERSION= 1.19 -PORTREVISION= 3 +DISTVERSION= 1.31 CATEGORIES= devel MASTER_SITES= https://fedorapeople.org/~acme/dwarves/ @@ -12,49 +11,56 @@ 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 +LICENSE_FILE_LGPL21= ${WRKSRC}/lib/bpf/LICENSE.LGPL-2.1 -BUILD_DEPENDS= gnulib>=0:devel/gnulib +EXTRACT_DEPENDS=gnulib>=0:devel/gnulib LIB_DEPENDS= libargp.so:devel/argp-standalone \ - libdw.so:devel/elfutils + libdw.so:devel/elfutils \ + libepoll-shim.so:devel/libepoll-shim +RUN_DEPENDS= bash:shells/bash -USES= cmake gettext python:env shebangfix tar:xz -USE_GCC= yes -USE_LDCONFIG= yes +USES= cmake python:env shebangfix tar:xz SHEBANG_FILES= btfdiff fullcircle ostra/ostra-cg ostra/python/ostra.py -CFLAGS+= -I${WRKSRC} -Wno-attributes +FAKE_HEADERS= asm/bitsperlong.h \ + asm/byteorder.h \ + asm/errno.h \ + asm/posix_types.h \ + asm/types.h \ + asm/unistd.h \ + linux/bpf_perf_event.h \ + linux/genetlink.h \ + linux/if_ether.h \ + linux/ioctl.h \ + linux/limits.h \ + linux/ptrace.h \ + linux/rtnetlink.h \ + linux/socket.h \ + linux/stddef.h \ + linux/types.h \ + linux/version.h \ + sys/vfs.h OPTIONS_DEFINE= MANPAGES OPTIONS_DEFAULT= MANPAGES OPTIONS_SUB= yes -post-patch: - ${REINPLACE_CMD} -e 's,#include <malloc.h>,#include <stdlib.h>,' \ - ${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: +post-extract: +.for h in ${FAKE_HEADERS} + @${MKDIR} ${WRKSRC}/$$(dirname ${h}) + ${LN} -fs ${PATCHDIR}/freebsd_compat.h ${WRKSRC}/${h} +.endfor ${CP} -a \ ${LOCALBASE}/share/gnulib/lib/obstack.c \ - ${LOCALBASE}/share/gnulib/lib/obstack.h \ + ${LOCALBASE}/share/gnulib/lib/libc-config.h \ + ${LOCALBASE}/share/gnulib/lib/cdefs.h \ + ${LOCALBASE}/share/gnulib/lib/exitfail.h \ + ${LOCALBASE}/share/gnulib/lib/exitfail.c \ + ${LOCALBASE}/share/gnulib/lib/gettext.h \ ${WRKSRC} - ${REINPLACE_CMD} -e 's,_GL_ATTRIBUTE_PURE,__attribute__((pure)),g' \ - ${WRKSRC}/obstack.c ${WRKSRC}/obstack.h + ${SED} -e 's|_GL_ATTRIBUTE_PURE|__attribute__ ((__pure__))|g' \ + ${LOCALBASE}/share/gnulib/lib/obstack.in.h > \ + ${WRKSRC}/obstack.h .include <bsd.port.mk> diff --git a/devel/dwarves/distinfo b/devel/dwarves/distinfo index 480e7aae3406..af25457991f5 100644 --- a/devel/dwarves/distinfo +++ b/devel/dwarves/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1606511990 -SHA256 (dwarves-1.19.tar.xz) = 9af54663f2bab10d1ea85f97801c8fa045ff62e9b39d4ec6a8541354cb7b6ef3 -SIZE (dwarves-1.19.tar.xz) = 686136 +TIMESTAMP = 1770311533 +SHA256 (dwarves-1.31.tar.xz) = 0a7f255ccacf8cc7f8cd119099eb327179b4b3c67cb015af646af6d0cb03054d +SIZE (dwarves-1.31.tar.xz) = 2350084 diff --git a/devel/dwarves/files/freebsd_compat.h b/devel/dwarves/files/freebsd_compat.h new file mode 100644 index 000000000000..12fa84e60024 --- /dev/null +++ b/devel/dwarves/files/freebsd_compat.h @@ -0,0 +1,183 @@ +#pragma once + +#include <sys/param.h> +#include <sys/cdefs.h> +#include <sys/stat.h> +#include <sys/mount.h> +#include <errno.h> +#include <endian.h> +#include <limits.h> +#include <stdint.h> +#include <stdlib.h> +#include <stdbool.h> + +#include <libintl.h> + +/* asm/bitsperlong.h */ +/* + * In FreeBSD, __ILP32__ / __LP64__ are canonical, but gcc does not correctly + * emit __ILP32__ in 32-bit mode, at least on i386. + */ +#if __SIZEOF_LONG__ == 4 /* defined(__ILP32__) */ +#define __BITS_PER_LONG 32 +#elif __SIZEOF_LONG__ == 8 /* defined(__LP64__) */ +#define __BITS_PER_LONG 64 +#else +#error "I'm a teapot" +#endif + +/* asm/types.h */ +typedef uint8_t __u8; +typedef uint16_t __u16; +typedef uint32_t __u32; +typedef uint64_t __u64; +typedef int8_t __s8; +typedef int16_t __s16; +typedef int32_t __s32; +typedef int64_t __s64; + +/* linux/types.h */ +typedef uint16_t __be16; +typedef uint32_t __be32; +typedef uint64_t __be64; +typedef uint16_t __le16; +typedef uint32_t __le32; +typedef uint64_t __le64; +#define __aligned_u64 __u64 __attribute__((aligned(8))) + +/* search.h */ +#if __FreeBSD_version < 1600000 +static inline void +tdestroy(void *vroot __unused, void (*freefct)(void *) __unused) +{ + + /* XXX: Just leak the memory for now. */ +} +#endif + +/* our libc++ defines in this way */ +#ifndef ENODATA +#define ENODATA 9919 +#endif + +#ifndef EUCLEAN +#define EUCLEAN 8818 +#endif + +#if BYTE_ORDER == LITTLE_ENDIAN +#define __LITTLE_ENDIAN_BITFIELD +#else +#define __BIG_ENDIAN_BITFIELD +#endif + +#ifndef KERNEL_VERSION +#define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c))) +#endif + +/* bpf stuff */ +typedef struct pt_regs bpf_user_pt_regs_t; +struct pt_regs { +/* + * C ABI says these regs are callee-preserved. They aren't saved on kernel entry + * unless syscall needs a complete, fully filled "struct pt_regs". + */ + unsigned long r15; + unsigned long r14; + unsigned long r13; + unsigned long r12; + unsigned long rbp; + unsigned long rbx; +/* These regs are callee-clobbered. Always saved on kernel entry. */ + unsigned long r11; + unsigned long r10; + unsigned long r9; + unsigned long r8; + unsigned long rax; + unsigned long rcx; + unsigned long rdx; + unsigned long rsi; + unsigned long rdi; +/* + * On syscall entry, this is syscall#. On CPU exception, this is error code. + * On hw interrupt, it's IRQ number: + */ + unsigned long orig_rax; +/* Return frame for iretq */ + unsigned long rip; + unsigned long cs; + unsigned long eflags; + unsigned long rsp; + unsigned long ss; +/* top of stack page */ +}; +#define __NR_perf_event_open (-1) + +/* netlink stuff */ +typedef __sa_family_t __kernel_sa_family_t; +struct ifinfomsg { + unsigned char ifi_family; + unsigned char __ifi_pad; + unsigned short ifi_type; /* ARPHRD_* */ + int ifi_index; /* Link index */ + unsigned ifi_flags; /* IFF_* flags */ + unsigned ifi_change; /* IFF_* change mask */ +}; +struct tcmsg { + unsigned char tcm_family; + unsigned char tcm__pad1; + unsigned short tcm__pad2; + int tcm_ifindex; + __u32 tcm_handle; + __u32 tcm_parent; +/* tcm_block_index is used instead of tcm_parent + * in case tcm_ifindex == TCM_IFINDEX_MAGIC_BLOCK + */ +#define tcm_block_index tcm_parent + __u32 tcm_info; +}; +struct genlmsghdr { + __u8 cmd; + __u8 version; + __u16 reserved; +}; + +#define AF_PACKET 0 +#define GENL_HDRLEN 0 +#define CTRL_ATTR_FAMILY_ID 0 +#define GENL_ID_CTRL 0 +#define CTRL_CMD_GETFAMILY 0 +#define CTRL_ATTR_FAMILY_NAME 0 +#define RTM_SETLINK 0 +#define RTM_GETLINK 0 +#define RTM_NEWQDISC 0 +#define RTM_DELQDISC 0 +#define RTM_NEWTFILTER 0 +#define RTM_DELTFILTER 0 +#define RTM_GETTFILTER 0 +#define ETH_P_ALL 0 + +#define IFLA_MAX 0 +#define IFLA_XDP 0 +#define IFLA_XDP_ATTACHED 0 +#define IFLA_XDP_DRV_PROG_ID 0 +#define IFLA_XDP_EXPECTED_FD 0 +#define IFLA_XDP_FD 0 +#define IFLA_XDP_FLAGS 0 +#define IFLA_XDP_HW_PROG_ID 0 +#define IFLA_XDP_MAX 0 +#define IFLA_XDP_PROG_ID 0 +#define IFLA_XDP_SKB_PROG_ID 0 +#define XDP_ATTACHED_MULTI 0 +#define XDP_ATTACHED_NONE 0 +#define XDP_FLAGS_DRV_MODE 0 +#define XDP_FLAGS_HW_MODE 0 +#define XDP_FLAGS_MASK 0 +#define XDP_FLAGS_MODES 0 +#define XDP_FLAGS_REPLACE 0 +#define XDP_FLAGS_SKB_MODE 0 + +#define TCA_KIND 0 +#define TCA_OPTIONS 0 +#define TCA_MAX 0 + +void tdestroy(void *, void (*)(void *)); diff --git a/devel/dwarves/files/patch-CMakeLists.txt b/devel/dwarves/files/patch-CMakeLists.txt index b534bd986665..e21bb8e8fc69 100644 --- a/devel/dwarves/files/patch-CMakeLists.txt +++ b/devel/dwarves/files/patch-CMakeLists.txt @@ -1,44 +1,40 @@ ---- CMakeLists.txt.orig 2020-11-23 12:21:38 UTC +--- CMakeLists.txt.orig 2025-11-04 17:49:40 UTC +++ CMakeLists.txt -@@ -9,7 +9,7 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR} - # Try to parse this later, Helio just showed me a KDE4 example to support - # x86-64 builds. - # the following are directories where stuff will be installed to --set(__LIB "" CACHE STRING "Define suffix of directory name (32/64)" ) -+set(__LIB "lib" CACHE STRING "Define suffix of directory name (32/64)" ) +@@ -34,7 +34,7 @@ endif (NOT CMAKE_BUILD_TYPE) + FORCE) + endif (NOT CMAKE_BUILD_TYPE) + +-set(CMAKE_C_FLAGS_DEBUG "-Wall -Werror -ggdb -O0") ++set(CMAKE_C_FLAGS_DEBUG "-Wall -O0") + set(CMAKE_C_FLAGS_RELEASE "-Wall -O2") + SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -pthread") + +@@ -52,6 +52,7 @@ find_package(Python3 QUIET) + find_package(argp REQUIRED) + find_package(obstack REQUIRED) + find_package(Python3 QUIET) ++find_package(epoll-shim REQUIRED) - macro(_set_fancy _var _value _comment) - if (NOT DEFINED ${_var}) -@@ -81,7 +81,7 @@ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE64_SOU + # make sure git submodule(s) are checked out + find_package(Git QUIET) +@@ -100,6 +101,7 @@ if (NOT LIBBPF_FOUND) + target_include_directories(bpf PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include + ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi) ++ target_link_libraries(bpf PRIVATE epoll-shim::epoll-shim) + endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64") - --file(GLOB libbpf_sources "lib/bpf/src/*.c") -+set(libbpf_sources lib/bpf/src/btf.c lib/bpf/src/hashmap.c lib/bpf/src/libbpf.c) - add_library(bpf OBJECT ${libbpf_sources}) - set_property(TARGET bpf PROPERTY POSITION_INDEPENDENT_CODE 1) - target_include_directories(bpf PRIVATE -@@ -90,13 +90,13 @@ set(dwarves_LIB_SRCS dwarves.c dwarves_fprintf.c gobuf - - set(dwarves_LIB_SRCS dwarves.c dwarves_fprintf.c gobuffer strings - ctf_encoder.c ctf_loader.c libctf.c btf_encoder.c btf_loader.c libbtf.c -- dwarf_loader.c dutil.c elf_symtab.c rbtree.c) -+ dwarf_loader.c dutil.c elf_symtab.c rbtree.c obstack.c) - add_library(dwarves SHARED ${dwarves_LIB_SRCS} $<TARGET_OBJECTS:bpf>) + set(dwarves_LIB_SRCS dwarves.c dwarves_fprintf.c gobuffer.c +@@ -108,10 +110,11 @@ endif() + if (NOT LIBBPF_FOUND) + list(APPEND dwarves_LIB_SRCS $<TARGET_OBJECTS:bpf>) + endif() ++list(APPEND dwarves_LIB_SRCS obstack.c exitfail.c) + add_library(dwarves ${dwarves_LIB_SRCS}) set_target_properties(dwarves PROPERTIES VERSION 1.0.0 SOVERSION 1) set_target_properties(dwarves PROPERTIES INTERFACE_LINK_LIBRARIES "") - target_include_directories(dwarves PRIVATE - ${CMAKE_CURRENT_SOURCE_DIR}/lib/bpf/include/uapi) --target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES}) -+target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES} libargp.so libintl.so) +-target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBBPF_LIBRARIES} ${ARGP_LIBRARY} ${OBSTACK_LIBRARY}) ++target_link_libraries(dwarves ${DWARF_LIBRARIES} ${ZLIB_LIBRARIES} ${LIBBPF_LIBRARIES} ${ARGP_LIBRARY} ${OBSTACK_LIBRARY} epoll-shim::epoll-shim) set(dwarves_emit_LIB_SRCS dwarves_emit.c) - add_library(dwarves_emit SHARED ${dwarves_emit_LIB_SRCS}) -@@ -161,6 +161,7 @@ install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAK - install(FILES man-pages/pahole.1 DESTINATION ${CMAKE_INSTALL_PREFIX}/share/man/man1/) - install(PROGRAMS ostra/ostra-cg DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) - install(PROGRAMS btfdiff fullcircle DESTINATION ${CMAKE_INSTALL_PREFIX}/bin) -+install(FILES changes-v1.17 README README.btf DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/dwarves) - install(FILES ostra/python/ostra.py DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime/python) - install(FILES lib/Makefile lib/ctracer_relay.c lib/ctracer_relay.h lib/linux.blacklist.cu - DESTINATION ${CMAKE_INSTALL_PREFIX}/share/dwarves/runtime) + add_library(dwarves_emit ${dwarves_emit_LIB_SRCS}) diff --git a/devel/dwarves/files/patch-ctracer.c b/devel/dwarves/files/patch-ctracer.c new file mode 100644 index 000000000000..fb428efad7a2 --- /dev/null +++ b/devel/dwarves/files/patch-ctracer.c @@ -0,0 +1,10 @@ +--- ctracer.c.orig 2024-07-29 21:12:52 UTC ++++ ctracer.c +@@ -18,6 +18,7 @@ + #include <sys/types.h> + #include <sys/stat.h> + #include <unistd.h> ++#include <sys/queue.h> + + #include "dwarves_reorganize.h" + #include "dwarves_emit.h" diff --git a/devel/dwarves/files/patch-dtagnames.c b/devel/dwarves/files/patch-dtagnames.c deleted file mode 100644 index b8c8e0d4debb..000000000000 --- a/devel/dwarves/files/patch-dtagnames.c +++ /dev/null @@ -1,35 +0,0 @@ ---- dtagnames.c.orig 2019-05-01 15:06:45 UTC -+++ dtagnames.c -@@ -7,16 +7,31 @@ - - #include <stdio.h> - #include <stdlib.h> --#include <malloc.h> -+#ifdef __FreeBSD__ -+#include <err.h> -+#include <malloc_np.h> -+#else -+#endif - - #include "dwarves.h" - #include "dutil.h" - - static void print_malloc_stats(void) - { -+#ifdef __FreeBSD__ -+ int error; -+ size_t allocated, sz; -+ -+ sz = sizeof(allocated); -+ error = mallctl("stats.active", &allocated, &sz, NULL, 0); -+ if (error != 0) -+ errc(1, error, "mallctl(stats.active)"); -+ fprintf(stderr, "size: %zu\n", allocated); -+#else - struct mallinfo m = mallinfo(); - - fprintf(stderr, "size: %u\n", m.uordblks); -+#endif - } - - static int class__tag_name(struct tag *tag, struct cu *cu __unused, diff --git a/devel/dwarves/files/patch-dutil.h b/devel/dwarves/files/patch-dutil.h index a881b76087bf..c1f45354f6e6 100644 --- a/devel/dwarves/files/patch-dutil.h +++ b/devel/dwarves/files/patch-dutil.h @@ -1,6 +1,6 @@ ---- dutil.h.orig 2020-08-21 14:53:52 UTC +--- dutil.h.orig 2024-10-01 14:51:57 UTC +++ dutil.h -@@ -28,6 +28,9 @@ +@@ -29,6 +29,9 @@ #define __pure __attribute__ ((pure)) #endif @@ -9,8 +9,8 @@ +#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_ + #ifndef DW_TAG_LLVM_annotation +@@ -40,6 +43,7 @@ static inline __attribute__((const)) bool is_power_of_ return (n != 0 && ((n & (n - 1)) == 0)); } @@ -18,7 +18,7 @@ /** * fls - find last (most-significant) bit set * @x: the word to search -@@ -46,6 +50,7 @@ static __always_inline int fls(int x) +@@ -51,6 +55,7 @@ static __always_inline int fls(int x) { return x ? sizeof(x) * 8 - __builtin_clz(x) : 0; } diff --git a/devel/dwarves/files/patch-dwarves__fprintf.c b/devel/dwarves/files/patch-dwarves__fprintf.c deleted file mode 100644 index bf79545e8b9a..000000000000 --- a/devel/dwarves/files/patch-dwarves__fprintf.c +++ /dev/null @@ -1,25 +0,0 @@ ---- 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 <acme@redhat.com> - */ - -+#include <sys/param.h> -+ - #include <dwarf.h> - #include <errno.h> - #include <stdio.h> -@@ -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; - } diff --git a/devel/dwarves/files/patch-dwarves__reorganize.c b/devel/dwarves/files/patch-dwarves__reorganize.c new file mode 100644 index 000000000000..3c0f0e495725 --- /dev/null +++ b/devel/dwarves/files/patch-dwarves__reorganize.c @@ -0,0 +1,13 @@ +--- dwarves_reorganize.c.orig 2024-10-04 17:48:24 UTC ++++ dwarves_reorganize.c +@@ -7,9 +7,9 @@ + Copyright (C) 2007 Arnaldo Carvalho de Melo <acme@redhat.com> + */ + +-#include "list.h" + #include "dwarves_reorganize.h" + #include "dwarves.h" ++#include "list.h" + + static void class__recalc_holes(struct class *class) + { diff --git a/devel/dwarves/files/patch-lib_bpf_src_btf.c b/devel/dwarves/files/patch-lib_bpf_src_btf.c deleted file mode 100644 index 8a5310517553..000000000000 --- a/devel/dwarves/files/patch-lib_bpf_src_btf.c +++ /dev/null @@ -1,86 +0,0 @@ ---- lib/bpf/src/btf.c.orig 2020-11-16 19:49:14 UTC -+++ lib/bpf/src/btf.c -@@ -1,8 +1,7 @@ - // SPDX-License-Identifier: (LGPL-2.1 OR BSD-2-Clause) - /* Copyright (c) 2018 Facebook */ - --#include <byteswap.h> --#include <endian.h> -+#include <sys/endian.h> - #include <stdio.h> - #include <stdlib.h> - #include <string.h> -@@ -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 int compare_vsi_off(const void *_a, const void *_b) - { - 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) - { -@@ -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 }; -@@ -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, -@@ -4559,6 +4568,7 @@ static int btf_dedup_remap_types(struct btf_dedup *d) - return 0; - } - -+#ifndef __FreeBSD__ - /* - * 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 */ diff --git a/devel/dwarves/files/patch-lib_bpf_src_libbpf.c b/devel/dwarves/files/patch-lib_bpf_src_libbpf.c deleted file mode 100644 index 2d80b6bad35e..000000000000 --- a/devel/dwarves/files/patch-lib_bpf_src_libbpf.c +++ /dev/null @@ -1,61 +0,0 @@ ---- lib/bpf/src/libbpf.c.orig 2020-11-16 19:49:14 UTC -+++ lib/bpf/src/libbpf.c -@@ -30,18 +30,12 @@ - #include <linux/kernel.h> - #include <linux/bpf.h> - #include <linux/btf.h> --#include <linux/filter.h> - #include <linux/list.h> - #include <linux/limits.h> --#include <linux/perf_event.h> --#include <linux/ring_buffer.h> --#include <linux/version.h> --#include <sys/epoll.h> - #include <sys/ioctl.h> - #include <sys/mman.h> - #include <sys/stat.h> - #include <sys/types.h> --#include <sys/vfs.h> - #include <sys/utsname.h> - #include <sys/resource.h> - #include <libelf.h> -@@ -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 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) -@@ -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; -@@ -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__ */ diff --git a/devel/dwarves/files/patch-lib_bpf_src_libbpf__internal.h b/devel/dwarves/files/patch-lib_bpf_src_libbpf__internal.h new file mode 100644 index 000000000000..fae4203064cd --- /dev/null +++ b/devel/dwarves/files/patch-lib_bpf_src_libbpf__internal.h @@ -0,0 +1,28 @@ +--- lib/bpf/src/libbpf_internal.h.orig 2025-10-27 20:52:10 UTC ++++ lib/bpf/src/libbpf_internal.h +@@ -15,6 +15,7 @@ + #include <errno.h> + #include <linux/err.h> + #include <fcntl.h> ++#include <sys/mman.h> + #include <unistd.h> + #include <sys/syscall.h> + #include <libelf.h> +@@ -664,7 +665,7 @@ static inline int sys_dup3(int oldfd, int newfd, int f + + static inline int sys_dup3(int oldfd, int newfd, int flags) + { +- return syscall(__NR_dup3, oldfd, newfd, flags); ++ return dup3(oldfd, newfd, flags); + } + + /* Some versions of Android don't provide memfd_create() in their libc +@@ -673,7 +674,7 @@ static inline int sys_memfd_create(const char *name, u + */ + static inline int sys_memfd_create(const char *name, unsigned flags) + { +- return syscall(__NR_memfd_create, name, flags); ++ return memfd_create(name, flags); + } + + /* Point *fixed_fd* to the same file that *tmp_fd* points to. diff --git a/devel/dwarves/files/patch-lib_bpf_src_skel__internal.h b/devel/dwarves/files/patch-lib_bpf_src_skel__internal.h new file mode 100644 index 000000000000..c27208e393d0 --- /dev/null +++ b/devel/dwarves/files/patch-lib_bpf_src_skel__internal.h @@ -0,0 +1,12 @@ +--- lib/bpf/src/skel_internal.h.orig 2025-10-27 20:52:10 UTC ++++ lib/bpf/src/skel_internal.h +@@ -74,7 +74,8 @@ static inline int skel_sys_bpf(enum bpf_cmd cmd, union + #ifdef __KERNEL__ + return kern_sys_bpf(cmd, attr, size); + #else +- return syscall(__NR_bpf, cmd, attr, size); ++ errno = ENOTSUP; ++ return -1; + #endif + } + diff --git a/devel/dwarves/files/patch-lib_bpf_src_str__error.c b/devel/dwarves/files/patch-lib_bpf_src_str__error.c new file mode 100644 index 000000000000..8af5cab73df8 --- /dev/null +++ b/devel/dwarves/files/patch-lib_bpf_src_str__error.c @@ -0,0 +1,18 @@ +--- lib/bpf/src/str_error.c.orig 2025-10-27 20:52:10 UTC ++++ lib/bpf/src/str_error.c +@@ -8,6 +8,15 @@ + #ifndef ENOTSUPP + #define ENOTSUPP 524 + #endif ++#ifndef EBADFD ++#define EBADFD 8816 ++#endif ++#ifndef ENODATA ++#define ENODATA 8817 ++#endif ++#ifndef EUCLEAN ++#define EUCLEAN 8818 ++#endif + + /* make sure libbpf doesn't use kernel-only integer typedefs */ + #pragma GCC poison u8 u16 u32 u64 s8 s16 s32 s64 diff --git a/devel/dwarves/files/patch-pahole__strings.h b/devel/dwarves/files/patch-pahole__strings.h deleted file mode 100644 index 3d31fc956d8a..000000000000 --- a/devel/dwarves/files/patch-pahole__strings.h +++ /dev/null @@ -1,16 +0,0 @@ ---- 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 15213ba69553..ce82642a2ef7 100644 --- a/devel/dwarves/pkg-plist +++ b/devel/dwarves/pkg-plist @@ -13,7 +13,6 @@ 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 @@ -23,10 +22,8 @@ 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 lib/libdwarves.so lib/libdwarves.so.1 @@ -42,7 +39,4 @@ lib/libdwarves_reorganize.so.1.0.0 %%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%%share/man/man1/pahole.1.gz |
