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# See the License for the specific language governing permissions 2N/A# and limitations under the License. 2N/A# When distributing Covered Code, include this CDDL HEADER in each 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# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. 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# 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# 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# 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# Needed to handle zfs include files