make/lib/Lib-jdk.hotspot.agent.gmk
author tschatzl
Fri, 29 Nov 2019 10:20:17 +0100
changeset 59321 5775e4825e58
parent 58949 a2987e18475d
permissions -rw-r--r--
8233998: New young regions registered too early in collection set Reviewed-by: sangheki, sjohanss
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     1
#
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 52108
diff changeset
     2
# Copyright (c) 2015, 2019, Oracle and/or its affiliates. All rights reserved.
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     3
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     4
#
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     5
# This code is free software; you can redistribute it and/or modify it
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     6
# under the terms of the GNU General Public License version 2 only, as
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     7
# published by the Free Software Foundation.  Oracle designates this
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     8
# particular file as subject to the "Classpath" exception as provided
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
     9
# by Oracle in the LICENSE file that accompanied this code.
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    10
#
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    11
# This code is distributed in the hope that it will be useful, but WITHOUT
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    12
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    13
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    14
# version 2 for more details (a copy is included in the LICENSE file that
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    15
# accompanied this code).
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    16
#
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    17
# You should have received a copy of the GNU General Public License version
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    18
# 2 along with this work; if not, write to the Free Software Foundation,
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    19
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    20
#
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    21
# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    22
# or visit www.oracle.com if you need additional information or have any
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    23
# questions.
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    24
#
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    25
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    26
include LibCommon.gmk
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    27
47314
743814386712 8188814: Simplify IncludeCustomExtension
ihse
parents: 47217
diff changeset
    28
$(eval $(call IncludeCustomExtension, hotspot/lib/Lib-jdk.hotspot.agent.gmk))
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    29
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    30
################################################################################
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    31
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53379
diff changeset
    32
ifeq ($(call isTargetOs, linux), true)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    33
  SA_CFLAGS := -D_FILE_OFFSET_BITS=64
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    34
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53379
diff changeset
    35
else ifeq ($(call isTargetOs, solaris), true)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    36
  SA_LDFLAGS := -mt
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    37
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53379
diff changeset
    38
else ifeq ($(call isTargetOs, macosx), true)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    39
  SA_CFLAGS := -Damd64 -D_GNU_SOURCE -mno-omit-leaf-frame-pointer \
34312
b687b05475c6 8144134: Nightly tests fail with SIGSEGV in Ticks::now()
erikj
parents: 34289
diff changeset
    40
      -mstack-alignment=16 -fPIC
50818
e46b9e514479 8189429: SA: MacOSX: Replace the deprecated PT_ATTACH with PT_ATTACHEXC
jgeorge
parents: 50471
diff changeset
    41
  LIBSA_EXTRA_SRC := $(SUPPORT_OUTPUTDIR)/gensrc/jdk.hotspot.agent
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53379
diff changeset
    42
else ifeq ($(call isTargetOs, windows), true)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    43
  SA_CFLAGS := -D_WINDOWS -D_DEBUG -D_CONSOLE -D_MBCS -EHsc
53683
48ff68e2fe5c 8218431: Improved platform checking in makefiles
ihse
parents: 53379
diff changeset
    44
  ifeq ($(call isTargetCpu, x86_64), true)
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    45
    SA_CXXFLAGS := -DWIN64
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    46
  else
52108
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    47
    # Only add /RTC1 flag for debug builds as it's
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    48
    # incompatible with release type builds. See
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    49
    # https://msdn.microsoft.com/en-us/library/8wtf2dfz.aspx
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    50
    ifeq ($(DEBUG_LEVEL),slowdebug)
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    51
      SA_CXXFLAGS := -RTC1
9c84227836d4 8212110: Build of saproc.dll broken on Windows 32 bit after JDK-8210647
sgehwolf
parents: 51853
diff changeset
    52
    endif
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    53
  endif
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    54
endif
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    55
58913
e2dfab7beccb 8233285: Demangling C++ symbols in jhsdb jstack --mixed
ysuenaga
parents: 58747
diff changeset
    56
SA_TOOLCHAIN := $(TOOLCHAIN_DEFAULT)
e2dfab7beccb 8233285: Demangling C++ symbols in jhsdb jstack --mixed
ysuenaga
parents: 58747
diff changeset
    57
ifeq ($(call isTargetOs, linux), true)
58949
a2987e18475d 8233600: Cross-builds fails after JDK-8233285
bulasevich
parents: 58913
diff changeset
    58
  SA_TOOLCHAIN := TOOLCHAIN_LINK_CXX
58913
e2dfab7beccb 8233285: Demangling C++ symbols in jhsdb jstack --mixed
ysuenaga
parents: 58747
diff changeset
    59
endif
e2dfab7beccb 8233285: Demangling C++ symbols in jhsdb jstack --mixed
ysuenaga
parents: 58747
diff changeset
    60
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    61
################################################################################
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    62
49244
995a5556edfa 8199639: Introduce SetupJdkLibrary and SetupJdkExecutable
ihse
parents: 49241
diff changeset
    63
$(eval $(call SetupJdkLibrary, BUILD_LIBSA, \
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    64
    NAME := saproc, \
58913
e2dfab7beccb 8233285: Demangling C++ symbols in jhsdb jstack --mixed
ysuenaga
parents: 58747
diff changeset
    65
    TOOLCHAIN := $(SA_TOOLCHAIN), \
51762
c608b2190460 8210647: libsaproc is being compiled without optimization.
sgehwolf
parents: 50818
diff changeset
    66
    OPTIMIZATION := HIGH, \
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    67
    DISABLED_WARNINGS_microsoft := 4267, \
51853
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51762
diff changeset
    68
    DISABLED_WARNINGS_gcc := sign-compare pointer-arith, \
ec62d6cab037 8211029: Have a common set of enabled warnings for all native libraries
ihse
parents: 51762
diff changeset
    69
    DISABLED_WARNINGS_clang := sign-compare pointer-arith format-nonliteral, \
58747
c6fd655677ec 8232770: Enable more warnings on solaris studio
ihse
parents: 53683
diff changeset
    70
    DISABLED_WARNINGS_CXX_solstudio := truncwarn unknownpragma doubunder, \
50471
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 49440
diff changeset
    71
    CFLAGS := $(CFLAGS_JDKLIB) $(SA_CFLAGS), \
f0aeede1b855 8204572: SetupJdkLibrary should setup SRC and -I flags automatically
ihse
parents: 49440
diff changeset
    72
    CXXFLAGS := $(CXXFLAGS_JDKLIB) $(SA_CFLAGS) $(SA_CXXFLAGS), \
50818
e46b9e514479 8189429: SA: MacOSX: Replace the deprecated PT_ATTACH with PT_ATTACHEXC
jgeorge
parents: 50471
diff changeset
    73
    EXTRA_SRC := $(LIBSA_EXTRA_SRC), \
49239
c35ec365e329 8199483: Clean up some non-standard LDFLAGS usage
ihse
parents: 49160
diff changeset
    74
    LDFLAGS := $(LDFLAGS_JDKLIB) $(SA_LDFLAGS), \
53379
e47074d2d8cc 8181313: SA: Remove libthread_db dependency on Linux
ysuenaga
parents: 52108
diff changeset
    75
    LIBS_linux := $(LIBDL), \
49274
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    76
    LIBS_solaris := -ldl -ldemangle -lthread -lproc, \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    77
    LIBS_macosx := -framework Foundation -framework JavaNativeFoundation \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    78
        -framework JavaRuntimeSupport -framework Security -framework CoreFoundation, \
9f3ce373370a 8199682: Clean up building the saproc library
ihse
parents: 49244
diff changeset
    79
    LIBS_windows := dbgeng.lib, \
34289
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    80
))
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    81
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    82
TARGETS += $(BUILD_LIBSA)
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    83
2d1821a50263 8142336: Convert the SA agent build to modular build-infra makefiles
erikj
parents:
diff changeset
    84
################################################################################