Makefile.com revision 8fd04b8338ed5093ec2d1e668fa620b7de44c177
#
# CDDL HEADER START
#
# The contents of this file are subject to the terms of the
# Common Development and Distribution License (the "License").
# You may not use this file except in compliance with the License.
#
# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
# See the License for the specific language governing permissions
# and limitations under the License.
#
# When distributing Covered Code, include this CDDL HEADER in each
# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
# If applicable, add the following below this CDDL HEADER, with the
# fields enclosed by brackets "[]" replaced with your own identifying
# information: Portions Copyright [yyyy] [name of copyright owner]
#
# CDDL HEADER END
#
#
# Copyright 2010 Sun Microsystems, Inc. All rights reserved.
# Use is subject to license terms.
#
VERS = .1
CLOBBERFILES += $(OFFSETS_H)
#
# Ugh, this is a gross hack. Our assembly routines uses lots of defines
# to simplify variable access. All these defines work fine for amd64
# compiles because when compiling for amd64 we use the GNU assembler,
# gas. For 32-bit code we use the Sun assembler, as. Unfortunatly
# as does not handle certian constructs that gas does. So rather than
# make our code less readable, we'll just use gas to compile our 32-bit
# code as well.
#
#
# Note that the architecture specific makefiles MUST update DYNFLAGS to
# explicitly specify an interpreter for the brand emulation library so that we
# linker. This is different from some other brands where the linker that is
# used is the native system linker (/.SUNWnative/.../ld.so.1). We have to do
# this because the linker has a very incestuous relationship with libc and we
# don't want to use the native linker with the s10 version of libc. (This may
# come as a surprise to the reader, but when our library is loaded it get's
# linked against the s10 version of libc.) Although the linker interfaces are
# normally stable, there are examples, such as with the solaris8 brand, where
# we could not combine the brand's libc with the native linker. Since we want
#
# There is one more non-obvious side effect of using the s10 linker that
# should be mentioned. Since the linker is used to setup processes before
# libc is loaded, it makes system calls directly (ie avoiding libc), and
# it makes these system calls before our library has been initialized.
# Since our library hasn't been initialized yet, there's no way for us
# to intercept and emulate any of those system calls. So if any of those
# system calls ever change in the native code such that they break the s10
# linker then we're kinda screwed and will need to re-visit the current
# solution. (The likely solution then will probably be to start using the
# native linker with our brand emulation library.)
#
# Note that we make sure to link our brand emulation library
# libmapmalloc. This is required because in most cases there will be two
# copies of libc in the same process and we don't want them to fight over
# the heap. So for our brand library we link against libmapmalloc so that
# if we (our or copy of libc) try to allocate any memory it will be done
# via mmap() instead of brk().
#
# Needed to handle zfs include files
#
# build the offset header before trying to compile any files. (it's included
# by s10_misc.h, so it's needed for all objects, not just assembly ones.)
#
$(OFFSETS_H): $(OFFSETS_SRC)
$(COMPILE.s) -o $@ $<