1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/make/solaris/makefiles/jsig.make Wed Apr 27 01:25:04 2016 +0800 1.3 @@ -0,0 +1,88 @@ 1.4 +# 1.5 +# Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved. 1.6 +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 1.7 +# 1.8 +# This code is free software; you can redistribute it and/or modify it 1.9 +# under the terms of the GNU General Public License version 2 only, as 1.10 +# published by the Free Software Foundation. 1.11 +# 1.12 +# This code is distributed in the hope that it will be useful, but WITHOUT 1.13 +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 1.14 +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 1.15 +# version 2 for more details (a copy is included in the LICENSE file that 1.16 +# accompanied this code). 1.17 +# 1.18 +# You should have received a copy of the GNU General Public License version 1.19 +# 2 along with this work; if not, write to the Free Software Foundation, 1.20 +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 1.21 +# 1.22 +# Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 1.23 +# or visit www.oracle.com if you need additional information or have any 1.24 +# questions. 1.25 +# 1.26 +# 1.27 + 1.28 +# Rules to build signal interposition library, used by vm.make 1.29 + 1.30 +# libjsig.so: signal interposition library 1.31 +JSIG = jsig 1.32 +LIBJSIG = lib$(JSIG).so 1.33 + 1.34 +LIBJSIG_DEBUGINFO = lib$(JSIG).debuginfo 1.35 +LIBJSIG_DIZ = lib$(JSIG).diz 1.36 + 1.37 +JSIGSRCDIR = $(GAMMADIR)/src/os/$(Platform_os_family)/vm 1.38 + 1.39 +DEST_JSIG = $(JDK_LIBDIR)/$(LIBJSIG) 1.40 +DEST_JSIG_DEBUGINFO = $(JDK_LIBDIR)/$(LIBJSIG_DEBUGINFO) 1.41 +DEST_JSIG_DIZ = $(JDK_LIBDIR)/$(LIBJSIG_DIZ) 1.42 + 1.43 +LIBJSIG_MAPFILE = $(MAKEFILES_DIR)/mapfile-vers-jsig 1.44 + 1.45 +LFLAGS_JSIG += $(MAPFLAG:FILENAME=$(LIBJSIG_MAPFILE)) 1.46 + 1.47 +ifdef USE_GCC 1.48 +LFLAGS_JSIG += -D_REENTRANT 1.49 +else 1.50 +LFLAGS_JSIG += -mt -xnolib 1.51 +endif 1.52 + 1.53 +$(LIBJSIG): $(ADD_GNU_DEBUGLINK) $(FIX_EMPTY_SEC_HDR_FLAGS) $(JSIGSRCDIR)/jsig.c $(LIBJSIG_MAPFILE) 1.54 + @echo Making signal interposition lib... 1.55 + $(QUIETLY) $(CC) $(SYMFLAG) $(ARCHFLAG) $(SHARED_FLAG) $(PICFLAG) \ 1.56 + $(LFLAGS_JSIG) -o $@ $(JSIGSRCDIR)/jsig.c -ldl 1.57 +ifeq ($(ENABLE_FULL_DEBUG_SYMBOLS),1) 1.58 +# gobjcopy crashes on "empty" section headers with the SHF_ALLOC flag set. 1.59 +# Clear the SHF_ALLOC flag (if set) from empty section headers. 1.60 +# An empty section header has sh_addr == 0 and sh_size == 0. 1.61 +# This problem has only been seen on Solaris X64, but we call this tool 1.62 +# on all Solaris builds just in case. 1.63 + $(QUIETLY) $(FIX_EMPTY_SEC_HDR_FLAGS) $@ 1.64 + $(QUIETLY) $(OBJCOPY) --only-keep-debug $@ $(LIBJSIG_DEBUGINFO) 1.65 +# $(OBJCOPY) --add-gnu-debuglink=... corrupts SUNW_* sections. 1.66 +# Use $(ADD_GNU_DEBUGLINK) until a fixed $(OBJCOPY) is available. 1.67 +# $(QUIETLY) $(OBJCOPY) --add-gnu-debuglink=$(LIBJSIG_DEBUGINFO) $@ 1.68 + $(QUIETLY) $(ADD_GNU_DEBUGLINK) $(LIBJSIG_DEBUGINFO) $@ 1.69 + ifeq ($(STRIP_POLICY),all_strip) 1.70 + $(QUIETLY) $(STRIP) $@ 1.71 + else 1.72 + ifeq ($(STRIP_POLICY),min_strip) 1.73 + $(QUIETLY) $(STRIP) -x $@ 1.74 + # implied else here is no stripping at all 1.75 + endif 1.76 + endif 1.77 + ifeq ($(ZIP_DEBUGINFO_FILES),1) 1.78 + $(ZIPEXE) -q -y $(LIBJSIG_DIZ) $(LIBJSIG_DEBUGINFO) 1.79 + $(RM) $(LIBJSIG_DEBUGINFO) 1.80 + endif 1.81 +endif 1.82 + 1.83 +install_jsig: $(LIBJSIG) 1.84 + @echo "Copying $(LIBJSIG) to $(DEST_JSIG)" 1.85 + $(QUIETLY) test -f $(LIBJSIG_DEBUGINFO) && \ 1.86 + cp -f $(LIBJSIG_DEBUGINFO) $(DEST_JSIG_DEBUGINFO) 1.87 + $(QUIETLY) test -f $(LIBJSIG_DIZ) && \ 1.88 + cp -f $(LIBJSIG_DIZ) $(DEST_JSIG_DIZ) 1.89 + $(QUIETLY) cp -f $(LIBJSIG) $(DEST_JSIG) && echo "Done" 1.90 + 1.91 +.PHONY: install_jsig