diff --git a/packages/thapi/fix-lttng-array-types.patch b/packages/thapi/fix-lttng-array-types.patch new file mode 100644 index 0000000..1e5ec7f --- /dev/null +++ b/packages/thapi/fix-lttng-array-types.patch @@ -0,0 +1,43 @@ +From fe0402c8c6b74504468ed6a788bf80464bfef62a Mon Sep 17 00:00:00 2001 +From: Brice Videau +Date: Mon, 1 Jul 2024 14:50:38 -0500 +Subject: [PATCH] Fix LTTng array size types. + +--- + utils/meta_parameters.rb | 2 +- + utils/yaml_ast_lttng.rb | 2 ++ + 2 files changed, 3 insertions(+), 1 deletion(-) + +diff --git a/utils/meta_parameters.rb b/utils/meta_parameters.rb +index d0c217ed..2c3be8c7 100644 +--- a/utils/meta_parameters.rb ++++ b/utils/meta_parameters.rb +@@ -217,7 +217,7 @@ def initialize(command, name, size) + size = "*#{size}" + size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type.type}"] + sz = sanitize_expression("#{size}", checks) +- st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type}" ++ st = INT_SIGN_MAP["#{s.type.type}"] ? "size_t" : "#{s.type.type}" + else + checks = check_for_null("#{name}") + size = "(#{size} < 0 ? 0 : (size_t)#{size})" if INT_SIGN_MAP["#{s.type}"] +diff --git a/utils/yaml_ast_lttng.rb b/utils/yaml_ast_lttng.rb +index acce44aa..6016dabc 100644 +--- a/utils/yaml_ast_lttng.rb ++++ b/utils/yaml_ast_lttng.rb +@@ -184,6 +184,7 @@ def lttng_type(length: nil, length_type: nil) + ev.type = :uint8_t + if ev.length + ev.length = "(#{ev.length}) * sizeof(uint8_t)" ++ ev.length_type = "size_t" + end + when *OBJECT_TYPES, *POINTER_TYPES + ev.macro = :"ctf_#{lttng_arr_type}_hex" +@@ -202,6 +203,7 @@ def lttng_type(length: nil, length_type: nil) + ev.type = :uint8_t + if ev.length + ev.length = "(#{ev.length}) * sizeof(#{type.name})" ++ ev.length_type = "size_t" + end + else + super diff --git a/packages/thapi/package.py b/packages/thapi/package.py index 543cf7b..67e6d64 100644 --- a/packages/thapi/package.py +++ b/packages/thapi/package.py @@ -53,6 +53,8 @@ class Thapi(AutotoolsPackage): variant('strict', default=False, description='Enable -Werror during the build') variant('mpi', default=False, description='Enable MPI support for the Sync Daemon') + + patch('fix-lttng-array-types.patch', when='@0.0.8:0.0.11') def configure_args(self): args = [] args.extend(self.enable_or_disable('mpi'))