Subject: 27.0.50; linking error in git head on macos: _freea in libgnu

From: Sam Steingold <[email-masked]>
Date: Mon, 24 Jun 2019 10:41:13 -0400

"make bootstrap" fails with:

--8<---------------cut here---------------start------------->8---
  CCLD     temacs
Undefined symbols for architecture x86_64:
  "_freea", referenced from:
      _rpl_realpath in libgnu.a(canonicalize-lgpl.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [temacs] Error 1
make[1]: *** [src] Error 2
make: *** [bootstrap] Error 2
--8<---------------cut here---------------end--------------->8---

when I comment out HAVE_ALIGNED_ALLOC, HAVE_ALLOCA, HAVE_ALLOCA_H,
HAVE_DECL_ALIGNED_ALLOC in config.h, the error becomes

--8<---------------cut here---------------start------------->8---
  CCLD     temacs
Undefined symbols for architecture x86_64:
  "_mmalloca", referenced from:
      _rpl_realpath in libgnu.a(canonicalize-lgpl.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[1]: *** [temacs] Error 1
make: *** [src] Error 2
--8<---------------cut here---------------end--------------->8---

This is, apparently, related to bug#36172.

As suggested there, I tried
`make bootstrap CC="gcc -mmacosx-version-min=10.14"`
and got the same _freea error.

I also got these warnings:

--8<---------------cut here---------------start------------->8---
  CC       alloc.o
../../src/alloc.c:1134:22: warning: 'aligned_alloc' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
      abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES);
                     ^~~~~~~~~~~~~
/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(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
         ^
../../src/alloc.c:1134:22: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
      abase = base = aligned_alloc (BLOCK_ALIGN, ABLOCKS_BYTES);
                     ^~~~~~~~~~~~~
../../src/alloc.c:1288:12: warning: 'aligned_alloc' is only available on macOS 10.15 or newer [-Wunguarded-availability-new]
    return aligned_alloc (LISP_ALIGNMENT, size);
           ^~~~~~~~~~~~~
/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(2) __OSX_AVAILABLE(10.15) __IOS_AVAILABLE(13.0) __TVOS_AVAILABLE(13.0) __WATCHOS_AVAILABLE(6.0);
         ^
../../src/alloc.c:1288:12: note: enclose 'aligned_alloc' in a __builtin_available check to silence this warning
    return aligned_alloc (LISP_ALIGNMENT, size);
           ^~~~~~~~~~~~~
2 warnings generated.
--8<---------------cut here---------------end--------------->8---

In GNU Emacs 27.0.50 (build 1, x86_64-apple-darwin18.6.0, NS appkit-1671.50 Version 10.14.5 (Build 18F203))
 of 2019-06-17 built on BZ-C02XR5CGJG5L
Repository revision: a07c647a2a0426e3e7380d279f4d469fcd3e913c
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

-- 
Sam Steingold (http://sds.podval.org/) on darwin Ns 10.3.1671
http://childpsy.net http://calmchildstories.com http://steingoldpsychology.com
http://camera.org http://www.dhimmitude.org http://thereligionofpeace.com
My other CAR is a CDR.