From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: dhruva Newsgroups: gmane.emacs.devel Subject: Building Emacs on MacOS with clang+LTO fails Date: Sat, 4 May 2019 11:08:36 -0700 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="000000000000b93d0d058813c3a9" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="120631"; mail-complaints-to="usenet@blaine.gmane.org" To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat May 04 20:09:26 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hMz6D-000VHR-CZ for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 20:09:25 +0200 Original-Received: from localhost ([127.0.0.1]:59637 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMz6C-00053y-BA for ged-emacs-devel@m.gmane.org; Sat, 04 May 2019 14:09:24 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:42269) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hMz64-00051l-30 for emacs-devel@gnu.org; Sat, 04 May 2019 14:09:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hMz63-0004K6-5q for emacs-devel@gnu.org; Sat, 04 May 2019 14:09:16 -0400 Original-Received: from mail-ot1-x32f.google.com ([2607:f8b0:4864:20::32f]:42947) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hMz63-0004Jp-0j for emacs-devel@gnu.org; Sat, 04 May 2019 14:09:15 -0400 Original-Received: by mail-ot1-x32f.google.com with SMTP id f23so8106118otl.9 for ; Sat, 04 May 2019 11:09:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=pV/M1i6i4joAo4Wz7KuhWt0HiRJOSRE2iBvz1Pr9lUQ=; b=IpmTfIc+3/l9HfOLUuIrOdLNrCgoMrxmzpqCEqRvX+yIMLTjODHAfeI1j6jmzoOCp4 hiumYNMBUseyZH3D9U4bdESZQQk6Icg7XXpY6O+uTqVt9CbxMZXxBDJLjuGdaYIWRlGV lGBQ4MeIfmyRG8PO3+lvV6QX2Dh2I67D1WvVfawWp/T4GVonyFHCiGwrLM/DqGMjoOID yaO2L0j/Vc/aBOJfcXltiLcMYEXz8pUR9QkXAjOUrRLun2X/XEj7qq6pTeCQ5IcHulW/ WTZcIDFYNIWP7mT/Gb8R+1jpZN34MnRUVe0EFC2RzHT+IJfS/P3f2IR7+Pv/z/kcX2+l eogw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=pV/M1i6i4joAo4Wz7KuhWt0HiRJOSRE2iBvz1Pr9lUQ=; b=b3vXV3BR4IkGWz+5uH9h441GP7Jv5566o2FSWOkO4yZqAMCPBrj62kDKbw6mnUekDy nrGtjPwmhivy8SiYyLANLZEDmK0ZCJuAqTcQFdhVydML8kn+4ItW6ZIA1K/NAODK+L7o lktDeOFVSunK0JXUk8E85eayncunjd1ybBuRzcOpafgV1ioQpP8Mn3SZeCEAhADm3BLH VyEPk47oXp7isXfKqb2V4cf4VRztlXDzNBffvXMOBaGFCc0wvTSsrA6q6m0idPx5irC8 5wySZoVuNj5kxshcQyrr6ODN4FZAfPyqYdnfgv2CrDSzpS8latmbsrOw27eTu8JeKJsL Qx/g== X-Gm-Message-State: APjAAAX9+baC1bh7UUMjCNxxzD2weZVgvEYNnYu275WDA/klELxLDwyT 4YBZHGcz38iaKDNLmOPVouFtrUqrRXSONdRLZW4wxdVyLfM= X-Google-Smtp-Source: APXvYqx7Ayb+S2dqR3mBN7WY6A75np4SpdbSeA5GG/iIyt+YWT4dLWfBWv3lemdB16EJS//Xg3S2XgAm9iGe8jkB6Gc= X-Received: by 2002:a9d:39c5:: with SMTP id y63mr10923850otb.42.1556993353004; Sat, 04 May 2019 11:09:13 -0700 (PDT) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::32f X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:236163 Archived-At: --000000000000b93d0d058813c3a9 Content-Type: text/plain; charset="UTF-8" I am trying to build emacs using clang 8 (from home-brew) with link time optimization enabled. Emacs configured as: LD=lld CC=clang CFLAGS="-flto" ../../git/emacs/configure --with-mailutils --with-ns I get an error in building lib-src/make-fingerprint: make[2]: Nothing to be done for `info'. CCLD make-fingerprint ld: reference to bitcode symbol '_rpl_getopt' which LTO has not compiled in '_main' from /var/folders/5c/5w9bqxts6gl2pgfgdpzq94n0nhqj5f/T/cc-ebc71c.o for architecture x86_64 clang-8: error: linker command failed with exit code 1 (use -v to see invocation) make[1]: *** [make-fingerprint] Error 1 make: *** [lib-src] Error 2 The following patch fixes the build: $ git diff diff --git a/lib-src/make-fingerprint.c b/lib-src/make-fingerprint.c index 79bd007a5f..d00dd26c9f 100644 --- a/lib-src/make-fingerprint.c +++ b/lib-src/make-fingerprint.c @@ -65,7 +65,7 @@ main (int argc, char **argv) { int c; bool raw = false; - while (0 <= (c = getopt (argc, argv, "rh"))) + while (0 <= (c = getopt_long (argc, argv, "rh", NULL, NULL))) { switch (c) { --000000000000b93d0d058813c3a9 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
I am trying to build emacs using clang 8 (from home-brew= ) with link time optimization enabled.
Emacs configured as:
LD=3Dlld CC=3Dclang CFLAGS=3D"-flto" ../../git= /emacs/configure --with-mailutils --with-ns

I get an error in building li= b-src/make-fingerprint:
make[2]: Nothing to be done for `info'.
=C2=A0 CCLD =C2=A0 =C2=A0 make-fingerprint
ld: reference to bitcode symbol '_rpl_getopt' wh= ich LTO has not compiled in '_main' from /var/folders/5c/5w9bqxts6g= l2pgfgdpzq94n0nhqj5f/T/cc-ebc71c.o for architecture x86_64
clang-8: error: linker command failed with exit code 1 (= use -v to see invocation)
make[1]: *** [m= ake-fingerprint] Error 1
make: *** [lib-s= rc] Error 2

The following patch fixes the build:
$ git diff
diff --git a/lib-s= rc/make-fingerprint.c b/lib-src/make-fingerprint.c
index 79bd007a5f..d00dd26c9f 100644
--- a/lib-src/make-fingerprint.c
+++= b/lib-src/make-fingerprint.c
@@ -65,7 +6= 5,7 @@ main (int argc, char **argv)
=C2= =A0{
=C2=A0 =C2=A0int c;
=C2=A0 =C2=A0bool raw =3D false;
- =C2=A0while (0 <=3D (c =3D getopt (argc, argv, "rh&quo= t;)))
+ =C2=A0while (0 <=3D (c =3D get= opt_long (argc, argv, "rh", NULL, NULL)))
=C2=A0 =C2=A0 =C2=A0{
=C2=A0 = =C2=A0 =C2=A0 =C2=A0switch (c)
=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0{
--000000000000b93d0d058813c3a9--