summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--README12
-rw-r--r--cipher/ChangeLog3
-rw-r--r--cipher/Makefile.am10
-rw-r--r--configure.ac11
5 files changed, 38 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 869abaa2..80717c52 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2009-12-10 Werner Koch <wk@g10code.com>
+
+ * configure.ac: Add option --disable-O-flag-munging.
+
2009-12-08 Marcus Brinkmann <marcus@g10code.de>
Update to libtool 2.2.6a.
diff --git a/README b/README
index 3bab5996..fc534b0e 100644
--- a/README
+++ b/README
@@ -170,6 +170,18 @@
available. Try this if you get problems with
assembler code.
+ --disable-O-flag-munging
+ Some code is too complex for some compilers while
+ in higher optimization modes, thus the compiler
+ invocation is modified to use a lower
+ optimization level. Usually this works very well
+ but on some platforms these rules break the
+ invocation. This option may be used to disable
+ the feature under the assumption that either good
+ CFLAGS are given or the compiler can grok the code.
+
+
+
Build Problems
--------------
diff --git a/cipher/ChangeLog b/cipher/ChangeLog
index 26b9e7ba..cd298382 100644
--- a/cipher/ChangeLog
+++ b/cipher/ChangeLog
@@ -1,5 +1,8 @@
2009-12-10 Werner Koch <wk@g10code.com>
+ * Makefile.am (o_flag_munging): New.
+ (tiger.o, tiger.lo): Use it.
+
* cipher.c (do_ctr_encrypt): Add arg OUTBUFLEN. Check for
suitable value. Add check for valid inputlen. Wipe temporary
memory.
diff --git a/cipher/Makefile.am b/cipher/Makefile.am
index f49c6a74..94748487 100644
--- a/cipher/Makefile.am
+++ b/cipher/Makefile.am
@@ -67,10 +67,16 @@ twofish.c \
rfc2268.c \
camellia.c camellia.h camellia-glue.c
+if ENABLE_O_FLAG_MUNGING
+o_flag_munging = sed -e 's/-O[2-9s]*/-O1/g'
+else
+o_flag_munging = cat
+endif
+
# We need to lower the optimization for this module.
tiger.o: $(srcdir)/tiger.c
- `echo $(COMPILE) -c $(srcdir)/tiger.c | sed -e 's/-O[2-9s]*/-O1/g' `
+ `echo $(COMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) `
tiger.lo: $(srcdir)/tiger.c
- `echo $(LTCOMPILE) -c $(srcdir)/tiger.c | sed -e 's/-O[2-9s]*/-O1/g' `
+ `echo $(LTCOMPILE) -c $(srcdir)/tiger.c | $(o_flag_munging) `
diff --git a/configure.ac b/configure.ac
index 93f4c03b..be2fd32e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -477,6 +477,16 @@ if test x"$padlocksupport" = xyes ; then
[Enable support for the PadLock engine.])
fi
+# Implementation of the --disable-O-flag-munging switch.
+AC_MSG_CHECKING([whether a -O flag munging is requested])
+AC_ARG_ENABLE([O-flag-munging],
+ AC_HELP_STRING([--disable-O-flag-munging],
+ [Disable modification of the cc -O flag]),
+ [enable_o_flag_munging=$enableval],
+ [enable_o_flag_munging=yes])
+AC_MSG_RESULT($enable_o_flag_munging)
+AM_CONDITIONAL(ENABLE_O_FLAG_MUNGING, test "$enable_o_flag_munging" = "yes")
+
AC_DEFINE_UNQUOTED(PRINTABLE_OS_NAME, "$PRINTABLE_OS_NAME",
@@ -506,6 +516,7 @@ AC_DEFINE_UNQUOTED(NAME_OF_DEV_RANDOM, "$NAME_OF_DEV_RANDOM",
AC_DEFINE_UNQUOTED(NAME_OF_DEV_URANDOM, "$NAME_OF_DEV_URANDOM",
[defined to the name of the weaker random device])
+
###############################
#### Checks for libraries. ####
###############################