make/solaris/makefiles/dtrace.make

Print this page




  84 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
  85 else
  86 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
  87 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
  88 endif
  89 
  90 ISA = $(subst i386,i486,$(shell isainfo -n))
  91 
  92 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
  93 ifneq ("${ISA}","${BUILDARCH}")
  94 
  95 XLIBJVM_DIR = 64
  96 XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
  97 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
  98 
  99 XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
 100 XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
 101 XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
 102 XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
 103 
 104 $(XLIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
 105         @echo $(LOG_INFO) Making $@
 106         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 107         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
 108                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 109 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 110 # gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set.
 111 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 112 # An empty section header has sh_addr == 0 and sh_size == 0.
 113 # This problem has only been seen on Solaris X64, but we call this tool
 114 # on all Solaris builds just in case.
 115         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 116         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)
 117 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 118 # Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available.
 119 #         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) ;
 120 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 121 # in the link name:
 122         ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
 123   ifeq ($(STRIP_POLICY),all_strip)
 124         $(QUIETLY) $(STRIP) $@
 125   else
 126     ifeq ($(STRIP_POLICY),min_strip)
 127         $(QUIETLY) $(STRIP) -x $@
 128     # implied else here is no stripping at all
 129     endif
 130   endif
 131   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 132 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 133 # in the archived name:
 134         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
 135         $(RM) $(XLIBJVM_DB_DEBUGINFO)
 136   endif
 137 endif
 138 
 139 $(XLIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 140         @echo $(LOG_INFO) Making $@
 141         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 142         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
 143                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 144 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 145 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 146         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 147         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)
 148 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 149 #         $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) ;
 150 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 151 # in the link name:
 152         ( cd $(XLIBJVM_DIR) && $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
 153   ifeq ($(STRIP_POLICY),all_strip)
 154         $(QUIETLY) $(STRIP) $@
 155   else
 156     ifeq ($(STRIP_POLICY),min_strip)
 157         $(QUIETLY) $(STRIP) -x $@
 158     # implied else here is no stripping at all
 159     endif
 160   endif
 161   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 162 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 163 # in the archived name:
 164         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO))
 165         $(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
 166   endif
 167 endif
 168 
 169 endif # ifneq ("${ISA}","${BUILDARCH}")
 170 
 171 ifdef USE_GCC
 172 LFLAGS_GENOFFS += -D_REENTRANT


 189         0) rm -f $@.tmp;; \
 190         *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
 191         esac
 192 
 193 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
 194 $(JVMOFFS).h: $(GENOFFS)
 195         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
 196         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 197 
 198 $(JVMOFFS)Index.h: $(GENOFFS)
 199         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
 200         $(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 201 
 202 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
 203         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
 204         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 205 
 206 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
 207         $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
 208 
 209 $(LIBJVM_DB): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
 210         @echo $(LOG_INFO) Making $@
 211         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
 212                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 213 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 214 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 215         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 216         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
 217 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 218 #       $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@
 219         $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DB_DEBUGINFO) $@
 220   ifeq ($(STRIP_POLICY),all_strip)
 221         $(QUIETLY) $(STRIP) $@
 222   else
 223     ifeq ($(STRIP_POLICY),min_strip)
 224         $(QUIETLY) $(STRIP) -x $@
 225     # implied else here is no stripping at all
 226     endif
 227   endif
 228   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 229         $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
 230         $(RM) $(LIBJVM_DB_DEBUGINFO)
 231   endif
 232 endif
 233 
 234 $(LIBJVM_DTRACE): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 235         @echo $(LOG_INFO) Making $@
 236         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
 237                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 238 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
 239 # Clear the SHF_ALLOC flag (if set) from empty section headers.
 240         $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@
 241         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
 242 # $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections.
 243 #       $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@
 244         $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJVM_DTRACE_DEBUGINFO) $@
 245   ifeq ($(STRIP_POLICY),all_strip)
 246         $(QUIETLY) $(STRIP) $@
 247   else
 248     ifeq ($(STRIP_POLICY),min_strip)
 249         $(QUIETLY) $(STRIP) -x $@
 250     # implied else here is no stripping at all
 251     endif
 252   endif
 253   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 254         $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
 255         $(RM) $(LIBJVM_DTRACE_DEBUGINFO)
 256   endif
 257 endif
 258 
 259 $(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \
 260              $(DTRACE_COMMON_SRCDIR)/hs_private.d
 261         $(QUIETLY) cat $^ > $@
 262 
 263 $(DTRACE_JHELPER).d: $(DTRACE_SRCDIR)/jhelper.d
 264         $(QUIETLY) cat $^ > $@




  84 LFLAGS_JVM_DTRACE += -D_REENTRANT $(PICFLAG)
  85 else
  86 LFLAGS_JVM_DB += -mt $(PICFLAG) -xnolib
  87 LFLAGS_JVM_DTRACE += -mt $(PICFLAG) -xnolib -ldl
  88 endif
  89 
  90 ISA = $(subst i386,i486,$(shell isainfo -n))
  91 
  92 # Making 64/libjvm_db.so: 64-bit version of libjvm_db.so which handles 32-bit libjvm.so
  93 ifneq ("${ISA}","${BUILDARCH}")
  94 
  95 XLIBJVM_DIR = 64
  96 XLIBJVM_DB = $(XLIBJVM_DIR)/$(LIBJVM_DB)
  97 XLIBJVM_DTRACE = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE)
  98 
  99 XLIBJVM_DB_DEBUGINFO       = $(XLIBJVM_DIR)/$(LIBJVM_DB_DEBUGINFO)
 100 XLIBJVM_DB_DIZ             = $(XLIBJVM_DIR)/$(LIBJVM_DB_DIZ)
 101 XLIBJVM_DTRACE_DEBUGINFO   = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DEBUGINFO)
 102 XLIBJVM_DTRACE_DIZ         = $(XLIBJVM_DIR)/$(LIBJVM_DTRACE_DIZ)
 103 
 104 $(XLIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS).h $(LIBJVM_DB_MAPFILE)
 105         @echo $(LOG_INFO) Making $@
 106         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 107         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. -I$(GENERATED) \
 108                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 109 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)






 110         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DB_DEBUGINFO)



 111 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 112 # in the link name:
 113         ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $(LIBJVM_DB) )
 114   ifeq ($(STRIP_POLICY),all_strip)
 115         $(QUIETLY) $(STRIP) $@
 116   else
 117     ifeq ($(STRIP_POLICY),min_strip)
 118         $(QUIETLY) $(STRIP) -x $@
 119     # implied else here is no stripping at all
 120     endif
 121   endif
 122   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 123 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 124 # in the archived name:
 125         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO) )
 126         $(RM) $(XLIBJVM_DB_DEBUGINFO)
 127   endif
 128 endif
 129 
 130 $(XLIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 131         @echo $(LOG_INFO) Making $@
 132         $(QUIETLY) mkdir -p $(XLIBJVM_DIR) ; \
 133         $(CC) $(SYMFLAG) $(ARCHFLAG/$(ISA)) -D$(TYPE) -I. \
 134                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 135 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)


 136         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(XLIBJVM_DTRACE_DEBUGINFO)


 137 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 138 # in the link name:
 139         ( cd $(XLIBJVM_DIR) && $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $(LIBJVM_DTRACE) )
 140   ifeq ($(STRIP_POLICY),all_strip)
 141         $(QUIETLY) $(STRIP) $@
 142   else
 143     ifeq ($(STRIP_POLICY),min_strip)
 144         $(QUIETLY) $(STRIP) -x $@
 145     # implied else here is no stripping at all
 146     endif
 147   endif
 148   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 149 # Do this part in the $(XLIBJVM_DIR) subdir so $(XLIBJVM_DIR) is not
 150 # in the archived name:
 151         ( cd $(XLIBJVM_DIR) && $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO))
 152         $(RM) $(XLIBJVM_DTRACE_DEBUGINFO)
 153   endif
 154 endif
 155 
 156 endif # ifneq ("${ISA}","${BUILDARCH}")
 157 
 158 ifdef USE_GCC
 159 LFLAGS_GENOFFS += -D_REENTRANT


 176         0) rm -f $@.tmp;; \
 177         *) rm -f $@ && mv $@.tmp $@ && echo Updated $@;; \
 178         esac
 179 
 180 # $@.tmp is created first to avoid an empty $(JVMOFFS).h if an error occurs.
 181 $(JVMOFFS).h: $(GENOFFS)
 182         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -header > $@.tmp
 183         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 184 
 185 $(JVMOFFS)Index.h: $(GENOFFS)
 186         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -index > $@.tmp
 187         $(QUIETLY)  $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 188 
 189 $(JVMOFFS).cpp: $(GENOFFS) $(JVMOFFS).h $(JVMOFFS)Index.h
 190         $(QUIETLY) LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ./$(GENOFFS) -table > $@.tmp
 191         $(QUIETLY) $(CONDITIONALLY_UPDATE_JVMOFFS_TARGET)
 192 
 193 $(JVMOFFS.o): $(JVMOFFS).h $(JVMOFFS).cpp 
 194         $(QUIETLY) $(CXX) -c -I. -o $@ $(ARCHFLAG) -D$(TYPE) $(JVMOFFS).cpp
 195 
 196 $(LIBJVM_DB): $(DTRACE_SRCDIR)/$(JVM_DB).c $(JVMOFFS.o) $(XLIBJVM_DB) $(LIBJVM_DB_MAPFILE)
 197         @echo $(LOG_INFO) Making $@
 198         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I. -I$(GENERATED) \
 199                 $(SHARED_FLAG) $(LFLAGS_JVM_DB) -o $@ $(DTRACE_SRCDIR)/$(JVM_DB).c -lc
 200 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)


 201         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DB_DEBUGINFO)
 202         $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DB_DEBUGINFO) $@


 203   ifeq ($(STRIP_POLICY),all_strip)
 204         $(QUIETLY) $(STRIP) $@
 205   else
 206     ifeq ($(STRIP_POLICY),min_strip)
 207         $(QUIETLY) $(STRIP) -x $@
 208     # implied else here is no stripping at all
 209     endif
 210   endif
 211   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 212         $(ZIPEXE) -q -y $(LIBJVM_DB_DIZ) $(LIBJVM_DB_DEBUGINFO)
 213         $(RM) $(LIBJVM_DB_DEBUGINFO)
 214   endif
 215 endif
 216 
 217 $(LIBJVM_DTRACE): $(DTRACE_SRCDIR)/$(JVM_DTRACE).c $(XLIBJVM_DTRACE) $(DTRACE_SRCDIR)/$(JVM_DTRACE).h $(LIBJVM_DTRACE_MAPFILE)
 218         @echo $(LOG_INFO) Making $@
 219         $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) -D$(TYPE) -I.  \
 220                 $(SHARED_FLAG) $(LFLAGS_JVM_DTRACE) -o $@ $(DTRACE_SRCDIR)/$(JVM_DTRACE).c -lc -lthread -ldoor
 221 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)


 222         $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJVM_DTRACE_DEBUGINFO)
 223         $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJVM_DTRACE_DEBUGINFO) $@


 224   ifeq ($(STRIP_POLICY),all_strip)
 225         $(QUIETLY) $(STRIP) $@
 226   else
 227     ifeq ($(STRIP_POLICY),min_strip)
 228         $(QUIETLY) $(STRIP) -x $@
 229     # implied else here is no stripping at all
 230     endif
 231   endif
 232   ifeq ($(ZIP_DEBUGINFO_FILES),1)
 233         $(ZIPEXE) -q -y $(LIBJVM_DTRACE_DIZ) $(LIBJVM_DTRACE_DEBUGINFO) 
 234         $(RM) $(LIBJVM_DTRACE_DEBUGINFO)
 235   endif
 236 endif
 237 
 238 $(DTRACE).d: $(DTRACE_COMMON_SRCDIR)/hotspot.d $(DTRACE_COMMON_SRCDIR)/hotspot_jni.d \
 239              $(DTRACE_COMMON_SRCDIR)/hs_private.d
 240         $(QUIETLY) cat $^ > $@
 241 
 242 $(DTRACE_JHELPER).d: $(DTRACE_SRCDIR)/jhelper.d
 243         $(QUIETLY) cat $^ > $@