GNU bug report logs - #36172
27.0.50; linking error in git head on macos: _aligned_alloc

Previous Next

Package: emacs;

Reported by: sds <at> gnu.org

Date: Tue, 11 Jun 2019 15:51:02 UTC

Severity: normal

Tags: notabug

Merged with 40741

Found in version 27.0.50

Done: Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 36172 in the body.
You can then email your comments to 36172 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 15:51:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to sds <at> gnu.org:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 11 Jun 2019 15:51:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Sam Steingold <sds <at> gnu.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 11:49:21 -0400
make bootstrap fails with:

--8<---------------cut here---------------start------------->8---
rm -f bootstrap-emacs.pdmp
./temacs --batch  -l loadup --temacs=pbootstrap
dyld: lazy symbol binding failed: Symbol not found: _aligned_alloc
  Referenced from: /Users/sam.steingold/src/emacs/trunk/build/src/./temacs
  Expected in: /usr/lib/libSystem.B.dylib

dyld: Symbol not found: _aligned_alloc
  Referenced from: /Users/sam.steingold/src/emacs/trunk/build/src/./temacs
  Expected in: /usr/lib/libSystem.B.dylib

make[2]: *** [bootstrap-emacs.pdmp] Abort trap: 6
--8<---------------cut here---------------end--------------->8---


In GNU Emacs 27.0.50 (build 7, x86_64-apple-darwin18.6.0, NS appkit-1671.50 Version 10.14.5 (Build 18F203))
 of 2019-06-05 built on BZ-C02XR5CGJG5L
Repository revision: 7ad5e3915fe0fad7c8053b53cab1aa7aa74193fe
Repository branch: master
Windowing system distributor 'Apple', version 10.3.1671
System Description:  Mac OS X 10.14.5

Configured using:
 'configure --with-mailutils --with-ns
 PKG_CONFIG_PATH=/usr/local/opt/libxml2/lib/pkgconfig:/usr/local/opt/imagemagick/lib/pkgconfig:/usr/local/opt/gnutls/lib/pkgconfig:/usr/local/opt/jansson/lib/pkgconfig'

Configured features:
NOTIFY KQUEUE ACL GNUTLS LIBXML2 ZLIB TOOLKIT_SCROLL_BARS NS THREADS
JSON PDUMPER LCMS2 GMP

Important settings:
  value of $LANG: C
  locale-coding-system: utf-8-unix

Load-path shadows:
None found.

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1671
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
http://memri.org http://islamexposedonline.com http://mideasttruth.com
DRM "access management" == prison "freedom management".




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 17:38:02 GMT) Full text and rfc822 format available.

Message #8 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: sds <at> gnu.org
Cc: 36172 <at> debbugs.gnu.org
Subject: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 10:37:41 -0700
This vaguely looks like the configure-time check for aligned_alloc 
disagrees with what's actually installed in your runtime library. If 
your runtime library is older than what you built Emacs with, that might 
explain the problem.

What are the values of HAVE_ALIGNED_ALLOC, HYBRID_MALLOC, 
HAVE_POSIX_MEMALIGN, SYSTEM_MALLOC, and DOUG_LEA_MALLOC in your 
src/config.h file? Do these values correspond to what is actually on 
your system?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 18:22:01 GMT) Full text and rfc822 format available.

Message #11 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Sam Steingold <sds <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 36172 <at> debbugs.gnu.org
Subject: Re: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 14:20:44 -0400
On Tue, 11 Jun 2019 at 13:37, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
> This vaguely looks like the configure-time check for aligned_alloc
> disagrees with what's actually installed in your runtime library. If
> your runtime library is older than what you built Emacs with, that might
> explain the problem.

I see this after make bootstrap, so the configure was run just now.

> What are the values of HAVE_ALIGNED_ALLOC, HYBRID_MALLOC,
> HAVE_POSIX_MEMALIGN, SYSTEM_MALLOC, and DOUG_LEA_MALLOC in your
> src/config.h file?

here are the relevant parts of config.h:

#define HAVE_ALIGNED_ALLOC 1
#define HAVE_DECL_ALIGNED_ALLOC 1
/* #undef HYBRID_MALLOC */
/* #undef HAVE_POSIX_MEMALIGN */
#define SYSTEM_MALLOC 1
/* #undef DOUG_LEA_MALLOC */



>  Do these values correspond to what is actually on
> your system?

how do I find that out?

Darwin BZ-C02XR5CGJG5L 18.6.0 Darwin Kernel Version 18.6.0: Thu Apr 25
23:16:27 PDT 2019; root:xnu-4903.261.4~2/RELEASE_X86_64 x86_64



-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 20:09:02 GMT) Full text and rfc822 format available.

Message #14 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Sam Steingold <sds <at> gnu.org>
Cc: 36172 <at> debbugs.gnu.org
Subject: Re: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 13:08:15 -0700
'configure' says you have aligned_alloc, because it successfully built 
an executable that calls aligned_alloc. However, the dynamic linker 
fails, in that when temacs runs and calls aligned_alloc, its dynamic 
linker fails to find an implementation. Please figure out why that is. 
For example, you can compile and run this program with the same flags 
you use to compile Emacs:

  #include <stdlib.h>

  int
  main (int argc, char **argv)
  {
    char *p = aligned_alloc (8, 1);
    char *q = aligned_alloc (8, 2);
    return p && q && p == q;
  }

If it compiles and runs successfully, you can then investigate why it 
works but temacs doesn't. Otherwise, you can investigate why it doesn't 
work.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 20:15:01 GMT) Full text and rfc822 format available.

Message #17 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Sam Steingold <sds <at> gnu.org>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: 36172 <at> debbugs.gnu.org
Subject: Re: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 16:14:25 -0400
$ gcc e.c
e.c:6:13: warning: 'aligned_alloc' is only available on macOS 10.15 or newer
      [-Wunguarded-availability-new]
  char *p = aligned_alloc (8, 1);
            ^~~~~~~~~~~~~
/Library/Developer/CommandLineTools/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
void    *aligned_alloc(size_t __alignment, size_t __size)
__result_use_check __alloc_size(...
         ^
e.c:6:13: note: enclose 'aligned_alloc' in a __builtin_available check
to silence this warning
  char *p = aligned_alloc (8, 1);
            ^~~~~~~~~~~~~
e.c:7:13: warning: 'aligned_alloc' is only available on macOS 10.15 or newer
      [-Wunguarded-availability-new]
  char *q = aligned_alloc (8, 2);
            ^~~~~~~~~~~~~
/Library/Developer/CommandLineTools/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
void    *aligned_alloc(size_t __alignment, size_t __size)
__result_use_check __alloc_size(...
         ^
e.c:7:13: note: enclose 'aligned_alloc' in a __builtin_available check
to silence this warning
  char *q = aligned_alloc (8, 2);
            ^~~~~~~~~~~~~
2 warnings generated.

my system is 10.14.5

On Tue, 11 Jun 2019 at 16:08, Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
> 'configure' says you have aligned_alloc, because it successfully built
> an executable that calls aligned_alloc. However, the dynamic linker
> fails, in that when temacs runs and calls aligned_alloc, its dynamic
> linker fails to find an implementation. Please figure out why that is.
> For example, you can compile and run this program with the same flags
> you use to compile Emacs:
>
>    #include <stdlib.h>
>
>    int
>    main (int argc, char **argv)
>    {
>      char *p = aligned_alloc (8, 1);
>      char *q = aligned_alloc (8, 2);
>      return p && q && p == q;
>    }
>
> If it compiles and runs successfully, you can then investigate why it
> works but temacs doesn't. Otherwise, you can investigate why it doesn't
> work.
>


-- 
Sam Steingold <http://sds.podval.org> <http://www.childpsy.net>
<http://steingoldpsychology.com>




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Tue, 11 Jun 2019 21:18:03 GMT) Full text and rfc822 format available.

Message #20 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Paul Eggert <eggert <at> cs.ucla.edu>
To: Sam Steingold <sds <at> gnu.org>
Cc: 36172 <at> debbugs.gnu.org
Subject: Re: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Tue, 11 Jun 2019 14:17:47 -0700
On 6/11/19 1:14 PM, Sam Steingold wrote:
> $ gcc e.c
> e.c:6:13: warning: 'aligned_alloc' is only available on macOS 10.15 or newer
>        [-Wunguarded-availability-new]
>    char *p = aligned_alloc (8, 1);
>              ^~~~~~~~~~~~~

So your include files declare alloc_aligned and it links, but it doesn't 
run? Sounds like your development environment is messed up.

You might try running the shell command 'xcode-select --install'; this 
solved a similar problem when building Ruby, as described in 
<https://github.com/rbenv/ruby-build/issues/1133>.

Or you might try configuring with flags that say "build for the macOS 
I'm currently running, not for some future version of macOS". Perhaps 
something like "-mmacosx-version-min=10.14"? I don't use macOS so I'm 
afraid you may have to do some research here. 
<https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15518> may help you 
get started.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36172; Package emacs. (Sun, 04 Aug 2019 07:17:02 GMT) Full text and rfc822 format available.

Message #23 received at 36172 <at> debbugs.gnu.org (full text, mbox):

From: Keith Irwin <keith <at> zentrope.com>
To: 36172 <at> debbugs.gnu.org
Subject: Re: 27.0.50; linking error in git head on macos: _aligned_alloc
Date: Sun, 4 Aug 2019 00:15:56 -0700
For what it’s worth, I had the same issue when xcode-select used Xcode 11 beta 5 on Mojave 10.14.6.

     $ sudo xcode-select -s /Applications/Xcode.app #  (Version 10.3)

and then a new ./configure solved the problem for me.






Merged 36172 40741. Request was from Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> to control <at> debbugs.gnu.org. (Thu, 23 Apr 2020 13:06:02 GMT) Full text and rfc822 format available.

Added tag(s) notabug. Request was from Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> to control <at> debbugs.gnu.org. (Thu, 23 Apr 2020 13:06:02 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 40741 <at> debbugs.gnu.org and Tak Kunihiro <homeros.misasa <at> gmail.com> Request was from Tak Kunihiro <tkk <at> misasa.okayama-u.ac.jp> to control <at> debbugs.gnu.org. (Thu, 23 Apr 2020 13:06:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 22 May 2020 11:24:05 GMT) Full text and rfc822 format available.

This bug report was last modified 3 years and 311 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.