From patchwork Tue May 3 01:10:52 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Friedt X-Patchwork-Id: 8998411 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id D4F1F9F39D for ; Tue, 3 May 2016 01:11:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 090FF20225 for ; Tue, 3 May 2016 01:11:59 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0BC6E20221 for ; Tue, 3 May 2016 01:11:58 +0000 (UTC) Received: from localhost ([::1]:39360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axOsU-0000ZV-5w for patchwork-qemu-devel@patchwork.kernel.org; Mon, 02 May 2016 21:11:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53460) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axOsE-0000HK-Cq for qemu-devel@nongnu.org; Mon, 02 May 2016 21:11:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1axOs2-0001dD-Le for qemu-devel@nongnu.org; Mon, 02 May 2016 21:11:32 -0400 Received: from mail-ig0-x243.google.com ([2607:f8b0:4001:c05::243]:36765) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1axOs1-0001V8-EB; Mon, 02 May 2016 21:11:26 -0400 Received: by mail-ig0-x243.google.com with SMTP id c3so706678igl.3; Mon, 02 May 2016 18:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=w9+fNwxhld3iZY8m6DAIDXwjqHf4k5YORMcW11n7eBE=; b=dpwsiOWWKjoJ4MwvLKkRA3aO/GL7dhm8mPvfzLdlApjwxmyzdL1ekerHL1MWNwldrI kiaHHltjTOUovSshpscc2r3ChMMMcUmjxoPzq6BiKOrM8bz4Zn/x3cTFtrU6jrqNSUzF 3mwyq36sLpgBCUaVMUNz/058Bm7gSxCSc3pQ+9QBfOGBCLvDv2LA4s2mx907amofAJf/ RoteZ9yIttWnpDQSpJglJ4XVDfcJSSIY84NUTBSI/JXSVuKVHsCEsrEqbiPka6zrGdqk X4Pq+uc36wTfE8D/dv8VhNYY2Oy1mbcv0aRHPx6MG3cDxSBtYYCHhi8OCwOHxILc5nnY rwlw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=w9+fNwxhld3iZY8m6DAIDXwjqHf4k5YORMcW11n7eBE=; b=GEqjnApWQLQ1hD+xdG4v0WyTdNzv7e8TbvOUcEvsVqYvXOY/Q6BqFwP+F25n+KLlOo wpNqrG9g+nDKdrWaAjZjH3I5NFhFxTuGtrBt2o2sRz6sOKasp+YTW5iEQRoUOma1OfFT ARfyeMSfmxgkhZpWqUdq0vsTYHJNARUZG3lEBnx2JaMpQTGjHrjvpyFPfCJfzrYnaQtA DhnSyXKgpKKWL9gXYFJsUU9KW8KxHECbBn2rVGOaP+6RaPaPBJSVmBc9z7aLNelB4x7J RtdagjBCGMvPcHdRAmQeVY3TXozlFQsR6gjSjuNArlHd/Rs0b2yWBWHX6kIBysUblOw/ uOfQ== X-Gm-Message-State: AOPr4FXSMfqXFjRgYgMDAqj3A5CtcPWjmUbdsED5Odfa14n2OARDE94s0Lyu2U+tmMCKVg== X-Received: by 10.50.119.67 with SMTP id ks3mr180351igb.78.1462237853866; Mon, 02 May 2016 18:10:53 -0700 (PDT) Received: from localhost.localdomain (76-10-180-162.dsl.teksavvy.com. [76.10.180.162]) by smtp.gmail.com with ESMTPSA id 11sm831450ioe.25.2016.05.02.18.10.52 (version=TLS1 cipher=AES128-SHA bits=128/128); Mon, 02 May 2016 18:10:53 -0700 (PDT) From: Christopher Friedt To: famz@redhat.com, mst@redhat.com Date: Mon, 2 May 2016 21:10:52 -0400 Message-Id: <1462237852-61856-1-git-send-email-chrisfriedt@gmail.com> X-Mailer: git-send-email 2.6.4 (Apple Git-63) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4001:c05::243 Subject: [Qemu-devel] [PATCH 1/2v2] [RESENT-INLINE] Use libtool instead of ar to create static libraries on Darwin. X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Christopher Friedt , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NORMAL_HTTP_TO_IP, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(+) 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))