git: 339c2277cfc8 - main - sysutils/lttng-ust: Update version 2.9.0=>2.13.2

From: Muhammad Moinur Rahman <bofh_at_FreeBSD.org>
Date: Sun, 29 Oct 2023 22:57:05 UTC
The branch main has been updated by bofh:

URL: https://cgit.FreeBSD.org/ports/commit/?id=339c2277cfc84002238b7529866ae96971124b90

commit 339c2277cfc84002238b7529866ae96971124b90
Author:     Sean Champ <lab+bsd@thinkum.space>
AuthorDate: 2023-10-29 10:58:34 +0000
Commit:     Muhammad Moinur Rahman <bofh@FreeBSD.org>
CommitDate: 2023-10-29 22:53:30 +0000

    sysutils/lttng-ust: Update version 2.9.0=>2.13.2
    
    Some of the patches retained here may be out of scope now, such as those
    patches still adding a definition for NT_GNU_BUILD_ID.
    
    Changelog:
    https://git.lttng.org/?p=lttng-ust.git;a=blob_plain;f=ChangeLog;hb=ac8d9a90b1e9052d2dea77e0b0c92b779bceb4a8
    
    PR:             263112
---
 sysutils/lttng-ust/Makefile                        |  18 +--
 sysutils/lttng-ust/distinfo                        |   6 +-
 sysutils/lttng-ust/files/patch-config_libtool.m4   |  15 --
 .../patch-doc_examples_clock-override_Makefile     |  10 +-
 ...tiple-shared-libraries_cmake_FindLTTngUST.cmake |  18 +++
 .../files/patch-doc_examples_demo-tracef_Makefile  |  10 +-
 .../patch-doc_examples_demo-tracelog_Makefile      |  10 +-
 .../files/patch-doc_examples_demo_Makefile         |  10 +-
 .../files/patch-doc_examples_easy-ust_Makefile     |  10 +-
 .../files/patch-doc_examples_gen-tp_Makefile       |  14 +-
 .../patch-doc_examples_getcpu-override_Makefile    |  10 +-
 .../patch-doc_examples_hello-static-lib_Makefile   |  13 +-
 sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3 |  55 +++++---
 .../lttng-ust/files/patch-doc_man_lttng-ust.3.txt  |  48 +++----
 .../files/patch-include_lttng_ust-dlfcn.h          |  11 --
 .../lttng-ust/files/patch-include_lttng_ust-elf.h  |  22 ---
 .../patch-include_lttng_ust-tracepoint-event.h     |  26 ++--
 .../files/patch-liblttng-ust-ctl_Makefile.am       |   9 --
 .../files/patch-liblttng-ust-ctl_Makefile.in       |  11 --
 .../files/patch-liblttng-ust-ctl_ustctl.c          |  31 ----
 .../files/patch-liblttng-ust-dl_ust__dl.h          |  10 --
 .../files/patch-liblttng-ust-fd_lttng-ust-fd.c     |  11 --
 .../lttng-ust/files/patch-liblttng-ust_Makefile.am |  10 --
 .../lttng-ust/files/patch-liblttng-ust_Makefile.in |  10 --
 .../lttng-ust/files/patch-liblttng-ust_compat.h    |  20 ---
 sysutils/lttng-ust/files/patch-lttng-ust.pc.in     |  10 --
 sysutils/lttng-ust/files/patch-m4_libtool.m4       | 157 +++++++++++++++++++++
 .../files/patch-src_common_compat_dlfcn.h          |  11 ++
 sysutils/lttng-ust/files/patch-src_common_elf.h    |  14 ++
 .../files/patch-src_lib_lttng-ust-ctl_ustctl.c     |  14 ++
 .../files/patch-src_lib_lttng-ust-dl_ust__dl.h     |  10 ++
 .../lttng-ust/files/patch-src_lib_lttng-ust.pc.in  |  10 ++
 sysutils/lttng-ust/pkg-plist                       |  88 +++++++-----
 33 files changed, 391 insertions(+), 341 deletions(-)

diff --git a/sysutils/lttng-ust/Makefile b/sysutils/lttng-ust/Makefile
index 5d48813f3fac..a02db65df551 100644
--- a/sysutils/lttng-ust/Makefile
+++ b/sysutils/lttng-ust/Makefile
@@ -1,6 +1,5 @@
 PORTNAME=	lttng-ust
-PORTVERSION=	2.9.0
-PORTREVISION=	2
+PORTVERSION=	2.13.2
 CATEGORIES=	sysutils
 MASTER_SITES=	http://lttng.org/files/${PORTNAME}/
 
@@ -10,24 +9,25 @@ WWW=		https://github.com/lttng/lttng-ust
 
 LICENSE=		LGPL21 MIT GPLv2
 LICENSE_COMB=		dual
-LICENSE_FILE_LGPL21=	${WRKSRC}/COPYING
-LICENSE_FILE_MIT=	${WRKSRC}/COPYING
-LICENSE_FILE_GPLv2=	${WRKSRC}/COPYING
-
-BROKEN=		fails to configure: Cannot find liburcu-bp lib. Use LDFLAGS=-Ldir to specify its location
+LICENSE_FILE_GPLv2=	${WRKSRC}/LICENSE
+LICENSE_FILE_LGPL21=	${WRKSRC}/LICENSE
+LICENSE_FILE_MIT=	${WRKSRC}/LICENSE
 
 BUILD_DEPENDS=	asciidoc:textproc/asciidoc \
 		xmlto:textproc/xmlto
 LIB_DEPENDS=	liburcu.so:sysutils/liburcu
 
-USES=		autoreconf gmake libtool localbase pathfix python \
+USES=		autoreconf gmake libtool localbase pathfix pkgconfig python \
 		shebangfix tar:bzip2
 USE_LDCONFIG=	yes
+
+SHEBANG_FILES=	tools/lttng-gen-tp
+
 GNU_CONFIGURE=	yes
 # XXX: build fails if cmake is detected, see PR 253327
 CONFIGURE_ENV=	ac_cv_prog_HAVE_CMAKE=no
+
 INSTALL_TARGET=	install-strip
-SHEBANG_FILES=	tools/lttng-gen-tp
 TEST_TARGET=	check
 
 OPTIONS_DEFINE=	DOCS
diff --git a/sysutils/lttng-ust/distinfo b/sysutils/lttng-ust/distinfo
index 1303fdca5f77..6d6105c0f390 100644
--- a/sysutils/lttng-ust/distinfo
+++ b/sysutils/lttng-ust/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1483807828
-SHA256 (lttng-ust-2.9.0.tar.bz2) = 4d541a863f42dfc685ca05024027a442c70d03594c154a43e62bc109b1ea5daf
-SIZE (lttng-ust-2.9.0.tar.bz2) = 764027
+TIMESTAMP = 1649309595
+SHA256 (lttng-ust-2.13.2.tar.bz2) = 08679a1dfc2c9428885273861628aa5d828972f389a38bb08fdce39adee589b7
+SIZE (lttng-ust-2.13.2.tar.bz2) = 1327075
diff --git a/sysutils/lttng-ust/files/patch-config_libtool.m4 b/sysutils/lttng-ust/files/patch-config_libtool.m4
deleted file mode 100644
index 12539959ccf1..000000000000
--- a/sysutils/lttng-ust/files/patch-config_libtool.m4
+++ /dev/null
@@ -1,15 +0,0 @@
---- config/libtool.m4.orig	2016-05-12 15:26:58 UTC
-+++ config/libtool.m4
-@@ -1866,6 +1866,12 @@ else
-   lt_cv_dlopen_libs=
- 
-   case $host_os in
-+  FreeBSD*)
-+    lt_cv_dlopen="dlopen"
-+    lt_cv_dlopen_libs=""
-+    lt_cv_dlopen_self=yes
-+    ;;
-+
-   beos*)
-     lt_cv_dlopen="load_add_on"
-     lt_cv_dlopen_libs=
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_clock-override_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_clock-override_Makefile
index 452dca708715..213737d30470 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_clock-override_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_clock-override_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/clock-override/Makefile.orig	2016-08-25 21:53:05 UTC
+--- doc/examples/clock-override/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/clock-override/Makefile
-@@ -15,12 +15,8 @@
+@@ -8,8 +8,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl	# On Linux
 -#LIBS = -lc	# On BSD
 +#LIBS = -ldl	# On Linux
 +LIBS =	# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: lttng-ust-clock-override-example.so
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_cmake-multiple-shared-libraries_cmake_FindLTTngUST.cmake b/sysutils/lttng-ust/files/patch-doc_examples_cmake-multiple-shared-libraries_cmake_FindLTTngUST.cmake
new file mode 100644
index 000000000000..efed4ab8e435
--- /dev/null
+++ b/sysutils/lttng-ust/files/patch-doc_examples_cmake-multiple-shared-libraries_cmake_FindLTTngUST.cmake
@@ -0,0 +1,18 @@
+--- doc/examples/cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake.orig	2022-01-27 20:18:46 UTC
++++ doc/examples/cmake-multiple-shared-libraries/cmake/FindLTTngUST.cmake
+@@ -97,13 +97,13 @@ if(LTTNGUST_INCLUDE_DIRS AND LTTNGUST_INCLUDE_DIRS_GEN
+     add_library(LTTng::UST UNKNOWN IMPORTED)
+     set_target_properties(LTTng::UST PROPERTIES
+       INTERFACE_INCLUDE_DIRECTORIES "${LTTNGUST_INCLUDE_DIRS};${LTTNGUST_INCLUDE_DIRS_GENERATED}"
+-      INTERFACE_LINK_LIBRARIES ${CMAKE_DL_LIBS}
++      INTERFACE_LINK_LIBRARIES "${CMAKE_DL_LIBS}"
+       IMPORTED_LINK_INTERFACE_LANGUAGES "C"
+       IMPORTED_LOCATION "${LTTNGUST_LIBRARIES}")
+   endif()
+ 
+   # add libdl to required libraries
+-  set(LTTNGUST_LIBRARIES ${LTTNGUST_LIBRARIES} ${CMAKE_DL_LIBS})
++  set(LTTNGUST_LIBRARIES ${LTTNGUST_LIBRARIES} "${CMAKE_DL_LIBS}")
+ endif()
+ 
+ # handle the QUIETLY and REQUIRED arguments and set LTTNGUST_FOUND to
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_demo-tracef_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_demo-tracef_Makefile
index 09a33aa87229..5477f740a0e5 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_demo-tracef_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_demo-tracef_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/demo-tracef/Makefile.orig	2016-08-08 21:25:36 UTC
+--- doc/examples/demo-tracef/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/demo-tracef/Makefile
-@@ -15,12 +15,8 @@
+@@ -8,8 +8,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl -llttng-ust	# On Linux
 -#LIBS = -lc	# On BSD
 +#LIBS = -ldl -llttng-ust	# On Linux
 +LIBS = -llttng-ust	# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: demo-tracef
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_demo-tracelog_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_demo-tracelog_Makefile
index e5f97e40a1e9..def885883029 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_demo-tracelog_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_demo-tracelog_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/demo-tracelog/Makefile.orig	2016-08-25 21:53:05 UTC
+--- doc/examples/demo-tracelog/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/demo-tracelog/Makefile
-@@ -15,12 +15,8 @@
+@@ -8,8 +8,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl -llttng-ust	# On Linux
 -#LIBS = -lc	# On BSD
 +#LIBS = -ldl -llttng-ust	# On Linux
 +LIBS = -llttng-ust	# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: demo-tracelog
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_demo_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_demo_Makefile
index 26d3c0cb7982..e701c0297cf9 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_demo_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_demo_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/demo/Makefile.orig	2016-08-08 21:25:36 UTC
+--- doc/examples/demo/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/demo/Makefile
-@@ -14,12 +14,8 @@
+@@ -7,8 +7,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl	# On Linux
 -#LIBS = -lc	# On BSD
 +#LIBS = -ldl	# On Linux
 +LIBS =	# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: demo lttng-ust-provider-ust-tests-demo.so lttng-ust-provider-ust-tests-demo3.so
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_easy-ust_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_easy-ust_Makefile
index 7f31c15e2982..e9dc07e31ebd 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_easy-ust_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_easy-ust_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/easy-ust/Makefile.orig	2016-08-08 21:25:36 UTC
+--- doc/examples/easy-ust/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/easy-ust/Makefile
-@@ -16,12 +16,8 @@
+@@ -9,8 +9,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl -llttng-ust		# On Linux
 -#LIBS = -lc -llttng-ust		# On BSD
 +#LIBS = -ldl -llttng-ust		# On Linux
 +LIBS = -llttng-ust		# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: sample
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_gen-tp_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_gen-tp_Makefile
index eae93dc55eac..d6d81d5e7229 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_gen-tp_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_gen-tp_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/gen-tp/Makefile.orig	2016-08-08 21:25:36 UTC
+--- doc/examples/gen-tp/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/gen-tp/Makefile
-@@ -17,12 +17,8 @@
- #
- # This makefile is purposefully kept simple to support GNU and BSD make.
+@@ -12,8 +12,8 @@
+ 
+ PYTHON := python
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl -llttng-ust		#On Linux
 -#LIBS = -lc -llttng-ust		#On BSD
 +#LIBS = -ldl -llttng-ust		#On Linux
 +LIBS = -llttng-ust		#On FreeBSD
+ AM_V_P := :
  
  all: sample
- 
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_getcpu-override_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_getcpu-override_Makefile
index 4d0c99545eb3..ecf6ed9e150c 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_getcpu-override_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_getcpu-override_Makefile
@@ -1,17 +1,13 @@
---- doc/examples/getcpu-override/Makefile.orig	2016-08-25 21:53:05 UTC
+--- doc/examples/getcpu-override/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/getcpu-override/Makefile
-@@ -15,12 +15,8 @@
+@@ -8,8 +8,8 @@
  #
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
 -LIBS = -ldl	# On Linux
 -#LIBS = -lc	# On BSD
 +#LIBS = -ldl	# On Linux
 +LIBS =	# On FreeBSD
  LOCAL_CPPFLAGS += -I.
+ AM_V_P := :
  
- all: lttng-ust-getcpu-override-example.so
diff --git a/sysutils/lttng-ust/files/patch-doc_examples_hello-static-lib_Makefile b/sysutils/lttng-ust/files/patch-doc_examples_hello-static-lib_Makefile
index 92782b8b891a..1aee9af82724 100644
--- a/sysutils/lttng-ust/files/patch-doc_examples_hello-static-lib_Makefile
+++ b/sysutils/lttng-ust/files/patch-doc_examples_hello-static-lib_Makefile
@@ -1,18 +1,13 @@
---- doc/examples/hello-static-lib/Makefile.orig	2016-08-08 21:25:36 UTC
+--- doc/examples/hello-static-lib/Makefile.orig	2022-03-25 15:37:17 UTC
 +++ doc/examples/hello-static-lib/Makefile
-@@ -14,13 +14,9 @@
- #
+@@ -8,8 +8,8 @@
  # This makefile is purposefully kept simple to support GNU and BSD make.
  
--ifdef AM_CC
--	CC = $(AM_CC)
--endif
--
  LOCAL_CPPFLAGS += -I.
 -LIBS = -ldl -llttng-ust	# On Linux
 -#LIBS = -lc -llttng-ust	# On BSD
 +#LIBS = -ldl -llttng-ust	# On Linux
 +LIBS = -llttng-ust	# On FreeBSD
- 
- all: hello
+ AM_V_P := :
+ AR ?= ar
  
diff --git a/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3 b/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3
index 0190dcf9e117..9aa95c0a1350 100644
--- a/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3
+++ b/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3
@@ -1,38 +1,53 @@
---- doc/man/lttng-ust.3.orig	2016-11-29 22:13:51 UTC
+--- doc/man/lttng-ust.3.orig	2022-03-25 17:53:42 UTC
 +++ doc/man/lttng-ust.3
-@@ -88,7 +88,7 @@ lttng-ust \- LTTng user space tracing
- #define \fBtracepoint_enabled\fR(\fIprov_name\fR, \fIt_name\fR)
- .fi
- .sp
--Link with \fB-llttng-ust -ldl\fR, following this man page\&.
-+Link with \fB-llttng-ust\fR, following this man page\&.
- .SH "DESCRIPTION"
+@@ -2,12 +2,12 @@
+ .\"     Title: lttng-ust
+ .\"    Author: [see the "AUTHORS" section]
+ .\" Generator: DocBook XSL Stylesheets v1.79.1 <http://docbook.sf.net/>
+-.\"      Date: 03/25/2022
++.\"      Date: 04/07/2022
+ .\"    Manual: LTTng Manual
+ .\"    Source: LTTng 2.13.2
+ .\"  Language: English
+ .\"
+-.TH "LTTNG\-UST" "3" "03/25/2022" "LTTng 2\&.13\&.2" "LTTng Manual"
++.TH "LTTNG\-UST" "3" "04/07/2022" "LTTng 2\&.13\&.2" "LTTng Manual"
+ .\" -----------------------------------------------------------------
+ .\" * Define some portability stuff
+ .\" -----------------------------------------------------------------
+@@ -114,7 +114,7 @@ Link with, following this manual page:
+ .sp -1
+ .IP \(bu 2.3
+ .\}
+-\fB-llttng-ust -ldl\fR
++\fB-llttng-ust\fR
+ .RE
  .sp
- The \fILinux Trace Toolkit: next generation\fR <http://lttng.org/> is an open source software package used for correlated tracing of the Linux kernel, user applications, and user libraries\&.
-@@ -919,7 +919,7 @@ Then, link your application with this ob
+ .RS 4
+@@ -1066,7 +1066,7 @@ Then, link your application with this object file (or 
  .RS 4
  .\}
  .nf
--cc \-o app tp\&.o app\&.o \-llttng\-ust \-ldl
-+cc \-o app tp\&.o app\&.o \-llttng\-ust
+-$ cc \-o app tp\&.o app\&.o \-llttng\-ust \-ldl
++$ cc \-o app tp\&.o app\&.o \-llttng\-ust
  .fi
  .if n \{\
  .RE
-@@ -1004,7 +1004,7 @@ This tracepoint provider shared object i
+@@ -1151,7 +1151,7 @@ This tracepoint provider shared object isn\(cqt linked
  .RS 4
  .\}
  .nf
--cc \-o app app\&.o tp\-define\&.o \-ldl
-+cc \-o app app\&.o tp\-define\&.o
+-$ cc \-o app app\&.o tp\-define\&.o \-ldl
++$ cc \-o app app\&.o tp\-define\&.o
  .fi
  .if n \{\
  .RE
-@@ -1544,7 +1544,7 @@ You can compile the source files and lin
+@@ -1823,7 +1823,7 @@ You can compile the source files and link them togethe
  .nf
- cc \-c \-I\&. tp\&.c
- cc \-c app\&.c
--cc \-o app tp\&.o app\&.o \-llttng\-ust \-ldl
-+cc \-o app tp\&.o app\&.o \-llttng\-ust
+ $ cc \-c \-I\&. tp\&.c
+ $ cc \-c app\&.c
+-$ cc \-o app tp\&.o app\&.o \-llttng\-ust \-ldl
++$ cc \-o app tp\&.o app\&.o \-llttng\-ust
  .fi
  .if n \{\
  .RE
diff --git a/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3.txt b/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3.txt
index 2b86bdf93c4c..46dfe425ba35 100644
--- a/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3.txt
+++ b/sysutils/lttng-ust/files/patch-doc_man_lttng-ust.3.txt
@@ -1,38 +1,38 @@
---- doc/man/lttng-ust.3.txt.orig	2016-11-29 21:06:58 UTC
+--- doc/man/lttng-ust.3.txt.orig	2022-03-25 15:37:17 UTC
 +++ doc/man/lttng-ust.3.txt
-@@ -65,7 +65,7 @@ SYNOPSIS
- #define *tracepoint*('prov_name', 't_name', ...)
- #define *tracepoint_enabled*('prov_name', 't_name')
+@@ -83,7 +83,7 @@ SYNOPSIS
  
--Link with `-llttng-ust -ldl`, following this man page.
-+Link with `-llttng-ust`, following this man page.
+ Link with, following this manual page:
  
+-* `-llttng-ust -ldl`
++* `-llttng-ust`
+ * If you define `_LGPL_SOURCE` before including
+   `<lttng/tracepoint.h>` (directly or indirectly): `-llttng-ust-common`
  
- DESCRIPTION
-@@ -636,7 +636,7 @@ library containing it) and with `liblttn
+@@ -737,7 +737,7 @@ BSD system):
  
  [role="term"]
- -------------------------------------
--cc -o app tp.o app.o -llttng-ust -ldl
-+cc -o app tp.o app.o -llttng-ust
- -------------------------------------
+ ----
+-$ cc -o app tp.o app.o -llttng-ust -ldl
++$ cc -o app tp.o app.o -llttng-ust
+ ----
  
  
-@@ -696,7 +696,7 @@ libdl:
+@@ -797,7 +797,7 @@ libdl:
  
  [role="term"]
- --------------------------------
--cc -o app app.o tp-define.o -ldl
-+cc -o app app.o tp-define.o
- --------------------------------
+ ----
+-$ cc -o app app.o tp-define.o -ldl
++$ cc -o app app.o tp-define.o
+ ----
  
  There are two ways to dynamically load the tracepoint provider shared
-@@ -1036,7 +1036,7 @@ like this:
- -------------------------------------
- cc -c -I. tp.c
- cc -c app.c
--cc -o app tp.o app.o -llttng-ust -ldl
-+cc -o app tp.o app.o -llttng-ust
- -------------------------------------
+@@ -1221,7 +1221,7 @@ like this:
+ ----
+ $ cc -c -I. tp.c
+ $ cc -c app.c
+-$ cc -o app tp.o app.o -llttng-ust -ldl
++$ cc -o app tp.o app.o -llttng-ust
+ ----
  
  Using the man:lttng(1) tool, create an LTTng tracing session, enable
diff --git a/sysutils/lttng-ust/files/patch-include_lttng_ust-dlfcn.h b/sysutils/lttng-ust/files/patch-include_lttng_ust-dlfcn.h
deleted file mode 100644
index de559facee25..000000000000
--- a/sysutils/lttng-ust/files/patch-include_lttng_ust-dlfcn.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/lttng/ust-dlfcn.h.orig	2016-11-29 01:46:24 UTC
-+++ include/lttng/ust-dlfcn.h
-@@ -27,6 +27,8 @@
-  * SOFTWARE.
-  */
- 
-+typedef long Lmid_t;
-+
- #ifdef _DLFCN_H
- #error "Please include lttng/ust-dlfcn.h before dlfcn.h."
- #endif /* _DLFCN_H */
diff --git a/sysutils/lttng-ust/files/patch-include_lttng_ust-elf.h b/sysutils/lttng-ust/files/patch-include_lttng_ust-elf.h
deleted file mode 100644
index 340c9b461a32..000000000000
--- a/sysutils/lttng-ust/files/patch-include_lttng_ust-elf.h
+++ /dev/null
@@ -1,22 +0,0 @@
---- include/lttng/ust-elf.h.orig	2016-10-18 22:44:06 UTC
-+++ include/lttng/ust-elf.h
-@@ -21,7 +21,19 @@
- #include <stdlib.h>
- #include <stdint.h>
- #include <stdio.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 <elf.h>
- #include <lttng/ust-endian.h>
- 
diff --git a/sysutils/lttng-ust/files/patch-include_lttng_ust-tracepoint-event.h b/sysutils/lttng-ust/files/patch-include_lttng_ust-tracepoint-event.h
index b3f7287b41bd..450ab3427e15 100644
--- a/sysutils/lttng-ust/files/patch-include_lttng_ust-tracepoint-event.h
+++ b/sysutils/lttng-ust/files/patch-include_lttng_ust-tracepoint-event.h
@@ -1,30 +1,22 @@
---- include/lttng/ust-tracepoint-event.h.orig	2016-11-29 01:46:24 UTC
+--- include/lttng/ust-tracepoint-event.h.orig	2022-03-25 15:37:17 UTC
 +++ include/lttng/ust-tracepoint-event.h
-@@ -28,7 +28,19 @@
- #include <lttng/ringbuffer-config.h>
+@@ -14,6 +14,11 @@
+ #include <lttng/ust-arch.h>
  #include <lttng/ust-compiler.h>
  #include <lttng/tracepoint.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 <lttng/ust-endian.h>
+ #include <lttng/ust-api-compat.h>
  #include <string.h>
+@@ -1033,6 +1038,7 @@ void lttng_ust__event_probe__##_provider##___##_name(L
  
- #define __LTTNG_UST_NULL_STRING	"(null)"
-@@ -941,6 +950,7 @@ static const struct lttng_event_desc __e
- 
- /* Reset all macros within TRACEPOINT_EVENT */
+ /* Reset all macros within LTTNG_UST_TRACEPOINT_EVENT */
  #include <lttng/ust-tracepoint-event-reset.h>
 +#include <lttng/ust-events.h>
  
- #undef TRACEPOINT_EVENT_INSTANCE
- #define TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args)	       \
+ /*
+  * Declare _loglevel___##__provider##___##__name as non-static, with
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.am b/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.am
deleted file mode 100644
index 98fc9f1e3c00..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.am
+++ /dev/null
@@ -1,9 +0,0 @@
---- liblttng-ust-ctl/Makefile.am.orig	2017-01-31 12:55:37 UTC
-+++ liblttng-ust-ctl/Makefile.am
-@@ -10,5 +10,4 @@ liblttng_ust_ctl_la_LDFLAGS = \
- liblttng_ust_ctl_la_LIBADD = \
- 	$(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \
- 	$(top_builddir)/liblttng-ust/liblttng-ust-support.la \
--	$(top_builddir)/snprintf/libustsnprintf.la \
--	-ldl
-+	$(top_builddir)/snprintf/libustsnprintf.la
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.in b/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.in
deleted file mode 100644
index 0f9d83ffe991..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_Makefile.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- liblttng-ust-ctl/Makefile.in.orig	2016-11-29 22:25:14 UTC
-+++ liblttng-ust-ctl/Makefile.in
-@@ -375,8 +375,7 @@ liblttng_ust_ctl_la_LIBADD = \
- 	$(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \
- 	$(top_builddir)/liblttng-ust/liblttng-ust-support.la \
--	$(top_builddir)/snprintf/libustsnprintf.la \
--	-ldl
-+	$(top_builddir)/snprintf/libustsnprintf.la
- 
- all: all-am
-
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_ustctl.c b/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_ustctl.c
deleted file mode 100644
index e1f11765df7f..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust-ctl_ustctl.c
+++ /dev/null
@@ -1,31 +0,0 @@
---- 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)
- {
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust-dl_ust__dl.h b/sysutils/lttng-ust/files/patch-liblttng-ust-dl_ust__dl.h
deleted file mode 100644
index 5b60591704df..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust-dl_ust__dl.h
+++ /dev/null
@@ -1,10 +0,0 @@
---- liblttng-ust-dl/ust_dl.h.orig	2016-11-29 01:46:24 UTC
-+++ liblttng-ust-dl/ust_dl.h
-@@ -36,6 +36,7 @@ extern "C" {
- 
- #define LTTNG_UST_DL_PROVIDER
- #include <lttng/tracepoint.h>
-+#include <lttng/ust-dlfcn.h>
- 
- TRACEPOINT_EVENT(lttng_ust_dl, dlopen,
- 	TP_ARGS(void *, ip, void *, baddr, const char *, path,
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust-fd_lttng-ust-fd.c b/sysutils/lttng-ust/files/patch-liblttng-ust-fd_lttng-ust-fd.c
deleted file mode 100644
index b86296cb1067..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust-fd_lttng-ust-fd.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- liblttng-ust-fd/lttng-ust-fd.c.orig	2016-11-29 01:46:24 UTC
-+++ liblttng-ust-fd/lttng-ust-fd.c
-@@ -28,7 +28,7 @@
- #include <helper.h>
- #include "usterr-signal-safe.h"
- 
--volatile enum ust_loglevel ust_loglevel;
-+extern volatile enum ust_loglevel ust_loglevel;
- 
- static int (*__lttng_ust_fd_plibc_close)(int fd);
- 
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.am b/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.am
deleted file mode 100644
index 6cf9ff57a759..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.am
+++ /dev/null
@@ -1,10 +0,0 @@
---- liblttng-ust/Makefile.am.orig	2016-11-29 01:46:24 UTC
-+++ liblttng-ust/Makefile.am
-@@ -89,8 +89,7 @@ liblttng_ust_la_LIBADD = \
- 	-lpthread \
- 	-lrt \
- 	-lurcu-cds \
--	-ldl \
- 	$(top_builddir)/snprintf/libustsnprintf.la \
- 	$(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \
- 	liblttng-ust-tracepoint.la \
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.in b/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.in
deleted file mode 100644
index 2323663fb102..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust_Makefile.in
+++ /dev/null
@@ -1,10 +0,0 @@
---- liblttng-ust/Makefile.in.orig	2016-11-29 22:25:14 UTC
-+++ liblttng-ust/Makefile.in
-@@ -482,8 +482,7 @@ liblttng_ust_la_LIBADD = \
- 	-lpthread \
- 	-lrt \
- 	-lurcu-cds \
--	-ldl \
- 	$(top_builddir)/snprintf/libustsnprintf.la \
- 	$(top_builddir)/liblttng-ust-comm/liblttng-ust-comm.la \
- 	liblttng-ust-tracepoint.la \
diff --git a/sysutils/lttng-ust/files/patch-liblttng-ust_compat.h b/sysutils/lttng-ust/files/patch-liblttng-ust_compat.h
deleted file mode 100644
index 6ccb5caa2d44..000000000000
--- a/sysutils/lttng-ust/files/patch-liblttng-ust_compat.h
+++ /dev/null
@@ -1,20 +0,0 @@
---- liblttng-ust/compat.h.orig	2016-11-29 01:46:24 UTC
-+++ liblttng-ust/compat.h
-@@ -73,9 +73,15 @@ void lttng_ust_getprocname(char *name)
- }
- 
- /*
-- * If pthread_set_name_np is available.
-+ * If pthread_setname_np or pthread_set_name_np is available.
-  */
--#ifdef HAVE_PTHREAD_SET_NAME_NP
-+#ifdef HAVE_PTHREAD_SETNAME_NP
-+static inline
-+int lttng_pthread_setname_np(pthread_t thread, const char *name)
-+{
-+	return pthread_setname_np(thread, name);
-+}
-+#elif defined(HAVE_PTHREAD_SET_NAME_NP)
- static inline
- int lttng_pthread_setname_np(pthread_t thread, const char *name)
- {
diff --git a/sysutils/lttng-ust/files/patch-lttng-ust.pc.in b/sysutils/lttng-ust/files/patch-lttng-ust.pc.in
deleted file mode 100644
index a38fb23bb39b..000000000000
--- a/sysutils/lttng-ust/files/patch-lttng-ust.pc.in
+++ /dev/null
@@ -1,10 +0,0 @@
---- lttng-ust.pc.in.orig	2015-06-01 11:38:44 UTC
-+++ lttng-ust.pc.in
-@@ -8,6 +8,6 @@ Description: The LTTng Userspace Tracer 
- Version: @PACKAGE_VERSION@
- Requires:
- Requires.private: liburcu-bp
--Libs: -L${libdir} -llttng-ust -ldl
-+Libs: -L${libdir} -llttng-ust
- Cflags: -I${includedir} 
- 
diff --git a/sysutils/lttng-ust/files/patch-m4_libtool.m4 b/sysutils/lttng-ust/files/patch-m4_libtool.m4
new file mode 100644
index 000000000000..2a4d34238b24
--- /dev/null
+++ b/sysutils/lttng-ust/files/patch-m4_libtool.m4
@@ -0,0 +1,157 @@
+--- m4/libtool.m4.orig	2022-03-25 17:46:41 UTC
++++ m4/libtool.m4
+@@ -728,6 +728,7 @@ _LT_CONFIG_SAVE_COMMANDS([
+     cat <<_LT_EOF >> "$cfgfile"
+ #! $SHELL
+ # Generated automatically by $as_me ($PACKAGE) $VERSION
++# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+ # NOTE: Changes made to this file will be lost: look at ltmain.sh.
+ 
+ # Provide generalized library-building support services.
+@@ -2886,18 +2887,6 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+   dynamic_linker='GNU/Linux ld.so'
+   ;;
+ 
+-netbsdelf*-gnu)
+-  version_type=linux
+-  need_lib_prefix=no
+-  need_version=no
+-  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+-  soname_spec='${libname}${release}${shared_ext}$major'
+-  shlibpath_var=LD_LIBRARY_PATH
+-  shlibpath_overrides_runpath=no
+-  hardcode_into_libs=yes
+-  dynamic_linker='NetBSD ld.elf_so'
+-  ;;
+-
+ netbsd*)
+   version_type=sunos
+   need_lib_prefix=no
+@@ -3557,7 +3546,7 @@ linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+   lt_cv_deplibs_check_method=pass_all
+   ;;
+ 
+-netbsd* | netbsdelf*-gnu)
++netbsd*)
+   if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+     lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+   else
+@@ -4063,8 +4052,7 @@ _LT_EOF
+   if AC_TRY_EVAL(ac_compile); then
+     # Now try to grab the symbols.
+     nlist=conftest.nm
+-    $ECHO "$as_me:$LINENO: $NM conftest.$ac_objext | $lt_cv_sys_global_symbol_pipe > $nlist" >&AS_MESSAGE_LOG_FD
+-    if eval "$NM" conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist 2>&AS_MESSAGE_LOG_FD && test -s "$nlist"; then
++    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+       # Try sorting and uniquifying the output.
+       if sort "$nlist" | uniq > "$nlist"T; then
+ 	mv -f "$nlist"T "$nlist"
+@@ -4436,7 +4424,7 @@ m4_if([$1], [CXX], [
+ 	    ;;
+ 	esac
+ 	;;
+-      netbsd* | netbsdelf*-gnu)
++      netbsd*)
+ 	;;
+       *qnx* | *nto*)
+         # QNX uses GNU C++, but need to define -shared option too, otherwise
+@@ -4948,9 +4936,6 @@ m4_if([$1], [CXX], [
+       ;;
+     esac
+     ;;
+-  linux* | k*bsd*-gnu | gnu*)
+-    _LT_TAGVAR(link_all_deplibs, $1)=no
+-    ;;
+   *)
+     _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+     ;;
+@@ -5013,9 +4998,6 @@ dnl Note also adjust exclude_expsyms for C++ above.
+   openbsd* | bitrig*)
+     with_gnu_ld=no
+     ;;
+-  linux* | k*bsd*-gnu | gnu*)
+-    _LT_TAGVAR(link_all_deplibs, $1)=no
+-    ;;
+   esac
+ 
+   _LT_TAGVAR(ld_shlibs, $1)=yes
+@@ -5270,7 +5252,7 @@ _LT_EOF
+       fi
+       ;;
+ 
+-    netbsd* | netbsdelf*-gnu)
++    netbsd*)
+       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+ 	wlarc=
+@@ -5791,7 +5773,6 @@ _LT_EOF
+ 	if test yes = "$lt_cv_irix_exported_symbol"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
+ 	fi
+-	_LT_TAGVAR(link_all_deplibs, $1)=no
+       else
+ 	_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ 	_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
+@@ -5813,7 +5794,7 @@ _LT_EOF
+       esac
+       ;;
+ 
+-    netbsd* | netbsdelf*-gnu)
++    netbsd*)
+       if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+ 	_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+       else
+@@ -6439,7 +6420,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+       # Commands to make compiler produce verbose output that lists
+       # what "hidden" libraries, object files and flags are used when
+       # linking a shared library.
+-      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
++      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 
+     else
+       GXX=no
+@@ -6814,7 +6795,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+             # explicitly linking system object files so we need to strip them
+             # from the output so that they don't get included in the library
+             # dependencies.
+-            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
++            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+             ;;
+           *)
+             if test yes = "$GXX"; then
+@@ -6879,7 +6860,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+ 	    # explicitly linking system object files so we need to strip them
+ 	    # from the output so that they don't get included in the library
+ 	    # dependencies.
+-	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP " \-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
++	    output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ 	    ;;
+           *)
+ 	    if test yes = "$GXX"; then
+@@ -7218,7 +7199,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+ 	      # Commands to make compiler produce verbose output that lists
+ 	      # what "hidden" libraries, object files and flags are used when
+ 	      # linking a shared library.
+-	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
++	      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 
+ 	    else
+ 	      # FIXME: insert proper C++ library support
+@@ -7302,7 +7283,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+ 	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
++	        output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 	      else
+ 	        # g++ 2.7 appears to require '-G' NOT '-shared' on this
+ 	        # platform.
+@@ -7313,7 +7294,7 @@ if test yes != "$_lt_caught_CXX_error"; then
+ 	        # Commands to make compiler produce verbose output that lists
+ 	        # what "hidden" libraries, object files and flags are used when
+ 	        # linking a shared library.
+-	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP " \-L"'
++	        output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+ 	      fi
+ 
+ 	      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
diff --git a/sysutils/lttng-ust/files/patch-src_common_compat_dlfcn.h b/sysutils/lttng-ust/files/patch-src_common_compat_dlfcn.h
new file mode 100644
index 000000000000..e537fea2d4f5
--- /dev/null
+++ b/sysutils/lttng-ust/files/patch-src_common_compat_dlfcn.h
@@ -0,0 +1,11 @@
+--- src/common/compat/dlfcn.h.orig	2022-03-25 15:37:17 UTC
++++ src/common/compat/dlfcn.h
+@@ -9,6 +9,8 @@
+ #ifndef _UST_COMMON_COMPAT_DLFCN_H
+ #define _UST_COMMON_COMPAT_DLFCN_H
+ 
++typedef long Lmid_t;
++
+ #ifdef _DLFCN_H
+ #error "Please include compat/dlfcn.h before dlfcn.h."
+ #endif /* _DLFCN_H */
diff --git a/sysutils/lttng-ust/files/patch-src_common_elf.h b/sysutils/lttng-ust/files/patch-src_common_elf.h
new file mode 100644
index 000000000000..09ddb735a196
--- /dev/null
+++ b/sysutils/lttng-ust/files/patch-src_common_elf.h
@@ -0,0 +1,14 @@
+--- src/common/elf.h.orig	2022-03-25 15:37:17 UTC
++++ src/common/elf.h
+@@ -10,6 +10,11 @@
+ #include <stdlib.h>
+ #include <stdint.h>
+ #include <stdio.h>
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/endian.h>
++#define NT_GNU_BUILD_ID 3
++#endif
+ #include <elf.h>
+ 
+ #include <lttng/ust-endian.h>
diff --git a/sysutils/lttng-ust/files/patch-src_lib_lttng-ust-ctl_ustctl.c b/sysutils/lttng-ust/files/patch-src_lib_lttng-ust-ctl_ustctl.c
new file mode 100644
index 000000000000..c5fd70e2cc6c
--- /dev/null
+++ b/sysutils/lttng-ust/files/patch-src_lib_lttng-ust-ctl_ustctl.c
@@ -0,0 +1,14 @@
+--- src/lib/lttng-ust-ctl/ustctl.c.orig	2022-03-25 15:37:22 UTC
++++ src/lib/lttng-ust-ctl/ustctl.c
+@@ -8,6 +8,11 @@
+ #include <stdint.h>
+ #include <string.h>
+ #include <sys/mman.h>
++#if defined(__FreeBSD__)
++#include <sys/types.h>
++#include <sys/endian.h>
++#define NT_GNU_BUILD_ID 3
*** 185 LINES SKIPPED ***