Browse files

HVM-725 KVM VMs can't boot due to missing libgcc_s.so.1

  • Loading branch information...
1 parent 1ade91c commit aca4b67c9afb44cbf793b9315583f059202297ff @JohnSonnenschein JohnSonnenschein committed Mar 9, 2012
Showing with 27 additions and 7 deletions.
  1. +7 −2 libxml/Makefile
  2. +16 −3 libxml/libtool.patch
  3. +4 −2 libz/Makefile
View
9 libxml/Makefile
@@ -32,8 +32,9 @@
VER=libxml2-2.7.6
VER64=$(VER)-64
-LDFLAGS= -z defs -z text -z combreloc -lpthread
-LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE
+LDFLAGS= -z defs -z text -z combreloc -lpthread -lc -nodefaultlibs
+LARGEFILES= -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE \
+ -fno-builtin
BASE=$(PWD)
DESTDIR=$(BASE)/../proto
@@ -48,17 +49,21 @@ all32: $(VER)/config.status
(cd $(VER); env - PATH=$(PATH) \
"CC=$(GCC)" \
"CFLAGS=$(LARGEFILES)" \
+ "LDFLAGS=$(LDFLAGS)" \
make -e libxml2.la; \
env - PATH=$(PATH) "CFLAGS=$(LARGEFILES)" \
"CC=$(GCC)" \
+ "LDFLAGS=$(LDFLAGS)" \
make -e $(PARALLEL))
all64: $(VER64)/config.status
(cd $(VER64); env - PATH=$(PATH) "CC=$(GCC)" \
"CFLAGS=-m64 $(LARGEFILES)" \
+ "LDFLAGS=$(LDFLAGS)" \
make -e libxml2.la; \
env - PATH=$(PATH) "CFLAGS=-m64 $(LARGEFILES)" \
"CC=$(GCC)" \
+ "LDFLAGS=$(LDFLAGS)" \
make -e $(PARALLEL))
install: all
View
19 libxml/libtool.patch
@@ -1,5 +1,5 @@
---- libxml2-2.7.4/libtool.orig Sun Sep 13 17:47:18 2009
-+++ libxml2-2.7.4/libtool Sun Sep 13 17:47:34 2009
+--- libtool~ Wed Mar 7 22:45:42 2012
++++ libtool Wed Mar 7 22:53:01 2012
@@ -237,7 +237,7 @@
finish_eval=""
@@ -8,4 +8,17 @@
+hardcode_into_libs=no
# Compile-time system search path for libraries.
- sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_search_path_spec="/root/src/illumos-live/proto/usr/sfw/lib/gcc/i386-pc-solaris2.11/4.4.4/amd64 /root/src/illumos-live/proto/usr/sfw/lib/gcc /root/src/illumos-live/proto/usr/sfw/lib/amd64 /lib/amd64 /usr/lib/amd64"
+@@ -5101,6 +5101,12 @@
+ esac
+ continue
+ ;;
++
++ -nodefaultlibs)
++ allow_undefined=no
++ compiler_flags="$compiler_flags $func_quote_for_eval_result"
++ continue
++ ;;
+
+ -no-undefined)
+ allow_undefined=no
View
6 libz/Makefile
@@ -41,7 +41,8 @@ all: real-all
all32: $(VER)/zconf.h
(cd $(VER); env "CC=$(GCC) -fPIC" \
- "LDSHARED=$(GCC) -shared -fPIC -Wl,-h,libz.so.1 -Wl,-z,defs -Wl,-z,text -Wl,-z,combreloc -Wl,-M,../mapfile -L. -lc" \
+ "LDFLAGS= -lc -lz" \
+ "LDSHARED=$(GCC) -fno-builtin -nodefaultlibs -shared -fPIC -Wl,-h,libz.so.1 -Wl,-z,defs -Wl,-z,text -Wl,-z,combreloc -Wl,-M,../mapfile -L. -lc" \
PATH=$(DESTDIR)/usr/sfw/bin/:$(PATH) \
make -e $(PARALLEL))
@@ -51,7 +52,8 @@ all32: $(VER)/zconf.h
all64: $(VER64)/zconf.h
(cd $(VER64); env "CC=$(GCC) -m64 -fPIC" \
- "LDSHARED=$(GCC) -m64 -shared -fPIC -Wl,-h,libz.so.1 -Wl,-z,defs -Wl,-z,text -Wl,-z,combreloc -Wl,-M,../mapfile -L. -lc" \
+ "LDFLAGS=-nodefaultlibs -lc -lz" \
+ "LDSHARED=$(GCC) -m64 -fno-builtin -nodefaultlibs -shared -fPIC -Wl,-h,libz.so.1 -Wl,-z,defs -Wl,-z,text -Wl,-z,combreloc -Wl,-M,../mapfile -L. -lc" \
PATH=$(DESTDIR)/usr/sfw/bin/:$(PATH) \
make -e $(PARALLEL))

0 comments on commit aca4b67

Please sign in to comment.