8046818: Hotspot build system looking for sdt.h in the wrong place
authormikael
Thu, 03 Jul 2014 09:16:56 -0700
changeset 25471 3ab9867d7786
parent 25470 4e69740b1547
child 25472 381638db28e6
8046818: Hotspot build system looking for sdt.h in the wrong place Reviewed-by: sla, dholmes
hotspot/make/linux/makefiles/dtrace.make
--- a/hotspot/make/linux/makefiles/dtrace.make	Thu Jul 03 10:25:42 2014 -0400
+++ b/hotspot/make/linux/makefiles/dtrace.make	Thu Jul 03 09:16:56 2014 -0700
@@ -40,7 +40,14 @@
 ifneq ($(ALT_SDT_H),)
   SDT_H_FILE = $(ALT_SDT_H)
 else
-  SDT_H_FILE = /usr/include/sys/sdt.h
+  ifeq ($(USE_CLANG), true)
+    # Clang doesn't support the -print-sysroot option and there is no known equivalent
+    # option, so fall back to using / as sysroot
+    SDT_SYSROOT=
+  else
+    SDT_SYSROOT=$(shell $(CXX) -print-sysroot)
+  endif
+  SDT_H_FILE = $(SDT_SYSROOT)/usr/include/sys/sdt.h
 endif
 
 DTRACE_ENABLED = $(shell test -f $(SDT_H_FILE) && echo $(SDT_H_FILE))