r22832 - gnucash/trunk/src/libqof/qof - Compile md5.c with "-fno-strict-aliasing".

Mike Alexander mta at code.gnucash.org
Sat Mar 23 20:03:55 EDT 2013


Author: mta
Date: 2013-03-23 20:03:54 -0400 (Sat, 23 Mar 2013)
New Revision: 22832
Trac: http://svn.gnucash.org/trac/changeset/22832

Modified:
   gnucash/trunk/src/libqof/qof/Makefile.am
Log:
Compile md5.c with "-fno-strict-aliasing".
The function md5_finish_ctx dereferences type-punned pointers which
breaks strict aliasing rules.

Modified: gnucash/trunk/src/libqof/qof/Makefile.am
===================================================================
--- gnucash/trunk/src/libqof/qof/Makefile.am	2013-03-23 06:41:09 UTC (rev 22831)
+++ gnucash/trunk/src/libqof/qof/Makefile.am	2013-03-24 00:03:54 UTC (rev 22832)
@@ -5,10 +5,11 @@
 lib_LTLIBRARIES = libgnc-qof.la
 
 libgnc_qof_la_LDFLAGS= -version-info $(LIBQOF_LIBRARY_VERSION)
-libgnc_qof_la_LIBADD= \
+libgnc_qof_common_libs =  \
   $(GLIB_LIBS) \
   $(REGEX_LIBS) \
   $(top_builddir)/lib/libc/libc-missing.la
+libgnc_qof_la_LIBADD = $(libgnc_qof_common_libs)
 
 AM_CPPFLAGS = \
   -I$(top_srcdir)/lib/libc \
@@ -21,7 +22,6 @@
    guid.c            \
    kvp-util.c        \
    kvp_frame.c       \
-   md5.c             \
    qofbackend.c      \
    qofbook.c         \
    qofchoice.c       \
@@ -80,6 +80,13 @@
    qofquery-p.h  \
    qofquerycore-p.h \
    qofsession-p.h
+   
+# Must compile md5.c without strict aliasing, otherwise function md5_finish_ctx
+# gets "dereferencing type-punned pointer will break strict-aliasing rules"
+noinst_LTLIBRARIES = libmd5.la
+libmd5_la_SOURCES = md5.c
+libmd5_la_CFLAGS=-fno-strict-aliasing
+libgnc_qof_la_LIBADD += libmd5.la
 
 EXTRA_DIST += \
   qofmath128.c
@@ -96,6 +103,6 @@
 test_qofmath_SOURCES=gnc-numeric.c
 test_qofmath_CPPFLAGS=$(AM_CPPFLAGS) -DTEST_128_BIT_MULT
 test_qofmath_LDFLAGS=$(libgnc_qof_la_LDFLAGS)
-test_qofmath_LDADD=$(libgnc_qof_la_LIBADD)
+test_qofmath_LDADD=$(libgnc_qof_common_libs)
 
 AM_CPPFLAGS += -DG_LOG_DOMAIN=\"qof\"



More information about the gnucash-changes mailing list