GNU bug report logs - #36356
27.0.50; linking error in git head on macos: _freea in libgnu

Previous Next

Package: emacs;

Reported by: sds <at> gnu.org

Date: Mon, 24 Jun 2019 14:42:01 UTC

Severity: normal

Found in version 27.0.50

Done: Stefan Kangas <stefan <at> marxist.se>

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 36356 in the body.
You can then email your comments to 36356 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#36356; Package emacs. (Mon, 24 Jun 2019 14:42:01 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. (Mon, 24 Jun 2019 14:42:01 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: _freea in libgnu
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.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36356; Package emacs. (Mon, 24 Jun 2019 15:02:02 GMT) Full text and rfc822 format available.

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

From: "Basil L. Contovounesios" <contovob <at> tcd.ie>
To: Sam Steingold <sds <at> gnu.org>
Cc: 36356 <at> debbugs.gnu.org
Subject: Re: bug#36356: 27.0.50;
 linking error in git head on macos: _freea in libgnu
Date: Mon, 24 Jun 2019 16:01:46 +0100
Sam Steingold <sds <at> gnu.org> writes:

> "make bootstrap" fails with:
>
>   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

See also:
https://lists.gnu.org/archive/html/emacs-devel/2019-06/msg00899.html

-- 
Basil




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36356; Package emacs. (Mon, 24 Jun 2019 15:04:02 GMT) Full text and rfc822 format available.

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Sam Steingold <sds <at> gnu.org>
Cc: Daniel Colascione <dancol <at> dancol.org>, 36356 <at> debbugs.gnu.org
Subject: Re: bug#36356: 27.0.50;
 linking error in git head on macos: _freea in libgnu
Date: Mon, 24 Jun 2019 17:02:58 +0200
>>>>> On Mon, 24 Jun 2019 10:41:13 -0400, Sam Steingold <sds <at> gnu.org> said:

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

I think you'll find the following works better as a temporary workaround:

$ diff -u gnulib.mk gnulib.mk.new
--- gnulib.mk	2019-06-24 17:01:19.655623952 +0200
+++ gnulib.mk.new	2019-06-24 16:05:31.629871485 +0200
@@ -1998,10 +1998,8 @@
 ## begin gnulib module malloca
 ifeq (,$(OMIT_GNULIB_MODULE_malloca))

-ifneq (,$(gl_GNULIB_ENABLED_malloca))
 libgnu_a_SOURCES += malloca.c

-endif
 EXTRA_DIST += malloca.h

 endif




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#36356; Package emacs. (Mon, 24 Jun 2019 15:29:02 GMT) Full text and rfc822 format available.

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

From: Sam Steingold <sds <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: Daniel Colascione <dancol <at> dancol.org>, 36356 <at> debbugs.gnu.org
Subject: Re: bug#36356: 27.0.50;
 linking error in git head on macos: _freea in libgnu
Date: Mon, 24 Jun 2019 11:28:26 -0400
Thanks, but `make` now fails with

/Library/Developer/CommandLineTools/usr/bin/make -C ../lisp update-subdirs

cp -f temacs bootstrap-emacs
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[1]: *** [bootstrap-emacs.pdmp] Abort trap: 6
make: *** [src] Error 2

(while `make bootstrap` rewrites gnulib.mk)
When I disable _aligned_alloc in config.h, I get the _freea failure:


  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[1]: *** [temacs] Error 1
make: *** [src] Error 2




On Mon, 24 Jun 2019 at 11:03, Robert Pluim <rpluim <at> gmail.com> wrote:
>
> >>>>> On Mon, 24 Jun 2019 10:41:13 -0400, Sam Steingold <sds <at> gnu.org> said:
>
>     Sam> "make bootstrap" fails with:
>     Sam>   CCLD     temacs
>     Sam> Undefined symbols for architecture x86_64:
>     Sam>   "_freea", referenced from:
>     Sam>       _rpl_realpath in libgnu.a(canonicalize-lgpl.o)
>     Sam> ld: symbol(s) not found for architecture x86_64
>     Sam> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>     Sam> make[2]: *** [temacs] Error 1
>     Sam> make[1]: *** [src] Error 2
>     Sam> make: *** [bootstrap] Error 2
>
> I think you'll find the following works better as a temporary workaround:
>
> $ diff -u gnulib.mk gnulib.mk.new
> --- gnulib.mk   2019-06-24 17:01:19.655623952 +0200
> +++ gnulib.mk.new       2019-06-24 16:05:31.629871485 +0200
> @@ -1998,10 +1998,8 @@
>  ## begin gnulib module malloca
>  ifeq (,$(OMIT_GNULIB_MODULE_malloca))
>
> -ifneq (,$(gl_GNULIB_ENABLED_malloca))
>  libgnu_a_SOURCES += malloca.c
>
> -endif
>  EXTRA_DIST += malloca.h
>
>  endif



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




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

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

From: Robert Pluim <rpluim <at> gmail.com>
To: Sam Steingold <sds <at> gnu.org>
Cc: 36356 <at> debbugs.gnu.org
Subject: Re: bug#36356: 27.0.50;
 linking error in git head on macos: _freea in libgnu
Date: Tue, 25 Jun 2019 18:58:56 +0200
>>>>> On Mon, 24 Jun 2019 17:02:58 +0200, Robert Pluim <rpluim <at> gmail.com> said:

>>>>> On Mon, 24 Jun 2019 10:41:13 -0400, Sam Steingold <sds <at> gnu.org> said:
    Sam> "make bootstrap" fails with:
    Sam> CCLD     temacs
    Sam> Undefined symbols for architecture x86_64:
    Sam> "_freea", referenced from:
    Sam> _rpl_realpath in libgnu.a(canonicalize-lgpl.o)
    Sam> ld: symbol(s) not found for architecture x86_64
    Sam> clang: error: linker command failed with exit code 1 (use -v to see invocation)
    Sam> make[2]: *** [temacs] Error 1
    Sam> make[1]: *** [src] Error 2
    Sam> make: *** [bootstrap] Error 2

Paul's commit 848ff94b45 on master has fixed this for me.

Robert




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

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

From: Bruno Haible <bruno <at> clisp.org>
To: sds <at> gnu.org
Cc: 36356 <at> debbugs.gnu.org, Daniel Colascione <dancol <at> dancol.org>,
 bug-gnulib <at> gnu.org
Subject: Re: macosx linking fails: _freea referenced from: _rpl_realpath
Date: Tue, 25 Jun 2019 22:31:06 +0200
Sam Steingold wrote:
> I re-run gnulib-tool and it fixed it.
> (alas, emacs maintainers pushed the changes before me ;-)

So, what was the cause? What can be done to avoid similar errors in the future?

When I look at the history of emacs/lib/gnulib.mk.in, it looks like
(1) there was a change that added dependencies to canonicalize-lgpl and malloca
    yesterday, but it did NOT add the variable gl_GNULIB_ENABLED_malloca.
(2) Paul regenerated it again, which added the variable gl_GNULIB_ENABLED_malloca.

(1) apparently introduced the problem that Sam reported. (2) fixed it.

Daniel, do you have an idea why your tooling created an incomplete
emacs/lib/gnulib.mk.in, that you then checked in?

Bruno





Reply sent to Stefan Kangas <stefan <at> marxist.se>:
You have taken responsibility. (Wed, 02 Oct 2019 23:50:01 GMT) Full text and rfc822 format available.

Notification sent to sds <at> gnu.org:
bug acknowledged by developer. (Wed, 02 Oct 2019 23:50:02 GMT) Full text and rfc822 format available.

Message #25 received at 36356-done <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Sam Steingold <sds <at> gnu.org>
Cc: 36356-done <at> debbugs.gnu.org
Subject: Re: bug#36356: 27.0.50;
 linking error in git head on macos: _freea in libgnu
Date: Thu, 3 Oct 2019 01:49:18 +0200
Robert Pluim <rpluim <at> gmail.com> writes:

>>>>>> On Mon, 24 Jun 2019 17:02:58 +0200, Robert Pluim <rpluim <at> gmail.com> said:
>
>>>>>> On Mon, 24 Jun 2019 10:41:13 -0400, Sam Steingold <sds <at> gnu.org> said:
>     Sam> "make bootstrap" fails with:
>     Sam> CCLD     temacs
>     Sam> Undefined symbols for architecture x86_64:
>     Sam> "_freea", referenced from:
>     Sam> _rpl_realpath in libgnu.a(canonicalize-lgpl.o)
>     Sam> ld: symbol(s) not found for architecture x86_64
>     Sam> clang: error: linker command failed with exit code 1 (use -v to see invocation)
>     Sam> make[2]: *** [temacs] Error 1
>     Sam> make[1]: *** [src] Error 2
>     Sam> make: *** [bootstrap] Error 2
>
> Paul's commit 848ff94b45 on master has fixed this for me.

It looks like this has been fixed, so I'm closing this now.

If this is still an issue, please reopen.

Best regards,
Stefan Kangas




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 31 Oct 2019 11:24:07 GMT) Full text and rfc822 format available.

This bug report was last modified 4 years and 172 days ago.

Previous Next


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