[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 95ef69e: Port 'configure' to clang 3.5
From: |
Paul Eggert |
Subject: |
[Emacs-diffs] master 95ef69e: Port 'configure' to clang 3.5 |
Date: |
Fri, 03 Apr 2015 20:06:12 +0000 |
branch: master
commit 95ef69e7468e598d6f4ae875f683b3996ecc02eb
Author: Paul Eggert <address@hidden>
Commit: Paul Eggert <address@hidden>
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.
---
ChangeLog | 10 ++++++++++
configure.ac | 23 +++++++++++++++--------
2 files changed, 25 insertions(+), 8 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 030ef37..7746605 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2015-04-03 Paul Eggert <address@hidden>
+
+ 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.
+
2015-04-03 Ulrich Müller <address@hidden>
* configure.ac (LD_SWITCH_SYSTEM_TEMACS): Add -nopie option if it
diff --git a/configure.ac b/configure.ac
index d2a9b37..c504ed4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -883,6 +883,7 @@ if test "$gl_gcc_warnings" != yes; then
gl_WARN_ADD([-Wno-tautological-constant-out-of-range-compare])
gl_WARN_ADD([-Wno-pointer-sign])
gl_WARN_ADD([-Wno-string-plus-int])
+ gl_WARN_ADD([-Wno-unknown-attributes])
fi
else
isystem='-isystem '
@@ -5030,16 +5031,22 @@ case "$opsys" in
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac
-AC_CACHE_CHECK([whether the linker accepts -nopie],
+# -nopie fixes a temacs segfault on Gentoo for some reason (Bug#18784).
+# We don't know why -nopie works, but not segfaulting is better than
+# segfaulting. Use -Werror when trying -nopie, otherwise clang keeps
+# warning that it does not understand -nopie.
+AC_CACHE_CHECK([whether $CC accepts -nopie],
[emacs_cv_prog_cc_nopie],
- [emacs_save_LDFLAGS=$LDFLAGS
- LDFLAGS="$LDFLAGS -nopie"
- AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
- [emacs_cv_prog_cc_nopie=yes],
- [emacs_cv_prog_cc_nopie=no])
- LDFLAGS=$emacs_save_LDFLAGS])
+ [emacs_save_CFLAGS=$CFLAGS
+ emacs_save_LDFLAGS=$LDFLAGS
+ CFLAGS="$CFLAGS -Werror"
+ LDFLAGS="$LDFLAGS -nopie"
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
+ [emacs_cv_prog_cc_nopie=yes],
+ [emacs_cv_prog_cc_nopie=no])
+ CFLAGS=$emacs_save_CFLAGS
+ LDFLAGS=$emacs_save_LDFLAGS])
if test "$emacs_cv_prog_cc_nopie" = yes; then
- # Disable PIE to avoid segfaults in temacs (bug#18784)
LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -nopie"
fi
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 95ef69e: Port 'configure' to clang 3.5,
Paul Eggert <=