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) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
2N/A#
2N/A
2N/ALIBRARY = sn1_brand.a
2N/AVERS = .1
2N/ACOBJS = sn1_brand.o
2N/AASOBJS = crt.o handler.o runexe.o brand_util.o
2N/AOBJECTS = $(COBJS)
2N/A
2N/Ainclude ../../Makefile.sn1
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# explicily specify an interpreter for the brand emulation library.
2N/A# Normally this would be the native linker, /.SUNWnative/usr/lib/ld.so.1
2N/A# or /.SUNWnative/usr/lib/64/ld.so.1.
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/A# XXX: Note that we also set the runtime path for the emulation library to
2N/A# point into /.SUNWnative/. This ensures that our brand library get's the
2N/A# native versions of any libraries it needs. Unfortunatly this is a total
2N/A# hack since it doesn't work for suid binaries. What we really need to do
2N/A# is enhance the linker so that when it's running on a brand linkmap it
2N/A# looks for all libraries in the brands "native" directory (for both
2N/A# regular and suid binaries).
2N/A#
2N/ANATIVE_DIR = /.SUNWnative
2N/ACPPFLAGS += -D_REENTRANT -U_ASM \
2N/A -I. -I$(BRAND_SHARED)/brand/sys -I$(UTSBASE)/common/brand/sn1
2N/ACFLAGS += $(CCVERBOSE)
2N/ADYNFLAGS += $(DYNFLAGS_$(CLASS))
2N/ADYNFLAGS += $(BLOCAL) $(ZNOVERSION) -Wl,-e_start
2N/A#DYNFLAGS += -R$(NATIVE_DIR)/lib -R$(NATIVE_DIR)/usr/lib
2N/ALDLIBS += -lmapmalloc -lc
2N/A
2N/A#
2N/A# We link to libmapmalloc as an interposer for the benefit of our dependencies,
2N/A# but since we don't call functions from it directly, ld will see it as unused,
2N/A# so we need to disable unused dependency guidance.
2N/A#
2N/AZGUIDANCE = $(ZGUIDANCE_NOUNUSED_DEP)
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