< prev index next >

make/hotspot/lib/CompileJvm.gmk

Print this page


   1 #
   2 # Copyright (c) 2013, 2017, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 253   endif
 254 endif
 255 
 256 # AIX warning explanation:
 257 # 1500-010  : (W) WARNING in ...: Infinite loop.  Program may not stop.
 258 #             There are several infinite loops in the vm, so better suppress.
 259 # 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...".
 260 # 1540-0216 : (W) An expression of type .. cannot be converted to type ..
 261 #             In hotspot this fires for functionpointer to pointer conversions
 262 # 1540-1088 : (W) The exception specification is being ignored.
 263 #             In hotspot this is caused by throw() in declaration of new() in nmethod.hpp.
 264 # 1540-1090 : (I) The destructor of "..." might not be called.
 265 # 1540-1639 : (I) The behavior of long type bit fields has changed ...
 266 
 267 # Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
 268 # defined after the above call to BUILD_LIBJVM. Mapfile will be generated
 269 # after all object files are built, but before the jvm library is linked.
 270 include lib/JvmMapfile.gmk
 271 
 272 TARGETS += $(BUILD_LIBJVM)



























































   1 #
   2 # Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.  Oracle designates this
   8 # particular file as subject to the "Classpath" exception as provided
   9 # by Oracle in the LICENSE file that accompanied this code.
  10 #
  11 # This code is distributed in the hope that it will be useful, but WITHOUT
  12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14 # version 2 for more details (a copy is included in the LICENSE file that
  15 # accompanied this code).
  16 #
  17 # You should have received a copy of the GNU General Public License version
  18 # 2 along with this work; if not, write to the Free Software Foundation,
  19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20 #
  21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22 # or visit www.oracle.com if you need additional information or have any


 253   endif
 254 endif
 255 
 256 # AIX warning explanation:
 257 # 1500-010  : (W) WARNING in ...: Infinite loop.  Program may not stop.
 258 #             There are several infinite loops in the vm, so better suppress.
 259 # 1540-0198 : (W) The omitted keyword "private" is assumed for base class "...".
 260 # 1540-0216 : (W) An expression of type .. cannot be converted to type ..
 261 #             In hotspot this fires for functionpointer to pointer conversions
 262 # 1540-1088 : (W) The exception specification is being ignored.
 263 #             In hotspot this is caused by throw() in declaration of new() in nmethod.hpp.
 264 # 1540-1090 : (I) The destructor of "..." might not be called.
 265 # 1540-1639 : (I) The behavior of long type bit fields has changed ...
 266 
 267 # Include mapfile generation. It relies on BUILD_LIBJVM_ALL_OBJS which is only
 268 # defined after the above call to BUILD_LIBJVM. Mapfile will be generated
 269 # after all object files are built, but before the jvm library is linked.
 270 include lib/JvmMapfile.gmk
 271 
 272 TARGETS += $(BUILD_LIBJVM)
 273 
 274 ################################################################################
 275 # Hotspot disallows the use of global operators 'new' and 'delete'. This build
 276 # time check helps enforce this requirement. If you trigger this check and the
 277 # reference is not obvious from the source, GNU objdump can be used to help find
 278 # the reference if compiled with GCC:
 279 #
 280 # objdump -lrdSC <path/to/file.o>
 281 #
 282 # -C demangle
 283 # -d disassemble
 284 # -r print relocation entries, interspersed with the disassembly
 285 # -S print source code, intermixed with disassembly
 286 # -l include filenames and line numbers
 287 #
 288 # Search the output for the operator(s) of interest, to see where they are
 289 # referenced.
 290 
 291 ifneq ($(filter $(TOOLCHAIN_TYPE), gcc clang solstudio), )
 292 
 293   DEMANGLED_REGEXP := [^:]operator (new|delete)
 294 
 295   # Running c++filt to find offending symbols in all files is too expensive,
 296   # especially on Solaris, so use mangled names when looking for symbols.
 297   # Save the demangling for when something is actually found.
 298   ifeq ($(TOOLCHAIN_TYPE), solstudio)
 299     MANGLED_SYMS := \
 300         __1c2n6FL_pv_ \
 301         __1c2N6FL_pv_ \
 302         __1c2k6Fpv_v_ \
 303         __1c2K6Fpv_v_ \
 304         #
 305     UNDEF_PATTERN := UNDEF
 306   else
 307     MANGLED_SYMS := \
 308         _ZdaPv \
 309         _ZdlPv \
 310         _Znam \
 311         _Znwm \
 312         #
 313     UNDEF_PATTERN := ' U '
 314   endif
 315 
 316   define SetupOperatorNewDeleteCheck
 317     $1.op_check: $1
 318         if [ -n "`$(NM) $$< | $(GREP) $(addprefix -e , $(MANGLED_SYMS)) \
 319             | $(GREP) $(UNDEF_PATTERN)`" ]; then \
 320           $(ECHO) "$$<: Error: Use of global operators new and delete is not allowed in Hotspot:"; \
 321           $(NM) $$< | $(CXXFILT) | $(EGREP) '$(DEMANGLED_REGEXP)' | $(GREP) $(UNDEF_PATTERN); \
 322           $(ECHO) "See: $(TOPDIR)/make/hotspot/lib/CompileJvm.gmk"; \
 323           exit 1; \
 324         fi
 325         $(TOUCH) $$@
 326 
 327     TARGETS += $1.op_check
 328   endef
 329 
 330   $(foreach o, $(BUILD_LIBJVM_ALL_OBJS), $(eval $(call SetupOperatorNewDeleteCheck,$o)))
 331 endif
< prev index next >