aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2015-04-03 13:05:23 -0700
committerPaul Eggert2015-04-03 13:06:02 -0700
commit95ef69e7468e598d6f4ae875f683b3996ecc02eb (patch)
tree5b0dc6be8b01deabc2f4dfa591eaafa3065e51b6
parent8596eb1282c4d5bdb22b20c155183b39fdc8eb00 (diff)
downloademacs-95ef69e7468e598d6f4ae875f683b3996ecc02eb.tar.gz
emacs-95ef69e7468e598d6f4ae875f683b3996ecc02eb.zip
Port 'configure' to clang 3.5
* configure.ac: Add -Wno-unknown-attributes if clang; otherwise clang 3.5.0 (Fedora 21 x86-64) complains "/usr/include/glib-2.0/glib/gmem.h: ... warning: unknown attribute '__alloc_size__' ignored". Use -Werror when checking for -nopie; otherwise clang warns about -nopie instead of failing, and then later it warns everytime the build uses -nopie.
-rw-r--r--ChangeLog10
-rw-r--r--configure.ac23
2 files changed, 25 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 030ef37e850..7746605c4b1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
12015-04-03 Paul Eggert <eggert@cs.ucla.edu>
2
3 Port 'configure' to clang 3.5
4 * configure.ac: Add -Wno-unknown-attributes if clang; otherwise
5 clang 3.5.0 (Fedora 21 x86-64) complains
6 "/usr/include/glib-2.0/glib/gmem.h: ... warning: unknown attribute
7 '__alloc_size__' ignored". Use -Werror when checking for -nopie;
8 otherwise clang warns about -nopie instead of failing, and then
9 later it warns everytime the build uses -nopie.
10
12015-04-03 Ulrich Müller <ulm@gentoo.org> 112015-04-03 Ulrich Müller <ulm@gentoo.org>
2 12
3 * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it 13 * configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it
diff --git a/configure.ac b/configure.ac
index d2a9b375e40..c504ed436cc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -883,6 +883,7 @@ if test "$gl_gcc_warnings" != yes; then
883 gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare]) 883 gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
884 gl_WARN_ADD([-Wno-pointer-sign]) 884 gl_WARN_ADD([-Wno-pointer-sign])
885 gl_WARN_ADD([-Wno-string-plus-int]) 885 gl_WARN_ADD([-Wno-string-plus-int])
886 gl_WARN_ADD([-Wno-unknown-attributes])
886 fi 887 fi
887else 888else
888 isystem='-isystem ' 889 isystem='-isystem '
@@ -5030,16 +5031,22 @@ case "$opsys" in
5030 *) LD_SWITCH_SYSTEM_TEMACS= ;; 5031 *) LD_SWITCH_SYSTEM_TEMACS= ;;
5031esac 5032esac
5032 5033
5033AC_CACHE_CHECK([whether the linker accepts -nopie], 5034# -nopie fixes a temacs segfault on Gentoo for some reason (Bug#18784).
5035# We don't know why -nopie works, but not segfaulting is better than
5036# segfaulting. Use -Werror when trying -nopie, otherwise clang keeps
5037# warning that it does not understand -nopie.
5038AC_CACHE_CHECK([whether $CC accepts -nopie],
5034 [emacs_cv_prog_cc_nopie], 5039 [emacs_cv_prog_cc_nopie],
5035 [emacs_save_LDFLAGS=$LDFLAGS 5040 [emacs_save_CFLAGS=$CFLAGS
5036 LDFLAGS="$LDFLAGS -nopie" 5041 emacs_save_LDFLAGS=$LDFLAGS
5037 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], 5042 CFLAGS="$CFLAGS -Werror"
5038 [emacs_cv_prog_cc_nopie=yes], 5043 LDFLAGS="$LDFLAGS -nopie"
5039 [emacs_cv_prog_cc_nopie=no]) 5044 AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
5040 LDFLAGS=$emacs_save_LDFLAGS]) 5045 [emacs_cv_prog_cc_nopie=yes],
5046 [emacs_cv_prog_cc_nopie=no])
5047 CFLAGS=$emacs_save_CFLAGS
5048 LDFLAGS=$emacs_save_LDFLAGS])
5041if test "$emacs_cv_prog_cc_nopie" = yes; then 5049if test "$emacs_cv_prog_cc_nopie" = yes; then
5042 # Disable PIE to avoid segfaults in temacs (bug#18784)
5043 LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie" 5050 LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie"
5044fi 5051fi
5045 5052