Skip to content

Commit b6a70af

Browse files
committed
chmod +x ddtrace.so
1 parent 57936b0 commit b6a70af

File tree

5 files changed

+13
-3
lines changed

5 files changed

+13
-3
lines changed

.gitlab/build-tracing.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ fi
3131
switch-php "${PHP_VERSION}"
3232
make clean && make -j "${MAKE_JOBS}" static
3333
objcopy --compress-debug-sections tmp/build_extension/modules/ddtrace.so "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}.so"
34+
chmod +x "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}.so"
3435
cp -v tmp/build_extension/modules/ddtrace.a "extensions_$(uname -m)/ddtrace-${PHP_API}${suffix}.a"
3536
if [ "${PHP_VERSION}" = "7.0" ]; then
3637
cp -v tmp/build_extension/ddtrace.ldflags "ddtrace_$(uname -m)${suffix}.ldflags"
@@ -41,6 +42,7 @@ if [ "${suffix}" != "-alpine" ]; then
4142
switch-php "${PHP_VERSION}-debug"
4243
make clean && make -j "${MAKE_JOBS}" static
4344
objcopy --compress-debug-sections tmp/build_extension/modules/ddtrace.so "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}-debug.so"
45+
chmod +x "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}-debug.so"
4446
cp -v tmp/build_extension/modules/ddtrace.a "extensions_$(uname -m)/ddtrace-${PHP_API}${suffix}-debug.a"
4547
fi
4648

@@ -49,4 +51,5 @@ switch-php "${PHP_VERSION}-zts"
4951
rm -r tmp/build_extension
5052
make clean && make -j "${MAKE_JOBS}" static
5153
objcopy --compress-debug-sections tmp/build_extension/modules/ddtrace.so "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}-zts.so"
54+
chmod +x "standalone_$(uname -m)/ddtrace-${PHP_API}${suffix}-zts.so"
5255
cp -v tmp/build_extension/modules/ddtrace.a "extensions_$(uname -m)/ddtrace-${PHP_API}${suffix}-zts.a"

.gitlab/link-tracing-extension.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ for archive in extensions_$(uname -m)/*.a; do
99
(
1010
cc -shared -Wl,-whole-archive $archive -Wl,-no-whole-archive $(cat "ddtrace_$(uname -m)${suffix}.ldflags") "libddtrace_php_$(uname -m)${suffix}.a" -Wl,-soname -Wl,ddtrace.so -o ${archive%.a}.so
1111
objcopy --compress-debug-sections ${archive%.a}.so
12+
chmod +x ${archive%.a}.so
1213
) &
1314
pids+=($!)
1415
done

Cargo.lock

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

config.m4

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -290,6 +290,11 @@ if test "$PHP_DDTRACE" != "no"; then
290290
case $host_os in
291291
linux*)
292292
EXTRA_LDFLAGS="$EXTRA_LDFLAGS -Wl,-e,_dd_solib_start"
293+
dnl ExecSolib requires execute permission; PHP's make install defaults to
294+
dnl INSTALL_DATA = install -m 644. Override to 0755 so execve() works.
295+
cat <<'EOT' >> Makefile.fragments
296+
INSTALL_DATA = $(INSTALL) -m 0755
297+
EOT
293298
;;
294299
esac
295300

datadog-setup.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -956,9 +956,9 @@ function safe_copy_extension($source, $destination)
956956

957957
$tmpName = $destination . '.tmp';
958958
copy($source, $tmpName);
959-
// Preserve execute permission from source: required for ExecSolib (the kernel
960-
// execve's ddtrace.so directly to spawn the sidecar).
961-
if (!IS_WINDOWS && is_executable($source)) {
959+
// Add execute permission: required for ExecSolib (the kernel execve's ddtrace.so
960+
// directly to spawn the sidecar). Safe to apply unconditionally to .so files.
961+
if (!IS_WINDOWS) {
962962
chmod($tmpName, fileperms($tmpName) | 0111);
963963
}
964964
rename($tmpName, $destination);

0 commit comments

Comments
 (0)