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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 40205 in the body.
You can then email your comments to 40205 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#40205; Package emacs. (Tue, 24 Mar 2020 03:15:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 24 Mar 2020 03:15:01 GMT) Full text and rfc822 format available.

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

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40205; Package emacs. (Wed, 25 Mar 2020 02:59:02 GMT) Full text and rfc822 format available.

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

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 <at> debbugs.gnu.org
Subject: Re: 32bit or LTO movemail build fails on macOS
Date: Tue, 24 Mar 2020 19:58:19 -0700
[Message part 1 (text/plain, inline)]
Thanks for the bug report. Does the attached patch to getopt-pfx-core.h fix the 
bug for you?

I'll CC: this to bug-gnulib and to Zack Weinberg, who wrote that file. For those 
new to this thread, please see <https://bugs.gnu.org/40205>.
[getopt-apple.diff (text/x-patch, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40205; Package emacs. (Wed, 25 Mar 2020 04:08:02 GMT) Full text and rfc822 format available.

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

From: YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, Zack Weinberg <zackw <at> panix.com>,
 40205 <at> debbugs.gnu.org
Subject: Re: 32bit or LTO movemail build fails on macOS
Date: Wed, 25 Mar 2020 13:07:39 +0900
On Wed, 25 Mar 2020 11:58:19 +0900,
Paul Eggert wrote:
> 
> Thanks for the bug report. Does the attached patch to
> getopt-pfx-core.h fix the bug for you?

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

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#40205; Package emacs. (Wed, 25 Mar 2020 13:15:01 GMT) Full text and rfc822 format available.

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

From: Zack Weinberg <zackw <at> panix.com>
To: Paul Eggert <eggert <at> cs.ucla.edu>
Cc: Gnulib bugs <bug-gnulib <at> gnu.org>, 40205 <at> debbugs.gnu.org,
 YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>
Subject: Re: 32bit or LTO movemail build fails on macOS
Date: Wed, 25 Mar 2020 09:14:29 -0400
On Tue, Mar 24, 2020 at 10:58 PM Paul Eggert <eggert <at> cs.ucla.edu> wrote:
>
> Thanks for the bug report. Does the attached patch to getopt-pfx-core.h fix the
> bug for you?
>
> I'll CC: this to bug-gnulib and to Zack Weinberg, who wrote that file. For those
> new to this thread, please see <https://bugs.gnu.org/40205>.

Patch seems plausible enough to me.  I didn't think very hard about
the ways a system declaration of getopt could interfere when I wrote
this file.

zw




Reply sent to Paul Eggert <eggert <at> cs.ucla.edu>:
You have taken responsibility. (Wed, 25 Mar 2020 20:44:01 GMT) Full text and rfc822 format available.

Notification sent to YAMAMOTO Mitsuharu <mituharu <at> math.s.chiba-u.ac.jp>:
bug acknowledged by developer. (Wed, 25 Mar 2020 20:44:01 GMT) Full text and rfc822 format available.

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

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.




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

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

Previous Next


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