GNU bug report logs - #40205
28.0.50; 32bit or LTO movemail build fails on macOS

Previous Next

Package: emacs;

Reported by: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>

Date: Tue, 24 Mar 2020 03:15:01 UTC

Severity: normal

Found in version 28.0.50

Done: Paul Eggert <eggert <at> cs.ucla.edu>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#40205: closed (28.0.50; 32bit or LTO movemail build fails on
 macOS)
Date: Wed, 25 Mar 2020 20:44:01 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 25 Mar 2020 13:43:01 -0700
with message-id <0ee74f51-3c15-d03a-115f-368b26eed046 <at> cs.ucla.edu>
and subject line Re: 32bit or LTO movemail build fails on macOS
has caused the debbugs.gnu.org bug report #40205,
regarding 28.0.50; 32bit or LTO movemail build fails on macOS
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
40205: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=40205
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; 32bit or LTO movemail build fails on macOS
Date: Tue, 24 Mar 2020 12:14:11 +0900
On macOS, movemail cannot be built with CC='cc -arch i386':

    CCLD     movemail
  Undefined symbols for architecture i386:
    "_rpl_getopt$UNIX2003", referenced from:
	_main in movemail-1f1ea0.o
  ld: symbol(s) not found for architecture i386
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [movemail] Error 1
  make: *** [lib-src] Error 2

This is due to the following part in the system getopt.h:

  #ifndef _GETOPT
  #define	_GETOPT
  int	 getopt(int, char * const [], const char *) __DARWIN_ALIAS(getopt);

  extern char *optarg;			/* getopt(3) external variables */
  extern int optind, opterr, optopt;
  #endif

which is expanded to:

  int rpl_getopt(int, char * const [], const char *) __asm("_" "rpl_getopt" "$UNIX2003");

  extern char *rpl_optarg;
  extern int rpl_optind, rpl_opterr, rpl_optopt;

I think the Gnulib getopt does not expect the __asm line above.

64-bit LTO build with CC='cc -flto' fails, too.

    CCLD     movemail
  ld: reference to symbol (which has not been assigned an address) _rpl_getopt in '_main' from /var/folders/69/m7h39yv92g70qy7p3xdlghdm0000gn/T/cc-907a5d.o for architecture x86_64
  clang: error: linker command failed with exit code 1 (use -v to see invocation)
  make[1]: *** [movemail] Error 1
  make: *** [lib-src] Error 2

				     YAMAMOTO Mitsuharu
				mituharu <at> math.s.chiba-u.ac.jp


[Message part 3 (message/rfc822, inline)]
From: Paul Eggert <eggert <at> cs.ucla.edu>
To: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, Zack Weinberg <zackw <at> panix.com>,
 40205-done <at> debbugs.gnu.org
Subject: Re: 32bit or LTO movemail build fails on macOS
Date: Wed, 25 Mar 2020 13:43:01 -0700
On 3/24/20 9:07 PM, YAMAMOTO Mitsuharu wrote:

> Yes, this works for both -arch i386 and -flto cases.

Thanks for checking. I installed the patch into Gnulib and propagated the fix 
into Emacs master, and am marking this Emacs bug as done.


This bug report was last modified 5 years and 93 days ago.

Previous Next


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