summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--2383.patch68
-rw-r--r--php-pecl-datadog-trace.spec14
2 files changed, 77 insertions, 5 deletions
diff --git a/2383.patch b/2383.patch
new file mode 100644
index 0000000..04716bd
--- /dev/null
+++ b/2383.patch
@@ -0,0 +1,68 @@
+From e1db8a922682e3979cb6a67e1af0a778a921c5d0 Mon Sep 17 00:00:00 2001
+From: Gustavo Lopes <mail@geleia.net>
+Date: Tue, 21 Nov 2023 17:39:48 +0000
+Subject: [PATCH] Use global-dynamic for tsrm cache
+
+---
+ ext/ddtrace.h | 6 +++---
+ ext/handlers_api.h | 6 +++---
+ zend_abstract_interface/tsrmls_cache.h | 6 +++---
+ 3 files changed, 9 insertions(+), 9 deletions(-)
+
+diff --git a/ext/ddtrace.h b/ext/ddtrace.h
+index d7072328f9..6322ac78e1 100644
+--- a/ext/ddtrace.h
++++ b/ext/ddtrace.h
+@@ -108,11 +108,11 @@ ZEND_END_MODULE_GLOBALS(ddtrace)
+
+ #ifdef ZTS
+ # if defined(__has_attribute) && __has_attribute(tls_model)
+-# define ATTR_TLS_LOCAL_DYNAMIC __attribute__((tls_model("local-dynamic")))
++# define ATTR_TLS_GLOBAL_DYNAMIC __attribute__((tls_model("global-dynamic")))
+ # else
+-# define ATTR_TLS_LOCAL_DYNAMIC
++# define ATTR_TLS_GLOBAL_DYNAMIC
+ # endif
+-extern __thread void *ATTR_TLS_LOCAL_DYNAMIC TSRMLS_CACHE;
++extern __thread void *ATTR_TLS_GLOBAL_DYNAMIC TSRMLS_CACHE;
+ # define DDTRACE_G(v) TSRMG(ddtrace_globals_id, zend_ddtrace_globals *, v)
+ #else
+ # define DDTRACE_G(v) (ddtrace_globals.v)
+diff --git a/ext/handlers_api.h b/ext/handlers_api.h
+index 353183bef1..bdd73e7559 100644
+--- a/ext/handlers_api.h
++++ b/ext/handlers_api.h
+@@ -8,12 +8,12 @@
+ #if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80101 && defined(ZTS)
+
+ # if defined(__has_attribute) && __has_attribute(tls_model)
+-# define ATTR_TLS_LOCAL_DYNAMIC __attribute__((tls_model("local-dynamic")))
++# define ATTR_TLS_GLOBAL_DYNAMIC __attribute__((tls_model("global-dynamic")))
+ # else
+-# define ATTR_TLS_LOCAL_DYNAMIC
++# define ATTR_TLS_GLOBAL_DYNAMIC
+ # endif
+
+-extern __thread void *ATTR_TLS_LOCAL_DYNAMIC TSRMLS_CACHE;
++extern __thread void *ATTR_TLS_GLOBAL_DYNAMIC TSRMLS_CACHE;
+ #endif
+
+ typedef struct datadog_php_zif_handler_s {
+diff --git a/zend_abstract_interface/tsrmls_cache.h b/zend_abstract_interface/tsrmls_cache.h
+index a703909f58..2d86e89d62 100644
+--- a/zend_abstract_interface/tsrmls_cache.h
++++ b/zend_abstract_interface/tsrmls_cache.h
+@@ -5,10 +5,10 @@
+ #if PHP_VERSION_ID >= 80000 && PHP_VERSION_ID < 80101 && defined(ZTS)
+
+ # if defined(__has_attribute) && __has_attribute(tls_model)
+-# define ATTR_TLS_LOCAL_DYNAMIC __attribute__((tls_model("local-dynamic")))
++# define ATTR_TLS_GLOBAL_DYNAMIC __attribute__((tls_model("global-dynamic")))
+ # else
+-# define ATTR_TLS_LOCAL_DYNAMIC
++# define ATTR_TLS_GLOBAL_DYNAMIC
+ # endif
+
+-extern __thread void *ATTR_TLS_LOCAL_DYNAMIC TSRMLS_CACHE;
++extern __thread void *ATTR_TLS_GLOBAL_DYNAMIC TSRMLS_CACHE;
+ #endif
diff --git a/php-pecl-datadog-trace.spec b/php-pecl-datadog-trace.spec
index 5432e3a..3d5f086 100644
--- a/php-pecl-datadog-trace.spec
+++ b/php-pecl-datadog-trace.spec
@@ -36,7 +36,7 @@
Summary: APM and distributed tracing for PHP
Name: %{?scl_prefix}php-pecl-datadog-trace
Version: 0.94.0
-Release: 1%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
+Release: 2%{?dist}%{!?scl:%{!?nophptag:%(%{__php} -r 'echo ".".PHP_MAJOR_VERSION.".".PHP_MINOR_VERSION;')}}
# extension is dual-licensed under Apache 2.0 or BSD3.
# bundled rust ext are MIT AND Apache-2.0
License: (Apache-2.0 OR BSD-3-Clause) AND MIT AND Apache-2.0
@@ -46,6 +46,8 @@ Source0: https://pecl.php.net/get/%{proj_name}-%{version}.tgz
Source1: makedeps.sh
Source2: %{proj_name}-deps-%{version}.tgz
+Patch0: https://patch-diff.githubusercontent.com/raw/DataDog/dd-trace-php/pull/2383.patch
+
# ddtrace only supports 64-bit platforms
ExcludeArch: %{ix86} %{arm}
@@ -101,6 +103,8 @@ sed -e 's/role="test"/role="src"/' \
-i package.xml
cd %{sources}
+%patch -P0 -p1
+
: PEAR installer stuff
sed -e 's:@php_dir@:%{pear_phpdir}:' \
-e 's:_BUILD_FROM_PECL_:1:' \
@@ -158,10 +162,6 @@ EOF
%build
-# Disable LTO
-# https://github.com/DataDog/dd-trace-php/issues/2376
-%define _lto_cflags %{nil}
-
%{?dtsenable}
%if 0%{?scl:1}
source /opt/%{scl_vendor}/%{scl}/enable
@@ -215,6 +215,7 @@ done
%check
cd %{sources}
export DD_TRACE_CLI_ENABLED=1
+export DD_INSTRUMENTATION_TELEMETRY_ENABLED=0
# Erratic results
rm tests/ext/segfault_backtrace_*.phpt
@@ -301,6 +302,9 @@ fi
%changelog
+* Thu Nov 23 2023 Remi Collet <remi@remirepo.net> - 0.94.0-2
+- test build for https://github.com/DataDog/dd-trace-php/pull/2383
+
* Tue Nov 21 2023 Remi Collet <remi@remirepo.net> - 0.94.0-1
- update to 0.94.0
- open https://github.com/DataDog/dd-trace-php/issues/2376 LTO build failure