From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Newsgroups: gmane.emacs.bugs Subject: bug#37483: [PATCH] macOS build error (aligned_alloc) Date: Tue, 24 Sep 2019 13:08:41 +0200 Message-ID: <1BCE5F0D-AC05-4301-9D5C-F5AA6B283C33@acm.org> References: Mime-Version: 1.0 (Mac OS X Mail 12.4 \(3445.104.11\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="13815"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37483@debbugs.gnu.org, Alan Third To: Paul Eggert Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Sep 24 13:09:25 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1iCih9-0003Sb-6C for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Sep 2019 13:09:23 +0200 Original-Received: from localhost ([::1]:43946 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCih7-00011q-MO for geb-bug-gnu-emacs@m.gmane.org; Tue, 24 Sep 2019 07:09:21 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39479) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iCigq-00011Q-MW for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2019 07:09:05 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iCigp-0003AM-D2 for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2019 07:09:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1iCigo-0003AA-Un for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2019 07:09:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1iCigo-0004Vs-LW for bug-gnu-emacs@gnu.org; Tue, 24 Sep 2019 07:09:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 24 Sep 2019 11:09:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37483 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 37483-submit@debbugs.gnu.org id=B37483.156932334117333 (code B ref 37483); Tue, 24 Sep 2019 11:09:02 +0000 Original-Received: (at 37483) by debbugs.gnu.org; 24 Sep 2019 11:09:01 +0000 Original-Received: from localhost ([127.0.0.1]:37805 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCigm-0004VP-6X for submit@debbugs.gnu.org; Tue, 24 Sep 2019 07:09:00 -0400 Original-Received: from mail208c50.megamailservers.eu ([91.136.10.218]:43388 helo=mail194c50.megamailservers.eu) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1iCigi-0004UO-NK; Tue, 24 Sep 2019 07:08:57 -0400 X-Authenticated-User: mattiase@bredband.net DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=megamailservers.eu; s=maildub; t=1569323325; bh=cMf2QDOaoN/7uZYJH6unIEuHuYYeFM+IFEbBph61jwk=; h=Subject:From:In-Reply-To:Date:Cc:References:To:From; b=bZgSzBn4NscaYIaC4pO1he6UhUMjz63lepUx7EdU6HuUUt00bOYDukV4zDK8PC9zc VD5hTqKWUuhgugPAYVgFBVSQnJ4JY8r9Cgv020xeO2HHGmb37jFvJMrQDOKV8W8sQ/ aj9HGxF4xV9cK9VHPse58zd7VBJQ4JRrXbR08USM= Feedback-ID: mattiase@acm.or Original-Received: from [192.168.0.4] ([188.150.171.71]) (authenticated bits=0) by mail194c50.megamailservers.eu (8.14.9/8.13.1) with ESMTP id x8OB8f8f026635; Tue, 24 Sep 2019 11:08:43 +0000 In-Reply-To: X-Mailer: Apple Mail (2.3445.104.11) X-CTCH-RefID: str=0001.0A0B0213.5D89F93C.0063, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0 X-CTCH-VOD: Unknown X-CTCH-Spam: Unknown X-CTCH-Score: 0.000 X-CTCH-Flags: 0 X-CTCH-ScoreCust: 0.000 X-CSC: 0 X-CHA: v=2.3 cv=e954tph/ c=1 sm=1 tr=0 a=SF+I6pRkHZhrawxbOkkvaA==:117 a=SF+I6pRkHZhrawxbOkkvaA==:17 a=jpOVt7BSZ2e4Z31A5e1TngXxSK0=:19 a=kj9zAlcOel0A:10 a=M51BFTxLslgA:10 a=nZinARN1AhPOsy64iOcA:9 a=CjuIK1q_8ugA:10 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:167091 Archived-At: tags 37483 notabug close 37483 stop 23 sep. 2019 kl. 22.02 skrev Paul Eggert : >=20 > I'm not seeing why this patch is needed. If you build with tools that = expect a macOS version N library, Emacs can't be expected to run on a = system that has older libraries. I don't think it's accurate to say that the tools expect a macOS 10.15 = library; they are perfectly able to build code for 10.14, and that is = the default when running on such a system. Since aligned_alloc will be = available in 10.15, the header file contains an annotated prototype of = that function, so that the compiler can warn on attempts to use it when = building for 10.14: conftest.c:151:9: warning: 'aligned_alloc' is only available on macOS = 10.15 or newer [-Wunguarded-availability-new] = /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Devel= oper/SDKs/MacOSX.sdk/usr/include/malloc/_malloc.h:50:10: note: = 'aligned_alloc' has been marked as being introduced in macOS 10.15 here, = but the deployment target is macOS 10.14.0 AC_CHECK_FUNCS supplies a made-up prototype for aligned_alloc instead of = including , and then compilation and linking will proceed = without diagnostics. The run-time linker will complain and abort. However, I followed Alan's advice and used 'xcode-select --install' to = install SDKs specifically for 10.14, and now clang uses a different = header file tree that does not include aligned_alloc at all. I'm happy, = because the compiler and associated tools are still of version 11. I = must admit I'm not entirely sure how about the exact mechanics behind it = all; 'xcode-select -p' still returns the same path, but the compiler now = uses headers from /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk. At any rate, it's good enough to withdraw the patch for now. Thank you = for your patience. > Put it another way: if we install this patch, for consistency = shouldn't we install a similar patch for every other function that = 'configure' checks for, and have 'configure' do a run-time test instead = of just a link-time test for the function? That's a legitimate question. AC_CHECK_FUNCS & friends make Unix-centric = assumptions that aren't correct in all build environments, but not = running a test binary is slightly faster and makes cross-builds easier. (Should you ever consider replacing autoconf for Emacs with something = faster, you will find in me a fervent supporter.)