All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin.
@ 2016-05-03  1:10 Christopher Friedt
  2016-05-03  7:06 ` Richard Henderson
  2016-09-14  7:30 ` Michael Tokarev
  0 siblings, 2 replies; 8+ messages in thread
From: Christopher Friedt @ 2016-05-03  1:10 UTC (permalink / raw)
  To: famz, mst; +Cc: Christopher Friedt, qemu-devel, qemu-trivial

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 <chrisfriedt@gmail.com>
---
 rules.mak | 4 ++++
 1 file changed, 4 insertions(+)

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:
+ifdef CONFIG_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)

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2016-09-20 17:59 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-03  1:10 [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin Christopher Friedt
2016-05-03  7:06 ` Richard Henderson
2016-05-03 13:50   ` Christopher Friedt
2016-05-03 14:12     ` Peter Maydell
2016-05-04  0:07     ` Christopher Friedt
2016-05-04  9:03       ` Peter Maydell
2016-09-14  7:30 ` Michael Tokarev
2016-09-20 17:58   ` Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.