all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Antipov <dmantipov@yandex.ru>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: Sean Sieger <sean.sieger@gmail.com>, emacs-devel@gnu.org
Subject: Re: Emacs pretest
Date: Tue, 01 Apr 2014 20:36:45 +0400	[thread overview]
Message-ID: <533AEB1D.7050408@yandex.ru> (raw)
In-Reply-To: <533AD803.4060902@yandex.ru>

[-- Attachment #1: Type: text/plain, Size: 432 bytes --]

On 04/01/2014 07:15 PM, Dmitry Antipov wrote:

> On 03/31/2014 05:27 PM, Stefan Monnier wrote:
>
>> I think we're ready for the first pretest.  Sean, can you take care of it?
>
> I have a fix for http://debbugs.gnu.org/cgi/bugreport.cgi?bug=17125 on the way;
> hopefully the fix will be confirmed in a day or so - can we wait a bit more?

Also I have LTO support for clang users; does that makes sense for pretest as well?

Dmitry


[-- Attachment #2: clang_lto_1.patch --]
[-- Type: text/x-patch, Size: 4477 bytes --]

=== modified file 'INSTALL'
--- INSTALL	2014-03-27 19:41:57 +0000
+++ INSTALL	2014-04-01 16:08:38 +0000
@@ -331,12 +331,17 @@
 there should be no warnings; on older and on non-GNU systems the
 generated warnings may still be useful.
 
-Use --enable-link-time-optimization to enable link-time optimizer, which
-is available in GNU compiler since version 4.5.0.  If your compiler is not
-GNU or older than version 4.5.0, this option does nothing.  If `configure'
-can determine number of online CPUS on your system, final link-time
-optimization and code generation is executed in parallel using one job
-per each available online CPU.
+Use --enable-link-time-optimization to enable link-time optimizer.  If
+you're using GNU compiler, this feature is supported since version 4.5.0.
+If `configure' can determine number of online CPUS on your system, final
+link-time optimization and code generation is executed in parallel using
+one job per each available online CPU.
+
+This option is also supported for clang.  You should have GNU binutils
+with `gold' linker and plugin support, and clang with LLVMgold.so plugin.
+Read http://llvm.org/docs/GoldPlugin.html for details.  Also note that
+this feature is still experimental, so prepare to build binutils and
+clang snapshots from their source code repositories.
 
 The `--prefix=PREFIXDIR' option specifies where the installation process
 should put emacs and its data files.  This defaults to `/usr/local'.

=== modified file 'configure.ac'
--- configure.ac	2014-03-31 05:02:08 +0000
+++ configure.ac	2014-04-01 16:07:34 +0000
@@ -764,32 +764,6 @@
   [gl_gcc_warnings=no]
 )
 
-AC_ARG_ENABLE(link-time-optimization,
-[AS_HELP_STRING([--enable-link-time-optimization],
-                [build emacs with link-time optimization.
-                 This is supported only for GCC since 4.5.0.])],
-if test "${enableval}" != "no"; then
-   AC_MSG_CHECKING([whether link-time optimization is supported])
-   ac_lto_supported=no
-   if test x$GCC = xyes; then
-      CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
-      if test x$CPUS != x; then
-      	 LTO="-flto=$CPUS"
-      else
-	 LTO="-flto"
-      fi
-      old_CFLAGS=$CFLAGS
-      CFLAGS="$CFLAGS $LTO"
-      AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
-      	[ac_lto_supported=yes], [ac_lto_supported=no])
-      CFLAGS="$old_CFLAGS"
-   fi
-   AC_MSG_RESULT([$ac_lto_supported])
-   if test "$ac_lto_supported" = "yes"; then
-      CFLAGS="$CFLAGS $LTO"
-   fi
-fi)
-
 # gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
 # ------------------------------------------------
 # If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
@@ -926,7 +900,48 @@
   AC_SUBST([GNULIB_WARN_CFLAGS])
 fi
 
-
+AC_ARG_ENABLE(link-time-optimization,
+[AS_HELP_STRING([--enable-link-time-optimization],
+                [build emacs with link-time optimization.
+		 This is supported for gcc since 4.5.0 and clang.
+		 For the latter, this is experimental, see INSTALL])],
+if test "${enableval}" != "no"; then
+   ac_lto_supported=no
+   if test $emacs_cv_clang = yes; then
+      AC_MSG_CHECKING([whether link-time optimization is supported by clang])
+      GOLD_PLUGIN=`$CC -print-file-name=LLVMgold.so`
+      if test -n "$GOLD_PLUGIN" -a -x "$GOLD_PLUGIN"; then
+	 LTO="-flto"
+      fi
+   elif test x$GCC = xyes; then
+      AC_MSG_CHECKING([whether link-time optimization is supported by gcc])
+      CPUS=`getconf _NPROCESSORS_ONLN 2>/dev/null`
+      if test x$CPUS != x; then
+	 LTO="-flto=$CPUS"
+      else
+	 LTO="-flto"
+      fi
+   else
+      AC_MSG_ERROR([Link-time optimization is not supported with your compiler.])
+   fi
+   old_CFLAGS=$CFLAGS
+   CFLAGS="$CFLAGS $LTO"
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])],
+      [ac_lto_supported=yes], [ac_lto_supported=no])
+      CFLAGS="$old_CFLAGS"
+   AC_MSG_RESULT([$ac_lto_supported])
+   if test "$ac_lto_supported" = "yes"; then
+      CFLAGS="$CFLAGS $LTO"
+      if test x$emacs_cv_clang = xyes; then
+	 AC_MSG_WARN([Please read INSTALL before using link-time optimization with clang])
+	 # WARNING: 'ar --plugin ...' doesn't work without
+	 # command, so plugin name is appended to ARFLAGS...
+	 ARFLAGS="cru --plugin $GOLD_PLUGIN"
+	 # ...but this is much better for ranlib.
+	 RANLIB="$RANLIB --plugin $GOLD_PLUGIN"
+      fi
+   fi
+fi)
 
 dnl Some other nice autoconf tests.
 dnl These are commented out, since gl_EARLY and/or Autoconf already does them.


  reply	other threads:[~2014-04-01 16:36 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CADWZ7fJCws0SO1hEn38CpbRMq+Uw397uCFUnA=YJvOaLVEA8UQ@mail.gmail.com>
2014-03-31 13:27 ` Emacs pretest Stefan Monnier
2014-03-31 13:52   ` Bastien
2014-03-31 14:36   ` Tassilo Horn
2014-03-31 15:55   ` João Távora
2014-03-31 16:34     ` Stefan Monnier
2014-04-02 10:11       ` Emacs pretest -- electric-pair-mode change João Távora
2014-04-02 12:58         ` Stefan Monnier
2014-04-02 17:21           ` João Távora
2014-04-02 22:58             ` Stefan Monnier
2014-04-03 11:06               ` João Távora
2014-04-03 14:22                 ` Stefan Monnier
2014-04-03 16:56                   ` João Távora
2014-04-03 17:33                     ` Stefan Monnier
2014-04-03 20:11                       ` João Távora
2014-04-03 20:54                         ` Stefan Monnier
2014-04-04  8:08                           ` João Távora
2014-04-04 12:53                             ` Stefan Monnier
2014-04-04 23:31                               ` João Távora
2014-04-05 15:29                                 ` Stefan Monnier
2014-04-07  7:43                                   ` João Távora
2014-04-07 14:04                                     ` Stefan Monnier
2014-04-04  7:53                         ` Eli Zaretskii
2014-04-04  9:49                           ` João Távora
2014-04-11 14:42                       ` Kevin Rodgers
2014-04-11 15:53                         ` Stefan Monnier
2014-04-11 18:23                           ` João Távora
2014-04-11 19:58                             ` Stefan Monnier
2014-04-12  0:42                               ` João Távora
2014-04-11 16:08                         ` João Távora
2014-04-03 19:13                   ` Eli Zaretskii
2014-04-03 12:15             ` Dmitry Gutov
2014-04-03 13:43               ` João Távora
2014-04-03 15:24                 ` Stefan Monnier
2014-04-03 14:24               ` Stefan Monnier
2014-04-01 15:15   ` Emacs pretest Dmitry Antipov
2014-04-01 16:36     ` Dmitry Antipov [this message]
2014-04-02 12:37       ` Stefan Monnier
2014-04-01 20:50   ` Stephen Berman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=533AEB1D.7050408@yandex.ru \
    --to=dmantipov@yandex.ru \
    --cc=emacs-devel@gnu.org \
    --cc=monnier@IRO.UMontreal.CA \
    --cc=sean.sieger@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.