Skip to content

Commit

Permalink
HVM-725 KVM VMs can't boot due to missing libgcc_s.so.1
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSonnenschein committed Mar 9, 2012
1 parent 1ade91c commit aca4b67
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 7 deletions.
9 changes: 7 additions & 2 deletions libxml/Makefile
Expand Up @@ -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
Expand All @@ -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
Expand Down
19 changes: 16 additions & 3 deletions 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=""

Expand All @@ -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
6 changes: 4 additions & 2 deletions libz/Makefile
Expand Up @@ -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))

Expand All @@ -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))

Expand Down

0 comments on commit aca4b67

Please sign in to comment.