make/bsd/makefiles/jsig.make

Fri, 21 Sep 2018 16:58:36 +0200

author
sgehwolf
date
Fri, 21 Sep 2018 16:58:36 +0200
changeset 9717
23845b8c4b4b
parent 9330
f175513c2c3a
child 9756
2be326848943
permissions
-rw-r--r--

8210761: libjsig is being compiled without optimization
Reviewed-by: clanger, andrew

never@3156 1 #
dcubed@5898 2 # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved.
never@3156 3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
never@3156 4 #
never@3156 5 # This code is free software; you can redistribute it and/or modify it
never@3156 6 # under the terms of the GNU General Public License version 2 only, as
never@3156 7 # published by the Free Software Foundation.
never@3156 8 #
never@3156 9 # This code is distributed in the hope that it will be useful, but WITHOUT
never@3156 10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
never@3156 11 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
never@3156 12 # version 2 for more details (a copy is included in the LICENSE file that
never@3156 13 # accompanied this code).
never@3156 14 #
never@3156 15 # You should have received a copy of the GNU General Public License version
never@3156 16 # 2 along with this work; if not, write to the Free Software Foundation,
never@3156 17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
never@3156 18 #
never@3156 19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
never@3156 20 # or visit www.oracle.com if you need additional information or have any
never@3156 21 # questions.
never@3156 22 #
never@3156 23 #
never@3156 24
never@3156 25 # Rules to build signal interposition library, used by vm.make
never@3156 26
dcubed@4344 27 # libjsig.so: signal interposition library
never@3156 28 JSIG = jsig
never@3156 29
never@3156 30 ifeq ($(OS_VENDOR), Darwin)
never@3156 31 LIBJSIG = lib$(JSIG).dylib
dcubed@5898 32
dcubed@5898 33 LIBJSIG_DEBUGINFO = lib$(JSIG).dylib.dSYM
dcubed@5898 34 LIBJSIG_DIZ = lib$(JSIG).diz
never@3156 35 else
never@3156 36 LIBJSIG = lib$(JSIG).so
dcubed@5898 37
dcubed@5898 38 LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo
dcubed@5898 39 LIBJSIG_DIZ = lib$(JSIG).diz
never@3156 40 endif
never@3156 41
never@3156 42 JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm
never@3156 43
dcubed@5898 44 DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG)
dcubed@5898 45 DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO)
dcubed@5898 46 DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ)
never@3156 47
never@3156 48 LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig
never@3156 49
never@3156 50 # On Bsd we really dont want a mapfile, as this library is small
never@3156 51 # and preloaded using LD_PRELOAD, making functions private will
never@3156 52 # cause problems with interposing. See CR: 6466665
never@3156 53 # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE))
never@3156 54
sgehwolf@9330 55 LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS)
never@3156 56
never@3156 57 # DEBUG_BINARIES overrides everything, use full -g debug information
never@3156 58 ifeq ($(DEBUG_BINARIES), true)
never@3156 59 JSIG_DEBUG_CFLAGS = -g
never@3156 60 endif
never@3156 61
sgehwolf@9717 62 # Optimize jsig lib at level -O3 unless it's a slowdebug build
sgehwolf@9717 63 ifneq ($(DEBUG_LEVEL), slowdebug)
sgehwolf@9717 64 JSIG_OPT_FLAGS = $(OPT_CFLAGS)
sgehwolf@9717 65 endif
sgehwolf@9717 66
never@3156 67 $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE)
never@3156 68 @echo Making signal interposition lib...
never@3156 69 $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \
sgehwolf@9717 70 $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(JSIG_OPT_FLAGS) $(EXTRA_CFLAGS) -o $@ $<
dcubed@5898 71 ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1)
dcubed@5898 72 ifeq ($(OS_VENDOR), Darwin)
dcubed@5898 73 $(DSYMUTIL) $@
dcubed@5898 74 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@5898 75 $(ZIPEXE) -q -r -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
dcubed@5898 76 $(RM) -r $(LIBJSIG_DEBUGINFO)
dcubed@5898 77 endif
dcubed@5898 78 else
dcubed@5898 79 $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO)
dcubed@5898 80 $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@
dcubed@5898 81 ifeq ($(STRIP_POLICY),all_strip)
dcubed@5898 82 $(QUIETLY) $(STRIP) $@
dcubed@5898 83 else
dcubed@5898 84 ifeq ($(STRIP_POLICY),min_strip)
dcubed@5898 85 $(QUIETLY) $(STRIP) -g $@
dcubed@5898 86 # implied else here is no stripping at all
dcubed@5898 87 endif
dcubed@5898 88 endif
dcubed@5898 89 ifeq ($(ZIP_DEBUGINFO_FILES),1)
dcubed@5898 90 $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO)
dcubed@5898 91 $(RM) $(LIBJSIG_DEBUGINFO)
dcubed@5898 92 endif
dcubed@5898 93 endif
dcubed@5898 94 endif
never@3156 95
never@3156 96 install_jsig: $(LIBJSIG)
never@3156 97 @echo "Copying $(LIBJSIG) to $(DEST_JSIG)"
dcubed@5898 98 ifeq ($(OS_VENDOR), Darwin)
dcubed@5898 99 $(QUIETLY) test -d $(LIBJSIG_DEBUGINFO) && \
dcubed@5898 100 cp -f -r $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
dcubed@5898 101 else
dcubed@5898 102 $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \
dcubed@5898 103 cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO)
dcubed@5898 104 endif
dcubed@5898 105 $(QUIETLY) test -f $(LIBJSIG_DIZ) && \
dcubed@5898 106 cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ)
never@3156 107 $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done"
never@3156 108
never@3156 109 .PHONY: install_jsig

mercurial