annotate make/lib/CompileLibjsig.gmk @ 12293:325a8906aca8

8169625: Libjsig build doesn't set flags for ppc64/s390 builds Reviewed-by: erikj
author simonis
date Mon, 14 Nov 2016 11:15:43 +0100
parents 15b3ef116f15
children
rev   line source
erikj@10841 1 #
erikj@10841 2 # Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved.
erikj@10841 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
erikj@10841 4 #
erikj@10841 5 # This code is free software; you can redistribute it and/or modify it
erikj@10841 6 # under the terms of the GNU General Public License version 2 only, as
erikj@10841 7 # published by the Free Software Foundation. Oracle designates this
erikj@10841 8 # particular file as subject to the "Classpath" exception as provided
erikj@10841 9 # by Oracle in the LICENSE file that accompanied this code.
erikj@10841 10 #
erikj@10841 11 # This code is distributed in the hope that it will be useful, but WITHOUT
erikj@10841 12 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
erikj@10841 13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
erikj@10841 14 # version 2 for more details (a copy is included in the LICENSE file that
erikj@10841 15 # accompanied this code).
erikj@10841 16 #
erikj@10841 17 # You should have received a copy of the GNU General Public License version
erikj@10841 18 # 2 along with this work; if not, write to the Free Software Foundation,
erikj@10841 19 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
erikj@10841 20 #
erikj@10841 21 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
erikj@10841 22 # or visit www.oracle.com if you need additional information or have any
erikj@10841 23 # questions.
erikj@10841 24 #
erikj@10841 25
erikj@10841 26 ################################################################################
erikj@10841 27 # Create the libjsig.so shared library
erikj@10841 28
erikj@10841 29 default: all
erikj@10841 30
erikj@10841 31 include $(SPEC)
erikj@10841 32 include MakeBase.gmk
erikj@10841 33 include NativeCompilation.gmk
erikj@10841 34
erikj@10841 35 ifneq ($(OPENJDK_TARGET_OS), windows)
erikj@10841 36 ifeq ($(STATIC_BUILD), false)
erikj@10841 37 ifeq ($(OPENJDK_TARGET_OS), linux)
erikj@10841 38 LIBJSIG_CFLAGS := -fPIC -D_GNU_SOURCE -D_REENTRANT $(EXTRA_CFLAGS)
erikj@10841 39 LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE) $(EXTRA_CFLAGS)
erikj@10841 40 LIBJSIG_LIBS := $(LIBDL)
erikj@10841 41
erikj@10841 42 # NOTE: The old build compiled this library without -soname.
erikj@10841 43 # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
erikj@10841 44 SET_SHARED_LIBRARY_NAME :=
erikj@10841 45
erikj@10841 46 # Flags for other CPUs can be provided in EXTRA_CFLAGS
erikj@10841 47 ifeq ($(OPENJDK_TARGET_CPU), x86_64)
erikj@10841 48 LIBJSIG_CPU_FLAGS := -m64
erikj@10841 49 else ifeq ($(OPENJDK_TARGET_CPU), x86)
erikj@10841 50 LIBJSIG_CPU_FLAGS := -m32 -march=i586
simonis@12293 51 else ifeq ($(OPENJDK_TARGET_CPU), ppc64)
simonis@12293 52 LIBJSIG_CPU_FLAGS := -mcpu=powerpc64 -mtune=power5
simonis@12293 53 else ifeq ($(OPENJDK_TARGET_CPU), ppc64le)
simonis@12293 54 LIBJSIG_CPU_FLAGS := -DABI_ELFv2 -mcpu=power8 -mtune=power8
simonis@12293 55 else ifeq ($(OPENJDK_TARGET_CPU), s390x)
simonis@12293 56 LIBJSIG_CPU_FLAGS := -mbackchain -march=z10
erikj@10841 57 endif
erikj@10841 58
erikj@10841 59 else ifeq ($(OPENJDK_TARGET_OS), solaris)
erikj@10841 60 LIBJSIG_CFLAGS := -m64 -KPIC -mt
erikj@10841 61 LIBJSIG_LDFLAGS := -m64 -mt -xnolib
erikj@10841 62 LIBJSIG_LIBS := $(LIBDL)
erikj@10841 63
erikj@10841 64 # NOTE: The old build compiled this library without -soname.
erikj@10841 65 # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
erikj@10841 66 SET_SHARED_LIBRARY_NAME :=
erikj@10841 67
erikj@10841 68 else ifeq ($(OPENJDK_TARGET_OS), aix)
erikj@10841 69 LIBJSIG_CFLAGS := -q64 -D_GNU_SOURCE -D_REENTRANT -qpic=large
erikj@10841 70 LIBJSIG_LDFLAGS := -b64 -bexpall -G -bnoentry -qmkshrobj -brtl -bnolibpath -bernotok
erikj@10841 71 LIBJSIG_LIBS := $(LIBDL)
erikj@10841 72
erikj@10841 73 # NOTE: The old build compiled this library without -soname.
erikj@10841 74 # To emulate this, we need to clear out SET_SHARED_LIBRARY_NAME.
erikj@10841 75 SET_SHARED_LIBRARY_NAME :=
erikj@10841 76
erikj@10841 77 else ifeq ($(OPENJDK_TARGET_OS), macosx)
erikj@10841 78 LIBJSIG_CFLAGS := -m64 -D_GNU_SOURCE -pthread -mno-omit-leaf-frame-pointer -mstack-alignment=16 -fPIC
erikj@10841 79 LIBJSIG_LDFLAGS := $(LDFLAGS_HASH_STYLE)
erikj@10841 80 else
erikj@10841 81 $(error Unknown target OS $(OPENJDK_TARGET_OS) in CompileLibjsig.gmk)
erikj@10841 82 endif
erikj@10841 83
erikj@10841 84 LIBJSIG_SRC_FILE := $(HOTSPOT_TOPDIR)/src/os/$(HOTSPOT_TARGET_OS)/vm/jsig.c
erikj@11042 85 LIBJSIG_MAPFILE := $(wildcard $(HOTSPOT_TOPDIR)/make/mapfiles/libjsig/mapfile-vers-$(OPENJDK_TARGET_OS))
erikj@10841 86 LIBJSIG_OUTPUTDIR := $(HOTSPOT_OUTPUTDIR)/libjsig
erikj@10841 87
erikj@10841 88 LIBJSIG_LDFLAGS += $(SHARED_LIBRARY_FLAGS)
erikj@10841 89
erikj@12124 90 LIB_OUTPUTDIR := $(call FindLibDirForModule, java.base)
erikj@12124 91
erikj@10841 92 $(eval $(call SetupNativeCompilation, BUILD_LIBJSIG, \
erikj@10841 93 LIBRARY := jsig, \
erikj@10841 94 EXTRA_FILES := $(LIBJSIG_SRC_FILE), \
erikj@12124 95 OUTPUT_DIR := $(LIB_OUTPUTDIR), \
erikj@10841 96 LANG := C, \
erikj@10841 97 CFLAGS := $(LIBJSIG_CFLAGS) $(LIBJSIG_CPU_FLAGS), \
erikj@10841 98 LDFLAGS := $(LIBJSIG_LDFLAGS) $(LIBJSIG_CPU_FLAGS), \
erikj@10841 99 LIBS := $(LIBJSIG_LIBS), \
erikj@10841 100 MAPFILE := $(LIBJSIG_MAPFILE), \
erikj@10841 101 OBJECT_DIR := $(LIBJSIG_OUTPUTDIR)/objs, \
erikj@10841 102 ))
erikj@10841 103
erikj@10841 104 TARGETS += $(BUILD_LIBJSIG)
erikj@12124 105
erikj@12124 106 ############################################################################
erikj@12124 107 # Create symlinks in each variant sub dir
erikj@12124 108 ifeq ($(OPENJDK_TARGET_OS), macosx)
erikj@12124 109 DEBUG_INFO_SUFFIX := $(SHARED_LIBRARY_SUFFIX).dSYM
erikj@12124 110 else
erikj@12124 111 DEBUG_INFO_SUFFIX := .debuginfo
erikj@12124 112 endif
erikj@12124 113
erikj@12124 114 # $1 variant subdir
erikj@12124 115 define CreateSymlinks
erikj@12124 116 # Always symlink from libdir/variant/libjsig.so -> ../libjsig.so and
erikj@12124 117 # the corresponding debuginfo.
erikj@12124 118 $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig): \
erikj@12124 119 $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
erikj@12124 120 $$(call MakeDir, $$(@D))
erikj@12124 121 $(RM) $$@
erikj@12124 122 $(LN) -s ../$$(@F) $$@
erikj@12124 123
erikj@12124 124 TARGETS += $(LIB_OUTPUTDIR)/$1/$(call SHARED_LIBRARY,jsig)
erikj@12124 125
erikj@12124 126 ifeq ($(COPY_DEBUG_SYMBOLS), true)
erikj@12124 127 $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX): \
erikj@12124 128 $(LIB_OUTPUTDIR)/$(call SHARED_LIBRARY,jsig)
erikj@12124 129 $$(call MakeDir, $$(@D))
erikj@12124 130 $(RM) $$@
erikj@12124 131 $(LN) -s ../$$(@F) $$@
erikj@12124 132
erikj@12124 133 TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX)
erikj@12124 134
erikj@12124 135 ifeq ($(ZIP_EXTERNAL_DEBUG_SYMBOLS), true)
erikj@12124 136 $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz: \
erikj@12124 137 $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig$(DEBUG_INFO_SUFFIX)
erikj@12124 138 $(CD) $$(@D) && $(ZIP) -q -y $$@ $$(basename $$(@F))$(DEBUG_INFO_SUFFIX)
erikj@12124 139
erikj@12124 140 TARGETS += $(LIB_OUTPUTDIR)/$1/$(LIBRARY_PREFIX)jsig.diz
erikj@12124 141 endif
erikj@12124 142 endif
erikj@12124 143 endef
erikj@12124 144
erikj@12124 145 # The subdir is the same as the variant for client and minimal, for all
erikj@12124 146 # others it's server.
erikj@12124 147 VARIANT_SUBDIRS := $(filter client minimal, $(JVM_VARIANTS)) \
erikj@12124 148 $(if $(filter-out client minimal, $(JVM_VARIANTS)), server)
erikj@12124 149 $(foreach v, $(VARIANT_SUBDIRS), $(eval $(call CreateSymlinks,$v)))
erikj@12124 150
erikj@12124 151 ############################################################################
erikj@12124 152
erikj@12124 153 include CopyToExplodedJdk.gmk
erikj@12124 154
erikj@10841 155 endif
erikj@10841 156 endif
erikj@10841 157
erikj@10841 158 all: $(TARGETS)
erikj@10841 159
erikj@10841 160 .PHONY: all