From 635553bfcfdb33c337ece558240de3692920ca95 Mon Sep 17 00:00:00 2001 From: Ryan Zezeski Date: Sat, 7 Dec 2013 13:58:46 -0500 Subject: Fix DTrace build on Illumos DTrace was recently patched in Illumos to fail to create an object file if no probes are found. * https://www.illumos.org/issues/4248 * https://github.com/illumos/illumos-gate/commit/54a20ab41aadcb81c53e72fc65886e964e9add59 This patch fixes two issues: * Modify the configure script to pass an object file to `dtrace -G` that actually invokes a probe. * Remove creation of `dtrace_user.o` from the dyntrace Makefile. In a previous commit [1] Scott Fritchie relocated all the user probes into the VM proper due to difficulties with DTrace probes in shared libraries. The `dtrace_user.d` file is now empty and generates a header file with nothing in it. There is no longer any reason to generate `dtrace_user.o` because all the probes are in the VM. Thus all the steps for building `dtrace_user.o` have been removed. [1]: https://github.com/erlang/otp/commit/75552bd3bb4e7f3cf4dab81a5c81cf73b1d3fb99 --- erts/configure.in | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'erts') diff --git a/erts/configure.in b/erts/configure.in index ba80fdbbbe..4edf1883cd 100644 --- a/erts/configure.in +++ b/erts/configure.in @@ -3804,10 +3804,16 @@ if test "$enable_dtrace_test" = "yes" ; then if ! dtrace -h $DTRACE_CPP -Iemulator/beam -o ./foo-dtrace.h -s emulator/beam/erlang_dtrace.d; then AC_MSG_ERROR([Could not precompile erlang_dtrace.d: dtrace -h failed]) fi - rm -f foo-dtrace.h + + $RM -f dtest.{o,c} + cat > dtest.c <<_DTEST + #include "foo-dtrace.h" + int main(void) { ERLANG_DIST_PORT_BUSY_ENABLED(); return 0; } +_DTEST + $CC $CFLAGS -c -o dtest.o dtest.c $RM -f $DTRACE_2STEP_TEST - if dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d 2> /dev/null && \ + if dtrace -G $DTRACE_CPP $DTRACE_BITS_FLAG -Iemulator/beam -o $DTRACE_2STEP_TEST -s emulator/beam/erlang_dtrace.d dtest.o && \ test -f $DTRACE_2STEP_TEST ; then rm $DTRACE_2STEP_TEST DTRACE_ENABLED_2STEP=yes @@ -3815,6 +3821,8 @@ if test "$enable_dtrace_test" = "yes" ; then else AC_MSG_NOTICE([dtrace precompilation for 1-stage DTrace successful]) fi + $RM -f dtest.{o,c} foo-dtrace.h + DTRACE_ENABLED=yes case $OPSYS in linux) -- cgit v1.2.3