2N/A#
2N/A# CDDL HEADER START
2N/A#
2N/A# The contents of this file are subject to the terms of the
2N/A# Common Development and Distribution License (the "License").
2N/A# You may not use this file except in compliance with the License.
2N/A#
2N/A# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A# or http://www.opensolaris.org/os/licensing.
2N/A# See the License for the specific language governing permissions
2N/A# and limitations under the License.
2N/A#
2N/A# When distributing Covered Code, include this CDDL HEADER in each
2N/A# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A# If applicable, add the following below this CDDL HEADER, with the
2N/A# fields enclosed by brackets "[]" replaced with your own identifying
2N/A# information: Portions Copyright [yyyy] [name of copyright owner]
2N/A#
2N/A# CDDL HEADER END
2N/A#
2N/A#
2N/A# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/ALIBRARY = s10_brand.a
2N/AVERS = .1
2N/ACOBJS = s10_brand.o s10_deleted.o s10_signal.o
2N/AASOBJS = crt.o handler.o runexe.o brand_util.o
2N/AOBJECTS = $(COBJS)
2N/A
2N/Ainclude ../../Makefile.s10
2N/Ainclude $(SRC)/lib/Makefile.lib
2N/A
2N/ASRCDIR = ../common
2N/AUTSBASE = $(SRC)/uts
2N/A
2N/ALIBS = $(DYNLIB)
2N/ACSRCS = $(COBJS:%o=../common/%c)
2N/ASHAREDOBJS = $(ASOBJS:%o=$(ISAOBJDIR)/%o)
2N/ASRCS = $(CSRCS)
2N/A
2N/A#
2N/A# Note that the architecture specific makefiles MUST update DYNFLAGS to
2N/A# explicitly specify an interpreter for the brand emulation library so that we
2N/A# use /lib/ld.so.1 or /lib/64/ld.so.1, which in a s10 zone is the Solaris 10
2N/A# linker. This is different from some other brands where the linker that is
2N/A# used is the native system linker (/.SUNWnative/.../ld.so.1). We have to do
2N/A# this because the linker has a very incestuous relationship with libc and we
2N/A# don't want to use the native linker with the s10 version of libc. (This may
2N/A# come as a surprise to the reader, but when our library is loaded it get's
2N/A# linked against the s10 version of libc.) Although the linker interfaces are
2N/A# normally stable, there are examples, such as with the solaris8 brand, where
2N/A# we could not combine the brand's libc with the native linker. Since we want
2N/A# to run in a known configuration, we use the S10 libc/linker combination.
2N/A#
2N/A# There is one more non-obvious side effect of using the s10 linker that
2N/A# should be mentioned. Since the linker is used to setup processes before
2N/A# libc is loaded, it makes system calls directly (ie avoiding libc), and
2N/A# it makes these system calls before our library has been initialized.
2N/A# Since our library hasn't been initialized yet, there's no way for us
2N/A# to intercept and emulate any of those system calls. So if any of those
2N/A# system calls ever change in the native code such that they break the s10
2N/A# linker then we're kinda screwed and will need to re-visit the current
2N/A# solution. (The likely solution then will probably be to start using the
2N/A# native linker with our brand emulation library.)
2N/A#
2N/A# Note that we make sure to link our brand emulation library
2N/A# libmapmalloc. This is required because in most cases there will be two
2N/A# copies of libc in the same process and we don't want them to fight over
2N/A# the heap. So for our brand library we link against libmapmalloc so that
2N/A# if we (our or copy of libc) try to allocate any memory it will be done
2N/A# via mmap() instead of brk().
2N/A#
2N/ACPPFLAGS += -D_REENTRANT -U_ASM \
2N/A -I. -I$(BRAND_SHARED)/brand/sys -I../sys \
2N/A -I$(UTSBASE)/common/brand/solaris10 \
2N/A -I$(SRC)/uts/common/fs/zfs
2N/ACFLAGS += $(CCVERBOSE)
2N/A# Needed to handle zfs include files
2N/AC99MODE= -xc99=%all
2N/AC99LMODE= -Xc99=%all
2N/ADYNFLAGS += $(DYNFLAGS_$(CLASS))
2N/ADYNFLAGS += $(BLOCAL) $(ZNOVERSION) -Wl,-e_start
2N/ALDLIBS += -lmapmalloc -lc
2N/A
2N/A$(LIBS):= PICS += $(SHAREDOBJS)
2N/A
2N/A.KEEP_STATE:
2N/A
2N/Aall: $(LIBS)
2N/A
2N/Alint: lintcheck
2N/A
2N/Ainclude $(SRC)/lib/Makefile.targ