From patchwork Fri Aug 14 01:40:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Malcolm X-Patchwork-Id: 507242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3B7FB1401E7 for ; Fri, 14 Aug 2015 11:25:50 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=kSNKxmlf; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; q=dns; s= default; b=tJwfHt0wtBENyTqjWwMtOB1/UhOmT8Q6tWY4G92V2/XgZnmvk7RHB CwqGnIwejOc4wQOHEmpXVRDPH5M7vqulUM/OXq5F5NcpDf/xJHWdPCfNN3KCo7rk h9IZZt06Xuj7+bZrR5cYQIiY9+mzCIAry4e4n/r+d0ITJ4ACM7mnWA= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:in-reply-to:references; s= default; bh=5YEjAfyTNomPqbqAxeuP4MFuF7A=; b=kSNKxmlfjL67ydeEF3Iq jMZpOr8qfaQrHepYpjLQRpvGj7L0cjdA4VjhvRPGYOls5NcjJeOFZBxPRFkiBccB 1aTpCvg9QNklFBGvmIcwNj3QyR2zFsuAp4fnwdld3Ut8+ug4+DwwG/seufllmwoU P0Q16ABxcbVAa76LdqmbmHA= Received: (qmail 55021 invoked by alias); 14 Aug 2015 01:25:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 55003 invoked by uid 89); 14 Aug 2015 01:25:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL, BAYES_00, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD, SPF_HELO_PASS autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 14 Aug 2015 01:25:40 +0000 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (Postfix) with ESMTPS id 98FD937256C; Fri, 14 Aug 2015 01:25:39 +0000 (UTC) Received: from c64.redhat.com (vpn-236-137.phx2.redhat.com [10.3.236.137]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7E1Pcp2031964; Thu, 13 Aug 2015 21:25:38 -0400 From: David Malcolm To: jit@gcc.gnu.org, gcc-patches@gcc.gnu.org Cc: David Malcolm Subject: [PATCH, committed] jit: on OS X, add -Wl, -undefined, dynamic_lookup to driver invocation Date: Thu, 13 Aug 2015 21:40:39 -0400 Message-Id: <1439516439-62360-1-git-send-email-dmalcolm@redhat.com> In-Reply-To: References: X-IsSubscribed: yes Reported as fixing the library on OS X Yosemite: https://gcc.gnu.org/ml/jit/2015-q3/msg00147.html Committed to trunk as r226882. Committed to gcc-5-branch as r226883. gcc/jit/ChangeLog: * jit-playback.c (invoke_driver): On OS X, add "-Wl,-undefined,dynamic_lookup" to the driver arguments. --- gcc/jit/jit-playback.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gcc/jit/jit-playback.c b/gcc/jit/jit-playback.c index 925fa86..01cfd4b 100644 --- a/gcc/jit/jit-playback.c +++ b/gcc/jit/jit-playback.c @@ -2416,6 +2416,15 @@ invoke_driver (const char *ctxt_progname, time. */ ADD_ARG ("-fno-use-linker-plugin"); +#if defined (DARWIN_X86) || defined (DARWIN_PPC) + /* OS X's linker defaults to treating undefined symbols as errors. + If the context has any imported functions or globals they will be + undefined until the .so is dynamically-linked into the process. + Ensure that the driver passes in "-undefined dynamic_lookup" to the + linker. */ + ADD_ARG ("-Wl,-undefined,dynamic_lookup"); +#endif + /* pex argv arrays are NULL-terminated. */ argvec.safe_push (NULL);