-
-
Notifications
You must be signed in to change notification settings - Fork 735
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2478 from pqarmitage/updates
Various segfault fixes, compiler warnings on 32 bit systems and add milli-second timers for vrrp track scripts
- Loading branch information
Showing
30 changed files
with
381 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,6 +97,7 @@ AC_PREREQ([2.63]) | |
AC_INIT([Keepalived], [2.3.1], [[email protected]], [], [http://www.keepalived.org/]) | ||
AC_CONFIG_AUX_DIR([build-aux]) | ||
AC_CONFIG_MACRO_DIR([m4]) | ||
AC_LANG([C]) | ||
AM_INIT_AUTOMAKE([-Wall -Werror -Woverride foreign]) | ||
|
||
AC_CONFIG_SRCDIR([keepalived/core/main.c]) | ||
|
@@ -424,6 +425,15 @@ ENABLE_LOG_FILE_APPEND=No | |
# AC_PROG_LIBTOOL | ||
# Ensure we don't override FORTIFY_SOURCE | ||
ADD_FORTIFY_SOURCE=1 | ||
grep -q -- "-D *_FORTIFY_SOURCE=" <<<$CPPFLAGS | ||
AS_IF([test $? -eq 0], | ||
[ | ||
FORTIFY_SOURCE=$(<<<$CPPFLAGS $SED -e "s/.*-D *_FORTIFY_SOURCE=//" -e "s/ .*//") | ||
ADD_FORTIFY_SOURCE=0 | ||
],[FORTIFY_SOURCE=2]) | ||
# | ||
# save the configure arguments | ||
# | ||
|
@@ -655,6 +665,61 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | |
]) | ||
CFLAGS=$SAV_CFLAGS | ||
dnl -- printing time types (32 bit Ubuntu uses long long int for time_t timeval tv_sec/tv_usec and timespec tv_sec - but timespec tv_nsec is long int!) | ||
dnl -- normally all the fields are long int | ||
AC_MSG_CHECKING([time print types]) | ||
AH_TEMPLATE([PRI_time_t], [Define for print format for time_t]) | ||
AH_TEMPLATE([PRI_tv_sec], [Define for print format for struct timeval tv_sec]) | ||
AH_TEMPLATE([PRI_tv_usec], [Define for print format for struct timeval tv_usec]) | ||
AH_TEMPLATE([PRI_ts_sec], [Define for print format for struct timespec tv_sec]) | ||
AH_TEMPLATE([PRI_ts_nsec], [Define for print format for struct timespec tv_nsec]) | ||
SAV_CFLAGS=$CFLAGS | ||
CFLAGS="$CFLAGS -Wformat -Wformat-signedness" | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | ||
int main(void) | ||
{ | ||
} | ||
]])], | ||
[ | ||
signs="d u" | ||
WARN_SIGN="-Werror=format-signedness" | ||
], | ||
[ | ||
signs="d" | ||
WARN_SIGN="" | ||
]) | ||
CFLAGS="$CFLAGS -Werror=format $WARN_SIGN" | ||
for field in t tv.tv_sec tv.tv_usec ts.tv_sec ts.tv_nsec; do | ||
for sign in $signs; do | ||
for len in "" l ll; do | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | ||
#include <time.h> | ||
#include <sys/time.h> | ||
#include <stdio.h> | ||
int main(void) | ||
{ | ||
time_t t = 1; | ||
struct timeval tv = { .tv_sec = 2 }; | ||
struct timespec ts = { .tv_sec = 3 }; | ||
printf("%$len$sign", $field); | ||
} | ||
]])], | ||
[ | ||
if [[ $field = t ]]; then | ||
name=time_t | ||
else | ||
name=$(<<<$field $SED -e "s/\.tv//") | ||
fi | ||
AC_DEFINE_UNQUOTED([PRI_$name], [ "$len$sign" ]) | ||
], []) | ||
done | ||
done | ||
done | ||
CFLAGS=$SAV_CFLAGS | ||
AC_MSG_RESULT([done]) | ||
dnl -- Check for diagnostic pragmas in functions - GCC 4.6.0 | ||
AC_MSG_CHECKING([diagnostic pragmas in functions]) | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | ||
|
@@ -705,7 +770,8 @@ if test "$enable_conversion_checks" = yes; then | |
# Check if we can sensibly enable -Wconversion | ||
AC_MSG_CHECKING([for usable -Wconversion]) | ||
SAV_CFLAGS="$CFLAGS" | ||
CFLAGS="$CFLAGS -Wconversion -O2 -Wp,-D_FORTIFY_SOURCE=2 -Werror" | ||
CFLAGS="$CFLAGS -Wconversion -O2 -Werror" | ||
AS_IF([test $ADD_FORTIFY_SOURCE -eq 1], [CFLAGS="$CFLAGS -Wp,-D_FORTIFY_SOURCE=$FORTIFY_SOURCE"]) | ||
AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ | ||
#include <sys/types.h> | ||
#include <sys/select.h> | ||
|
@@ -939,7 +1005,7 @@ if test "$enable_hardening" != no; then | |
for FLAG in \ | ||
"-Wformat -Werror=format-security" \ | ||
"-Wp,-D_FORTIFY_SOURCE=2" \ | ||
"-Wp,-D_FORTIFY_SOURCE=$FORTIFY_SOURCE" \ | ||
"-fexceptions" \ | ||
"-fstack-protector-strong" \ | ||
"--param=ssp-buffer-size=4" \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.