1
0
Fork 0
mirror of https://git.freebsd.org/ports.git synced 2025-07-12 14:59:13 -04:00
ports/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_ustctl.c
Stefan Eßer 65114dbd39 Fix build with -fno-common
While this makes the build process proceed past the point where the it
previously failed with -fno-common, it still fails later in the examples.

There is a comment in a README file that mentions BUILD_EXAMPLES_FROM_TREE,
but I could not find any actual reference to that parameter outside the
README file and the build failed with and without it set.

This commit is meant to document the changes require due to -no-common
and I leave the fix required in lttng-ust-2.9.0/doc/examples/gen-tp for
a later time or another committer.

The PORTREVISION is not bumped, since the build still fails for me.
2020-09-04 11:38:45 +00:00

31 lines
890 B
C

--- liblttng-ust-ctl/ustctl.c.orig 2016-11-29 01:46:24 UTC
+++ liblttng-ust-ctl/ustctl.c
@@ -23,7 +23,19 @@
#include <lttng/ust-abi.h>
#include <lttng/ust-events.h>
#include <sys/mman.h>
+#if defined(__FreeBSD__)
+#include <sys/types.h>
+#include <sys/endian.h>
+#define bswap_16 bswap16
+#define bswap_32 bswap32
+#define bswap_64 bswap64
+#define __bswap_16 bswap16
+#define __bswap_32 bswap32
+#define __bswap_64 bswap64
+#define NT_GNU_BUILD_ID 3
+#else
#include <byteswap.h>
+#endif
#include <usterr-signal-safe.h>
#include <ust-comm.h>
@@ -76,7 +88,7 @@ extern void lttng_ring_buffer_client_discard_exit(void
extern void lttng_ring_buffer_client_discard_rt_exit(void);
extern void lttng_ring_buffer_metadata_client_exit(void);
-volatile enum ust_loglevel ust_loglevel;
+extern volatile enum ust_loglevel ust_loglevel;
int ustctl_release_handle(int sock, int handle)
{