From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: paul Newsgroups: gmane.lisp.guile.user Subject: Re: Difficulty integrating with Swift/Objective-C Date: Thu, 09 Sep 2021 09:59:03 +1000 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; format=flowed Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37719"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: mu4e 1.4.15; emacs 27.2 To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Thu Sep 09 01:59:35 2021 Return-path: Envelope-to: guile-user@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mO7Ta-0009cN-Ij for guile-user@m.gmane-mx.org; Thu, 09 Sep 2021 01:59:34 +0200 Original-Received: from localhost ([::1]:56184 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mO7TZ-0007LL-2L for guile-user@m.gmane-mx.org; Wed, 08 Sep 2021 19:59:33 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40856) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mO7TJ-0007LC-ND for guile-user@gnu.org; Wed, 08 Sep 2021 19:59:18 -0400 Original-Received: from aibo.runbox.com ([91.220.196.211]:40638) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mO7TH-000399-Ad for guile-user@gnu.org; Wed, 08 Sep 2021 19:59:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=inktvis.org ; s=selector1; h=Content-Type:MIME-Version:Message-ID:Date:In-reply-to: Subject:To:From:References; bh=MGj4hDPfbRgNLC10utzD/04u6LAnU4Fz8X/Z3PiGePU=; b=at43q6pOkjZZlLQGmX4ckgsZh5mfwxaV6txp02f0xioK20xLT3n5F015bsjhMivktzpjE0/oAF ze0+b26nNG9xQDYDHqBJCuZ+x0s/QLvsBT9WeOM5286G4aADFgbxonjvEMTtKZHVvWczp4qA9BJFQ gi5k0HGLzWUS1IE/UmmZO75cEeix7A8j+ECaPQwfJRycggJqoNoinP1TDwHVrq1bI6K+1gLaVnw8r GFMPRzKl76XEwshYTNu/qHlD3HotVmyPWdG5l+0r4RVG8XSDc32BCzR2KMWwVPuAUIbftlR9i75vy c3+C1/44Do3v0fTucHVubJ64gOEMoVtOsCznA==; Original-Received: from [10.9.9.72] (helo=submission01.runbox) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1mO7TD-0000Re-Gz for guile-user@gnu.org; Thu, 09 Sep 2021 01:59:11 +0200 Original-Received: by submission01.runbox with esmtpsa [Authenticated ID (826552)] (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) id 1mO7TA-0005ZI-DZ for guile-user@gnu.org; Thu, 09 Sep 2021 01:59:09 +0200 In-reply-to: Received-SPF: pass client-ip=91.220.196.211; envelope-from=paul@inktvis.org; helo=aibo.runbox.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane-mx.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.io gmane.lisp.guile.user:17721 Archived-At: I wanted to follow up about another thing: On 2021-09-05 at 16:03 AEST, quoth paul : > I had some difficulty getting my app to compile against Guile, > but i eventually managed to link against a version of Guile > installed with Homebrew (guile: stable 3.0.7 (bottled)), however > when trying to boot it up i seemed to run into the same issue > described by Jeffrey Walton [1]. My app would boot, and as soon > as it hit the Guile initialisation calls, it would error out as > follows: > > allocating JIT code buffer failed: Permission denied > jit.c:5873: fatal: assertion failed > > While the other person seems to imply the problem is with > Apple's M1 silicon, i'm actually running an older machine (2.9 > GHz Dual-Core Intel Core i5, macOS 11.5.2). I then managed to > get further by downloading the Guile release tarball version > 3.0.7 and and building with `./configure --enable-jit=no`;> > > [...] > > 1. https://mail.gnu.org/archive/html/bug-guile/2021-03/msg00012.html It turned out that the JIT issue was _also_ PEBKAC i am glad to report. Completely by accident i happened upon some settings in the Xcode project of my app, under the Target > Signing & Capabilities > Hardened Runtime options. One has to enable the following two items: * Allow execution of JIT-compiled code * Allow unsigned executable memory Those two settings correspond to entries in the .entitlements file as follows: com.apple.security.cs.allow-jit com.apple.security.cs.allow-unsigned-executable-memory Now, the app is able to build and run successfully against the Homebrew-packaged version of Guile - super convenient! I thought i'd post my findings in case someone else hits these issues in the future. Or should i contribute a section to a README somewhere, so that folks don't have to laboriously work this out for themselves every time? Cheers, p.