never@3156: # dcubed@5898: # Copyright (c) 2005, 2013, Oracle and/or its affiliates. All rights reserved. never@3156: # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. never@3156: # never@3156: # This code is free software; you can redistribute it and/or modify it never@3156: # under the terms of the GNU General Public License version 2 only, as never@3156: # published by the Free Software Foundation. never@3156: # never@3156: # This code is distributed in the hope that it will be useful, but WITHOUT never@3156: # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or never@3156: # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License never@3156: # version 2 for more details (a copy is included in the LICENSE file that never@3156: # accompanied this code). never@3156: # never@3156: # You should have received a copy of the GNU General Public License version never@3156: # 2 along with this work; if not, write to the Free Software Foundation, never@3156: # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. never@3156: # never@3156: # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA never@3156: # or visit www.oracle.com if you need additional information or have any never@3156: # questions. never@3156: # never@3156: # never@3156: never@3156: # Rules to build signal interposition library, used by vm.make never@3156: dcubed@4344: # libjsig.so: signal interposition library never@3156: JSIG = jsig never@3156: never@3156: ifeq ($(OS_VENDOR), Darwin) never@3156: LIBJSIG = lib$(JSIG).dylib dcubed@5898: dcubed@5898: LIBJSIG_DEBUGINFO = lib$(JSIG).dylib.dSYM dcubed@5898: LIBJSIG_DIZ = lib$(JSIG).diz never@3156: else never@3156: LIBJSIG = lib$(JSIG).so dcubed@5898: dcubed@5898: LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo dcubed@5898: LIBJSIG_DIZ = lib$(JSIG).diz never@3156: endif never@3156: never@3156: JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm never@3156: dcubed@5898: DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) dcubed@5898: DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO) dcubed@5898: DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ) never@3156: never@3156: LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig never@3156: never@3156: # On Bsd we really dont want a mapfile, as this library is small never@3156: # and preloaded using LD_PRELOAD, making functions private will never@3156: # cause problems with interposing. See CR: 6466665 never@3156: # LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) never@3156: sgehwolf@9330: LFLAGS_JSIG += -D_GNU_SOURCE -pthread $(LDFLAGS_HASH_STYLE) $(EXTRA_LDFLAGS) never@3156: never@3156: # DEBUG_BINARIES overrides everything, use full -g debug information never@3156: ifeq ($(DEBUG_BINARIES), true) never@3156: JSIG_DEBUG_CFLAGS = -g never@3156: endif never@3156: sgehwolf@9717: # Optimize jsig lib at level -O3 unless it's a slowdebug build sgehwolf@9717: ifneq ($(DEBUG_LEVEL), slowdebug) sgehwolf@9717: JSIG_OPT_FLAGS = $(OPT_CFLAGS) sgehwolf@9717: endif sgehwolf@9717: never@3156: $(LIBJSIG): $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) never@3156: @echo Making signal interposition lib... never@3156: $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ sgehwolf@9717: $(LFLAGS_JSIG) $(JSIG_DEBUG_CFLAGS) $(JSIG_OPT_FLAGS) $(EXTRA_CFLAGS) -o $@ $< dcubed@5898: ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) dcubed@5898: ifeq ($(OS_VENDOR), Darwin) dcubed@5898: $(DSYMUTIL) $@ dcubed@5898: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@5898: $(ZIPEXE) -q -r -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) dcubed@5898: $(RM) -r $(LIBJSIG_DEBUGINFO) dcubed@5898: endif dcubed@5898: else dcubed@5898: $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) dcubed@5898: $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ dcubed@5898: ifeq ($(STRIP_POLICY),all_strip) dcubed@5898: $(QUIETLY) $(STRIP) $@ dcubed@5898: else dcubed@5898: ifeq ($(STRIP_POLICY),min_strip) dcubed@5898: $(QUIETLY) $(STRIP) -g $@ dcubed@5898: # implied else here is no stripping at all dcubed@5898: endif dcubed@5898: endif dcubed@5898: ifeq ($(ZIP_DEBUGINFO_FILES),1) dcubed@5898: $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) dcubed@5898: $(RM) $(LIBJSIG_DEBUGINFO) dcubed@5898: endif dcubed@5898: endif dcubed@5898: endif never@3156: never@3156: install_jsig: $(LIBJSIG) never@3156: @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" dcubed@5898: ifeq ($(OS_VENDOR), Darwin) dcubed@5898: $(QUIETLY) test -d $(LIBJSIG_DEBUGINFO) && \ dcubed@5898: cp -f -r $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) dcubed@5898: else dcubed@5898: $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ dcubed@5898: cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) dcubed@5898: endif dcubed@5898: $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ dcubed@5898: cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) never@3156: $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" never@3156: never@3156: .PHONY: install_jsig