PSARC 2015/566 WANBoot GRUB2 Userland libraries
authorDavid Marx <David.M.Marx@Oracle.Com>
Fri, 12 Feb 2016 10:37:27 -0800
changeset 5455 7d4ee55b5053
parent 5454 1efad1afb469
child 5456 703da5f58ef4
PSARC 2015/566 WANBoot GRUB2 Userland libraries 20123814 Create gnutls, nettle, hogweed, gmp static libraries for wanboot
components/gnump/Makefile
components/gnump/gmp.p5m
components/gnutls-3/Makefile
components/gnutls-3/gnutls.p5m
components/gnutls-3/patches/04_wanboot.patch
components/nettle/Makefile
components/nettle/nettle.p5m
--- a/components/gnump/Makefile	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/gnump/Makefile	Fri Feb 12 10:37:27 2016 -0800
@@ -19,7 +19,7 @@
 #
 
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -44,27 +44,62 @@
 include $(WS_MAKE_RULES)/ips.mk
 include $(WS_MAKE_RULES)/lint-libraries.mk
 
+MCS = mcs
+STRIP = strip
+
+# We need to build an extra static version of this library for
+# GRUB/Wanboot support.
+
+ifeq ($(MACH),i386)
+
+WANBOOT_CONFIGURE = $(BUILD_DIR)/wanboot-amd64/.configured
+WANBOOT_BUILD = $(BUILD_DIR)/wanboot-amd64/.built
+WANBOOT_INSTALL = $(BUILD_DIR)/wanboot-amd64/.installed
+
+CONFIGURE_32_and_64 += $(WANBOOT_CONFIGURE)
+BUILD_32_and_64 += $(WANBOOT_BUILD)
+INSTALL_32_and_64 += $(WANBOOT_INSTALL)
+
+endif
+
 PATCH_LEVEL = 0
 
 CLEAN_PATHS += libgmp.pc libgmpxx.pc
 
-CFLAGS += -features=extinl,extensions
-CFLAGS += -xustr=ascii_utf16_ushort -xcsi
+CFLAGS.shared += -features=extinl,extensions
+CFLAGS.shared += -xustr=ascii_utf16_ushort -xcsi
 # -xthreadvar=%all: allow thread-local storage via __thread
 #  qualifier for all types of variables (global, static and dynamic)
-CFLAGS += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
-CFLAGS += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
-CFLAGS += $(studio_PIC)
-CXXFLAGS = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
-CXXFLAGS += -instances=global -template=geninlinefuncs
-CXXFLAGS += -xbuiltin=%none -xinline=%auto -xlibmil
-CXXFLAGS += -xustr=ascii_utf16_ushort -xlibmopt
-CXXFLAGS += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
-CXXFLAGS += $(CPP_XPG5MODE)
+CFLAGS.shared += -xthreadvar=%all $(CPP_C99_EXTENDED_MATH)
+CFLAGS.shared += $(studio_C99_ENABLE) $(CPP_XPG6MODE)
+CFLAGS.shared += $(studio_PIC)
+
+# Set the wanboot CFLAGS as needed for the wanboot compilation
+
+CFLAGS.wanboot += -D_BOOT
+CFLAGS.wanboot += -g
+CFLAGS.wanboot += -falign-jumps=1
+CFLAGS.wanboot += -falign-loops=1
+CFLAGS.wanboot += -falign-functions
+CFLAGS.wanboot += -mno-mmx
+CFLAGS.wanboot += -mno-3dnow
+CFLAGS.wanboot += -fno-dwarf2-cfi-asm
+CFLAGS.wanboot += -fno-asynchronous-unwind-tables
+CFLAGS.wanboot += -fno-common
+CFLAGS.wanboot += -mcmodel=large
+CFLAGS.wanboot += -fno-stack-protector
+CFLAGS.wanboot += -mno-stack-arg-probe
+
+CXXFLAGS.shared = -mt -features=anachronisms,except,rtti,export,extensions,nestedaccess,tmplife,tmplrefstatic
+CXXFLAGS.shared += -instances=global -template=geninlinefuncs
+CXXFLAGS.shared += -xbuiltin=%none -xinline=%auto -xlibmil
+CXXFLAGS.shared += -xustr=ascii_utf16_ushort -xlibmopt
+CXXFLAGS.shared += $(studio_cplusplus_C99_ENABLE) $(studio_PIC)
+CXXFLAGS.shared += $(CPP_XPG5MODE)
 # -Qoption ccfe -features=zla: allow VLA/ZLA in C++ (like in C99)
-CXXFLAGS += -Qoption ccfe -features=zla
-CXXFLAGS += -xF=%none -xthreadvar=%all
-CPPFLAGS += $(CPP_POSIX) $(CPP_LARGEFILES)
+CXXFLAGS.shared += -Qoption ccfe -features=zla
+CXXFLAGS.shared += -xF=%none -xthreadvar=%all
+CPPFLAGS.shared += $(CPP_POSIX) $(CPP_LARGEFILES)
 LDFLAGS += $(LD_Z_REDLOCSYM) $(LD_Z_RESCAN_NOW)
 
 COMPONENT_TEST_TRANSFORMS += \
@@ -108,15 +143,28 @@
 
 CONFIGURE_OPTIONS += --includedir=/usr/include/gmp
 CONFIGURE_OPTIONS += --localstatedir=/var
-CONFIGURE_OPTIONS += --enable-shared
-CONFIGURE_OPTIONS += --disable-static
+CONFIGURE_OPTIONS.shared += --enable-shared
+CONFIGURE_OPTIONS.shared += --disable-static
 CONFIGURE_OPTIONS += --disable-libtool-lock
 CONFIGURE_OPTIONS += --disable-alloca
-CONFIGURE_OPTIONS += --enable-cxx
+CONFIGURE_OPTIONS.shared += --enable-cxx
 CONFIGURE_OPTIONS += --enable-fft
 CONFIGURE_OPTIONS += --enable-mpbsd
 CONFIGURE_OPTIONS += --disable-fat
-CONFIGURE_OPTIONS += --with-pic
+CONFIGURE_OPTIONS.shared += --with-pic
+
+# Set the wanboot configure options as needed for wanboot
+
+CONFIGURE_OPTIONS.wanboot += --disable-assert
+CONFIGURE_OPTIONS.wanboot += --disable-cxx
+CONFIGURE_OPTIONS.wanboot += --disable-nails
+CONFIGURE_OPTIONS.wanboot += --disable-profiling
+CONFIGURE_OPTIONS.wanboot += --disable-minithres
+CONFIGURE_OPTIONS.wanboot += --disable-shared
+CONFIGURE_OPTIONS.wanboot += --enable-static
+CONFIGURE_OPTIONS.wanboot += --disable-libtool-lock
+CONFIGURE_OPTIONS.wanboot += --without-readline
+CONFIGURE_OPTIONS.wanboot += --without-pic
 
 PROTOUSRSHAREINFODIR = $(PROTOUSRSHAREDIR)/info
 PROTOUSRSHAREHTMLDIR = $(PROTOUSRSHAREDIR)/doc/gmp/html
@@ -125,7 +173,7 @@
 PROTOPKGCONFIGDIR = $(PROTOUSRLIBDIR)/pkgconfig
 PROTOPKGCONFIGDIR64 = $(PROTOUSRLIBDIR64)/pkgconfig
 
-COMPONENT_POST_INSTALL_ACTION = \
+COMPONENT_POST_INSTALL_ACTION.shared = \
     ( $(MKDIR) $(PROTOUSRSHAREHTMLDIR) ; \
       $(MKDIR) $(PROTOUSRSHAREMAN3DIR) ; \
       $(MKDIR) $(PROTOPKGCONFIGDIR) ; \
@@ -158,6 +206,13 @@
       $(INSTALL) -m 0644 $(COMPONENT_DIR)/Solaris/libgmp.3 \
 	$(PROTOUSRSHAREMAN3DIR)/ )
 
+COMPONENT_POST_INSTALL_ACTION.wanboot = \
+      ( $(MKDIR) $(PROTO_DIR)/usr/lib/grub/wanboot; \
+	$(MV) $(PROTO_DIR)/usr/lib/amd64/libgmp.a $(PROTO_DIR)/usr/lib/grub/wanboot/libgmp.a; \
+	$(STRIP) -x $(PROTO_DIR)/usr/lib/grub/wanboot/libgmp.a; \
+	$(MCS) -d $(PROTO_DIR)/usr/lib/grub/wanboot/libgmp.a; \
+	$(AR) ts $(PROTO_DIR)/usr/lib/grub/wanboot/libgmp.a )
+
 ASLR_MODE = $(ASLR_NOT_APPLICABLE)
 
 #Skipping this during automated tests since it hangs sometimes
@@ -166,10 +221,29 @@
 # common targets
 configure:	$(CONFIGURE_32_and_64)
 
+$(BUILD_DIR)/$(MACH32)/.configured: CPPFLAGS += $(CPPFLAGS.shared)
+$(BUILD_DIR)/$(MACH32)/.configured: CFLAGS += $(CFLAGS.shared)
+$(BUILD_DIR)/$(MACH32)/.configured: CXXFLAGS += $(CXXFLAGS.shared)
+$(BUILD_DIR)/$(MACH32)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CPPFLAGS += $(CPPFLAGS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CFLAGS += $(CFLAGS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CXXFLAGS += $(CXXFLAGS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
+$(BUILD_DIR)/wanboot-amd64/.configured: BITS=64
+$(BUILD_DIR)/wanboot-amd64/.configured: COMPILER=gcc
+$(BUILD_DIR)/wanboot-amd64/.configured: CPPFLAGS += $(CPPFLAGS.wanboot)
+$(BUILD_DIR)/wanboot-amd64/.configured: CFLAGS += $(CFLAGS.wanboot)
+$(BUILD_DIR)/wanboot-amd64/.configured: CXXFLAGS += $(CXXFLAGS.wanboot)
+$(BUILD_DIR)/wanboot-amd64/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.wanboot)
+
 build: $(BUILD_32_and_64)
 
 install: $(INSTALL_32_and_64)
 
+$(BUILD_DIR)/$(MACH32)/.installed: COMPONENT_POST_INSTALL_ACTION = $(COMPONENT_POST_INSTALL_ACTION.shared)
+$(BUILD_DIR)/$(MACH64)/.installed: COMPONENT_POST_INSTALL_ACTION = $(COMPONENT_POST_INSTALL_ACTION.shared)
+$(BUILD_DIR)/wanboot-amd64/.installed: COMPONENT_POST_INSTALL_ACTION = $(COMPONENT_POST_INSTALL_ACTION.wanboot)
+
 test: $(TEST_32_and_64)
 
 system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
--- a/components/gnump/gmp.p5m	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/gnump/gmp.p5m	Fri Feb 12 10:37:27 2016 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2011, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 <transform file path=usr.*/man/.+ -> default mangler.man.stability uncommitted>
 set name=pkg.fmri \
@@ -47,6 +47,7 @@
 file path=usr/lib/$(MACH64)/llib-lgmp.ln
 file path=usr/lib/$(MACH64)/pkgconfig/libgmp.pc
 file path=usr/lib/$(MACH64)/pkgconfig/libgmpxx.pc
+file path=usr/lib/grub/wanboot/libgmp.a variant.arch=i386
 link path=usr/lib/libgmp.so target=libgmp.so.3.5.2
 #
 link path=usr/lib/libgmp.so.3 target=libgmp.so.3.5.2
--- a/components/gnutls-3/Makefile	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/gnutls-3/Makefile	Fri Feb 12 10:37:27 2016 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2010, 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
@@ -52,6 +52,202 @@
 # called gnutls-3 temporarily.  The plan is to integrate 3.4.1 and move all
 # programs to 3.4.1; after all usage of 2.8.6  excised, move 3.4.1 to the
 # default location.
+
+MCS = mcs
+STRIP = strip
+
+# We need to build an extra static version of this library for
+# GRUB/Wanboot support.
+
+ifeq ($(MACH),i386)
+
+WANBOOT_CONFIGURE = $(BUILD_DIR)/wanboot-amd64/.configured
+WANBOOT_BUILD = $(BUILD_DIR)/wanboot-amd64/.built
+WANBOOT_INSTALL = $(BUILD_DIR)/wanboot-amd64/.installed
+
+CONFIGURE_32_and_64 += $(WANBOOT_CONFIGURE)
+BUILD_32_and_64 += $(WANBOOT_BUILD)
+INSTALL_32_and_64 += $(WANBOOT_INSTALL)
+
+endif
+
+# Set the wanboot CFLAGS as needed for the wanboot compilation
+
+CFLAGS.wanboot += -D_BOOT
+CFLAGS.wanboot += -g
+CFLAGS.wanboot += -falign-jumps=1
+CFLAGS.wanboot += -falign-loops=1
+CFLAGS.wanboot += -falign-functions
+CFLAGS.wanboot += -mno-mmx
+CFLAGS.wanboot += -mno-sse
+CFLAGS.wanboot += -mno-sse2
+CFLAGS.wanboot += -mno-sse3
+CFLAGS.wanboot += -mno-ssse3
+CFLAGS.wanboot += -mno-sse4.1
+CFLAGS.wanboot += -mno-sse4.2
+CFLAGS.wanboot += -mno-sse4
+CFLAGS.wanboot += -mno-avx
+CFLAGS.wanboot += -mno-avx2
+CFLAGS.wanboot += -mno-aes
+CFLAGS.wanboot += -mno-pclmul
+CFLAGS.wanboot += -mno-fsgsbase
+CFLAGS.wanboot += -mno-rdrnd
+CFLAGS.wanboot += -mno-f16c
+CFLAGS.wanboot += -mno-fma
+CFLAGS.wanboot += -mno-sse4a
+CFLAGS.wanboot += -mno-fma4
+CFLAGS.wanboot += -mno-xop
+CFLAGS.wanboot += -mno-lwp
+CFLAGS.wanboot += -mno-3dnow
+CFLAGS.wanboot += -fno-dwarf2-cfi-asm
+CFLAGS.wanboot += -fno-asynchronous-unwind-tables
+CFLAGS.wanboot += -fno-common
+CFLAGS.wanboot += -mcmodel=large
+CFLAGS.wanboot += -mno-red-zone
+CFLAGS.wanboot += -fno-stack-protector
+CFLAGS.wanboot += -mno-stack-arg-probe
+
+# Set the wanboot configure options as needed for wanboot
+
+CONFIGURE_OPTIONS.wanboot += --enable-largefile
+CONFIGURE_OPTIONS.wanboot += --disable-doc
+CONFIGURE_OPTIONS.wanboot += --disable-tools
+CONFIGURE_OPTIONS.wanboot += --disable-cxx
+CONFIGURE_OPTIONS.wanboot += --disable-hardware-acceleration
+CONFIGURE_OPTIONS.wanboot += --disable-padlock
+CONFIGURE_OPTIONS.wanboot += --with-nettle-mini
+CONFIGURE_OPTIONS.wanboot += --with-included-libtasn1
+CONFIGURE_OPTIONS.wanboot += --disable-dtls-srtp-support
+CONFIGURE_OPTIONS.wanboot += --disable-alpn-support
+CONFIGURE_OPTIONS.wanboot += --disable-heartbeat_support
+CONFIGURE_OPTIONS.wanboot += --disable-srp-authentication
+CONFIGURE_OPTIONS.wanboot += --disable-psk-authentication
+CONFIGURE_OPTIONS.wanboot += --enable-anon-authentication
+CONFIGURE_OPTIONS.wanboot += --enable-dhe
+CONFIGURE_OPTIONS.wanboot += --disable-openpgp-authentication
+CONFIGURE_OPTIONS.wanboot += --disable-cryptodev
+CONFIGURE_OPTIONS.wanboot += --disable-ocsp
+CONFIGURE_OPTIONS.wanboot += --disable-session-tickets
+CONFIGURE_OPTIONS.wanboot += --disable-openssl-compatibility
+CONFIGURE_OPTIONS.wanboot += --disable-tests
+CONFIGURE_OPTIONS.wanboot += --without-html-dir
+CONFIGURE_OPTIONS.wanboot += --disable-gtk-doc
+CONFIGURE_OPTIONS.wanboot += --disable-gtk-doc-html
+CONFIGURE_OPTIONS.wanboot += --disable-gtk-doc-pdf
+CONFIGURE_OPTIONS.wanboot += --disable-nls
+CONFIGURE_OPTIONS.wanboot += --disable-rpath
+CONFIGURE_OPTIONS.wanboot += --without-libiconv-prefix
+CONFIGURE_OPTIONS.wanboot += --without-libintl-prefix
+CONFIGURE_OPTIONS.wanboot += --without-librt-prefix
+CONFIGURE_OPTIONS.wanboot += --without-libpthread-prefix
+CONFIGURE_OPTIONS.wanboot += --without-libnsl-prefix
+CONFIGURE_OPTIONS.wanboot += --disable-ld-version-script
+CONFIGURE_OPTIONS.wanboot += --disable-valgrind-tests
+CONFIGURE_OPTIONS.wanboot += --enable-static
+CONFIGURE_OPTIONS.wanboot += --disable-shared
+CONFIGURE_OPTIONS.wanboot += --without-pic
+CONFIGURE_OPTIONS.wanboot += --disable-self-checks
+CONFIGURE_OPTIONS.wanboot += --disable-fips140-mode
+CONFIGURE_OPTIONS.wanboot += --without-idn
+CONFIGURE_OPTIONS.wanboot += --disable-non-suiteb-curves
+CONFIGURE_OPTIONS.wanboot += --disable-libdane
+CONFIGURE_OPTIONS.wanboot += --without-unbound-root-key-file
+CONFIGURE_OPTIONS.wanboot += --without-system-priority-file
+CONFIGURE_OPTIONS.wanboot += --without-tpm
+CONFIGURE_OPTIONS.wanboot += --disable-local-libopts
+CONFIGURE_OPTIONS.wanboot += --disable-libopts-install
+CONFIGURE_OPTIONS.wanboot += --without-regex_header
+CONFIGURE_OPTIONS.wanboot += --without-libregex
+CONFIGURE_OPTIONS.wanboot += --without-libregex_cflags
+CONFIGURE_OPTIONS.wanboot += --without-libregex_libs
+CONFIGURE_OPTIONS.wanboot += --disable-optional-args
+CONFIGURE_OPTIONS.wanboot += --without-zlib
+CONFIGURE_OPTIONS.wanboot += --without-default-trust-store-dir
+CONFIGURE_OPTIONS.wanboot += --without-default-trust-store-file
+CONFIGURE_OPTIONS.wanboot += --without-default-crl-file
+CONFIGURE_OPTIONS.wanboot += --without-default-blacklist-file
+CONFIGURE_OPTIONS.wanboot += --disable-guile
+CONFIGURE_OPTIONS.wanboot += --without-guile-site-dir
+CONFIGURE_OPTIONS.wanboot += --disable-crywrap
+
+# For wanboot tell configure that we don't have lots of the
+# standard unix environment.  This will cache these values, and set
+# them to no.
+
+CONFIGURE_OPTIONS.wanboot += ac_cv_func___fsetlocking=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func___register_atfork=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func__fseeki64=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func__ftelli64=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func__ftime=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_alarm=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_argpusage=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_canonicalize_file_name=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_chmod=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_clock_gettime=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_clock_settime=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_daemon=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_dup2=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_epoll_create=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_fchmod=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_flockfile=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_fork=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_fstat=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_ftello=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_funlockfile=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getdelim=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_gethostbyname=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getline=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getpagesize=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getpass=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getpid=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getpwuid_r=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getrusage=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_getservbyname=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_iconv=no
+CONFIGURE_OPTIONS.wanboot += am_cv_func_iconv=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_inet_ntop=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_inet_pton=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_kqueue=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_localtime=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_localtime_r=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_mbrtowc=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_memmem=no
+CONFIGURE_OPTIONS.wanboot += gl_cv_func_memmem_works_always=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_mmap=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_mprotect=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_munmap=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_nanosleep=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_pthread_atfork=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_pthread_mutex_lock=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_putenv=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_regcomp=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_scandir=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_scm_gc_malloc_pointerless=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_select=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_setdtablesize=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_setenv=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_shutdown=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_socket=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_strerror_r=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_strpbrk=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_strsignal=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_strtok_r=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_strverscmp=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_tcgetattr=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_tcsetattr=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_tsearch=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_uname=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_unsetenv=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_vasprintf=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_vfork=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_wcslen=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_wcsnlen=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_func_wctomb=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_libiconv=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_libnsl=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_libpthread=no
+CONFIGURE_OPTIONS.wanboot += ac_cv_librt=no
+
 CONFIGURE_OPTIONS += --sysconfdir=/etc 
 CONFIGURE_OPTIONS += --infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS += --mandir=/usr/share/$(COMPONENT_NAME)-3/man
@@ -79,9 +275,32 @@
 
 configure:      $(CONFIGURE_32_and_64)
 
+$(BUILD_DIR)/wanboot-amd64/.configured: BITS=64
+$(BUILD_DIR)/wanboot-amd64/.configured: COMPILER=gcc
+$(BUILD_DIR)/wanboot-amd64/.configured: CFLAGS += $(CFLAGS.wanboot)
+$(BUILD_DIR)/wanboot-amd64/.configured: \
+	CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.wanboot)
+
 build:          $(BUILD_32_and_64)
 
-install:	$(INSTALL_32_and_64)
+install:        $(INSTALL_32_and_64)
+
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MKDIR) $(PROTO_DIR)/usr/lib/grub/wanboot;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MV) $(PROTO_DIR)/usr/lib/amd64/$(COMPONENT_NAME)-3/libgnutls.a \
+	$(PROTO_DIR)/usr/lib/grub/wanboot/libgnutls.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(STRIP) -x  $(PROTO_DIR)/usr/lib/grub/wanboot/libgnutls.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MCS) -d $(PROTO_DIR)/usr/lib/grub/wanboot/libgnutls.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(AR) ts $(PROTO_DIR)/usr/lib/grub/wanboot/libgnutls.a;
 
 COMPONENT_TEST_MASTER = $(COMPONENT_TEST_RESULTS_DIR)/results-all.master
 
--- a/components/gnutls-3/gnutls.p5m	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/gnutls-3/gnutls.p5m	Fri Feb 12 10:37:27 2016 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 <transform file path=usr.*/man/.+ -> default mangler.man.stability committed>
@@ -76,6 +76,7 @@
     target=$(COMPONENT_NAME)-3/libgnutls.so.30.4.0
 file usr/lib/$(MACH64)/$(COMPONENT_NAME)-3/pkgconfig/gnutls.pc \
     path=usr/lib/$(MACH64)/pkgconfig/$(COMPONENT_NAME)-3/gnutls.pc
+file path=usr/lib/grub/wanboot/libgnutls.a variant.arch=i386
 link path=usr/lib/libgnutls.so.30 target=$(COMPONENT_NAME)-3/libgnutls.so.30.4.0
 file usr/lib/$(COMPONENT_NAME)-3/pkgconfig/gnutls.pc \
     path=usr/lib/pkgconfig/$(COMPONENT_NAME)-3/gnutls.pc
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/gnutls-3/patches/04_wanboot.patch	Fri Feb 12 10:37:27 2016 -0800
@@ -0,0 +1,58 @@
+Source: Internal
+
+Info: This patch makes the changes necessary to support wanboot.
+Mostly it removes floating point support.
+
+Status: This patch is Solaris specific.  This will not be sent upstream.
+
+--- gnutls-3.4.6/gl/printf-args.c 2015-01-19 09:38:09.000000000 -0800
++++ gnutls-3.4.6/gl/printf-args.c 2015-12-10 17:46:30.949444885 -0800
+@@ -73,12 +73,14 @@
+         ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+         break;
+ #endif
++#ifndef _BOOT
+       case TYPE_DOUBLE:
+         ap->a.a_double = va_arg (args, double);
+         break;
+       case TYPE_LONGDOUBLE:
+         ap->a.a_longdouble = va_arg (args, long double);
+         break;
++#endif /* !_BOOT */
+       case TYPE_CHAR:
+         ap->a.a_char = va_arg (args, int);
+         break;
+--- gnutls-3.4.6/src/gl/timespec.h 2015-01-19 09:38:09.000000000 -0800
++++ gnutls-3.4.6/src/gl/timespec.h 2015-12-10 17:47:59.802282095 -0800
+@@ -97,12 +97,14 @@
+ struct timespec dtotimespec (double)
+   _GL_ATTRIBUTE_CONST;
+ 
++#ifndef _BOOT
+ /* Return an approximation to A, of type 'double'.  */
+ _GL_TIMESPEC_INLINE double
+ timespectod (struct timespec a)
+ {
+   return a.tv_sec + a.tv_nsec / 1e9;
+ }
++#endif /* !_BOOT */
+ 
+ void gettime (struct timespec *);
+ int settime (struct timespec const *);
+--- gnutls-3.4.6/src/gl/printf-args.c 2015-01-19 09:38:09.000000000 -0800
++++ gnutls-3.4.6/src/gl/printf-args.c 2015-12-10 17:51:12.619526033 -0800
+@@ -73,12 +73,14 @@
+         ap->a.a_ulonglongint = va_arg (args, unsigned long long int);
+         break;
+ #endif
++#ifndef _BOOT
+       case TYPE_DOUBLE:
+         ap->a.a_double = va_arg (args, double);
+         break;
+       case TYPE_LONGDOUBLE:
+         ap->a.a_longdouble = va_arg (args, long double);
+         break;
++#endif /* !_BOOT */
+       case TYPE_CHAR:
+         ap->a.a_char = va_arg (args, int);
+         break;
--- a/components/nettle/Makefile	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/nettle/Makefile	Fri Feb 12 10:37:27 2016 -0800
@@ -18,7 +18,7 @@
 #
 # CDDL HEADER END
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 COMPONENT_NAME=		nettle
@@ -38,6 +38,41 @@
 include $(WS_MAKE_RULES)/configure.mk
 include $(WS_MAKE_RULES)/ips.mk
 
+MCS = mcs
+STRIP = strip
+
+# We need to build an extra static version of these libraries for
+# GRUB/Wanboot support.
+
+ifeq ($(MACH),i386)
+
+WANBOOT_CONFIGURE = $(BUILD_DIR)/wanboot-amd64/.configured
+WANBOOT_BUILD = $(BUILD_DIR)/wanboot-amd64/.built
+WANBOOT_INSTALL = $(BUILD_DIR)/wanboot-amd64/.installed
+
+CONFIGURE_32_and_64 += $(WANBOOT_CONFIGURE)
+BUILD_32_and_64 += $(WANBOOT_BUILD)
+INSTALL_32_and_64 += $(WANBOOT_INSTALL)
+
+endif
+
+# Set the wanboot CFLAGS as needed for the wanboot compilation
+
+CFLAGS.wanboot += -D_BOOT
+CFLAGS.wanboot += -g
+CFLAGS.wanboot += -falign-jumps=1
+CFLAGS.wanboot += -falign-loops=1
+CFLAGS.wanboot += -falign-functions
+CFLAGS.wanboot += -mno-mmx
+CFLAGS.wanboot += -mno-3dnow
+CFLAGS.wanboot += -fno-dwarf2-cfi-asm
+CFLAGS.wanboot += -fno-asynchronous-unwind-tables
+CFLAGS.wanboot += -fno-common
+CFLAGS.wanboot += -mcmodel=large
+CFLAGS.wanboot += -mno-red-zone
+CFLAGS.wanboot += -fno-stack-protector
+CFLAGS.wanboot += -mno-stack-arg-probe
+
 CONFIGURE_OPTIONS  += --libexecdir=$(CONFIGURE_LIBDIR.$(BITS))
 CONFIGURE_OPTIONS  += --infodir=$(CONFIGURE_INFODIR)
 CONFIGURE_OPTIONS  += --with-include-path=/usr/include/gmp
@@ -48,6 +83,21 @@
 CONFIGURE_OPTIONS  += --disable-elliptic-curves
 CONFIGURE_OPTIONS  += --disable-knuth-lfib
 
+# Set the wanboot configure options as needed for wanboot
+
+CONFIGURE_OPTIONS.wanboot  += --disable-assembler
+CONFIGURE_OPTIONS.wanboot  += --enable-static
+CONFIGURE_OPTIONS.wanboot  += --disable-shared
+CONFIGURE_OPTIONS.wanboot  += --disable-pic
+CONFIGURE_OPTIONS.wanboot  += --disable-gcov
+CONFIGURE_OPTIONS.wanboot  += --disable-openssl
+CONFIGURE_OPTIONS.wanboot  += --disable-documentation
+CONFIGURE_OPTIONS.wanboot  += --disable-fat
+CONFIGURE_OPTIONS.wanboot  += --disable-arm-neon
+CONFIGURE_OPTIONS.wanboot  += --disable-x86-aesni
+CONFIGURE_OPTIONS.wanboot  += --disable-mini-gmp
+CONFIGURE_OPTIONS.wanboot  += --disable-ld-version-script
+
 # The additional set of transforms to be applied to the
 # test results to try to normalize them.
 COMPONENT_TEST_TRANSFORMS += \
@@ -62,10 +112,47 @@
 # common targets
 configure:      $(CONFIGURE_32_and_64)
 
+$(BUILD_DIR)/$(MACH32)/.configured: CFLAGS += $(CFLAGS.shared)
+$(BUILD_DIR)/$(MACH32)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CFLAGS += $(CFLAGS.shared)
+$(BUILD_DIR)/$(MACH64)/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.shared)
+$(BUILD_DIR)/wanboot-amd64/.configured: BITS=64
+$(BUILD_DIR)/wanboot-amd64/.configured: COMPILER=gcc
+$(BUILD_DIR)/wanboot-amd64/.configured: CFLAGS += $(CFLAGS.wanboot)
+$(BUILD_DIR)/wanboot-amd64/.configured: CONFIGURE_OPTIONS += $(CONFIGURE_OPTIONS.wanboot)
+
 build:          $(BUILD_32_and_64)
 
 install:        $(INSTALL_32_and_64)
 
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MKDIR) $(PROTO_DIR)/usr/lib/grub/wanboot;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MV) $(PROTO_DIR)/usr/lib/amd64/libnettle.a $(PROTO_DIR)/usr/lib/grub/wanboot/libnettle.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(STRIP) -x $(PROTO_DIR)/usr/lib/grub/wanboot/libnettle.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MCS) -d $(PROTO_DIR)/usr/lib/grub/wanboot/libnettle.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(AR) ts $(PROTO_DIR)/usr/lib/grub/wanboot/libnettle.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MV) $(PROTO_DIR)/usr/lib/amd64/libhogweed.a $(PROTO_DIR)/usr/lib/grub/wanboot/libhogweed.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(STRIP) -x $(PROTO_DIR)/usr/lib/grub/wanboot/libhogweed.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(MCS) -d $(PROTO_DIR)/usr/lib/grub/wanboot/libhogweed.a;
+$(BUILD_DIR)/wanboot-amd64/.installed: \
+	COMPONENT_POST_INSTALL_ACTION += \
+	$(AR) ts $(PROTO_DIR)/usr/lib/grub/wanboot/libhogweed.a;
+
 test:           $(TEST_32_and_64)
 
 system-test:    $(SYSTEM_TESTS_NOT_IMPLEMENTED)
--- a/components/nettle/nettle.p5m	Fri Feb 12 09:35:44 2016 -0800
+++ b/components/nettle/nettle.p5m	Fri Feb 12 10:37:27 2016 -0800
@@ -20,7 +20,7 @@
 #
 
 #
-# Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
 #
 
 set name=pkg.fmri \
@@ -99,6 +99,8 @@
 file path=usr/lib/$(MACH64)/libnettle.so.6.1
 file path=usr/lib/$(MACH64)/pkgconfig/hogweed.pc
 file path=usr/lib/$(MACH64)/pkgconfig/nettle.pc
+file path=usr/lib/grub/wanboot/libhogweed.a variant.arch=i386
+file path=usr/lib/grub/wanboot/libnettle.a variant.arch=i386
 link path=usr/lib/libhogweed.so target=libhogweed.so.4.1
 link path=usr/lib/libhogweed.so.4 target=libhogweed.so.4.1
 file path=usr/lib/libhogweed.so.4.1