From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:49203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axOW8-0005Z1-MJ for qemu-devel@nongnu.org; Mon, 02 May 2016 20:48:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axOVw-00054m-SE for qemu-devel@nongnu.org; Mon, 02 May 2016 20:48:43 -0400 From: Christopher Friedt Date: Mon, 2 May 2016 20:47:57 -0400 Message-Id: <1462236478-61645-2-git-send-email-chrisfriedt@gmail.com> In-Reply-To: <1462236478-61645-1-git-send-email-chrisfriedt@gmail.com> References: <1462236478-61645-1-git-send-email-chrisfriedt@gmail.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------2.6.4 (Apple Git-63)" Subject: [Qemu-devel] [PATCH 1/2] Use libtool instead of ar to create static libraries on Darwin. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: famz@redhat.com, mst@redhat.com Cc: Christopher Friedt , qemu-devel@nongnu.org, qemu-trivial@nongnu.org This is a multi-part message in MIME format. --------------2.6.4 (Apple Git-63) Content-Type: text/plain; charset=UTF-8; format=fixed Content-Transfer-Encoding: 8bit Currently, at least on Mac OS X 10.11.4 (El Capitan), Qemu fails to build for a few reasons. One of those reasons is that Apple's ld (at least ld64) does not properly process archive files created with ar (even Apple's ar). After some RTFM'ing, I came upon this tidbit, which is unfortunate. Luckily, autotools packages are not broken. "Libtool with -static is intended to replace ar(5) and ranlib." http://www.manpages.info/macosx/libtool.1.html In any case, this change takes Apple's recommendations into account and allows Qemu to build on Mac OS X El Capitan. Signed-off-by: Christopher Friedt --- rules.mak | 4 ++++ 1 file changed, 4 insertions(+) --------------2.6.4 (Apple Git-63) Content-Type: text/x-patch; name="0001-Use-libtool-instead-of-ar-to-create-static-libraries.patch" Content-Transfer-Encoding: 8bit Content-Disposition: inline; filename="0001-Use-libtool-instead-of-ar-to-create-static-libraries.patch" diff --git a/rules.mak b/rules.mak index d1ff311..44421af 100644 --- a/rules.mak +++ b/rules.mak @@ -105,7 +105,11 @@ modules: $(call LINK,$(filter %.o %.a %.mo, $^)) %.a: +ifeq ($(shell uname),Darwin) + $(call quiet-command,rm -f $@ && libtool -static -o $@ $^," libtool $(TARGET_DIR)$@") +else $(call quiet-command,rm -f $@ && $(AR) rcs $@ $^," AR $(TARGET_DIR)$@") +endif quiet-command = $(if $(V),$1,$(if $(2),@echo $2 && $1, @$1)) --------------2.6.4 (Apple Git-63)--