diff options
author | mi <mi@FreeBSD.org> | 2006-11-08 03:14:25 +0800 |
---|---|---|
committer | mi <mi@FreeBSD.org> | 2006-11-08 03:14:25 +0800 |
commit | d3b131c51c12be4da16113b3fa6ca1a9c557e0fb (patch) | |
tree | abc4464fd19e777fb9274863c1d1bb91cdc2ebd7 /devel/icu4 | |
parent | 3d0e937a667a4d7182f00466595e3fba0d5deb60 (diff) | |
download | freebsd-ports-gnome-d3b131c51c12be4da16113b3fa6ca1a9c557e0fb.tar.gz freebsd-ports-gnome-d3b131c51c12be4da16113b3fa6ca1a9c557e0fb.tar.zst freebsd-ports-gnome-d3b131c51c12be4da16113b3fa6ca1a9c557e0fb.zip |
Add a patch to fix test-failures in some "exotic" locales (obtained from
ICU):
PR: 102629
Make sure to use not only "-O2", but also "-fno-strict-aliasing"
-- but only when using the "stock" cc/c++ as the newer gcc-4.x does not
seem to exhibit a problem. This seems to help the test-exposed
miscompilations.
PR: 103255
Diffstat (limited to 'devel/icu4')
-rw-r--r-- | devel/icu4/Makefile | 10 | ||||
-rw-r--r-- | devel/icu4/files/patch-intltest | 64 |
2 files changed, 72 insertions, 2 deletions
diff --git a/devel/icu4/Makefile b/devel/icu4/Makefile index 7db5b550747c..7475a1eaf34d 100644 --- a/devel/icu4/Makefile +++ b/devel/icu4/Makefile @@ -33,8 +33,6 @@ CONFIGURE_ARGS+= --enable-static CONFIGURE_ARGS+= --enable-samples=no USE_GMAKE= yes -CONFIGURE_ENV+= CFLAGS="${CFLAGS:N-funroll-loops:N-O*} -O2" CXX="${CXX}" -CONFIGURE_ENV+= CXXFLAGS="${CXXFLAGS:N-funroll-loops:N-O*} -O2" CC="${CC}" MAN1+= derb.1 MAN1+= genbrk.1 @@ -57,6 +55,14 @@ PLIST_SUB+= ICUVER=${PORTVERSION} .include <bsd.port.pre.mk> +.if ${CC:T} == "cc" +CFLAGS:= ${CFLAGS:N-funroll-loops:N-O*:N-*strict-aliasing} -O2 -fstrict-aliasing +.endif +.if ${CXX:T} == "c++" +CXXFLAGS:= ${CXXFLAGS:N-funroll-loops:N-O*:N-*strict-aliasing} -O2 -fstrict-aliasing +.endif +CONFIGURE_ENV+= CFLAGS="${CFLAGS}" CXXFLAGS="${CXXFLAGS}" + .if defined(WITH_THREADS) CONFIGURE_ARGS+= --enable-threads=yes post-patch: diff --git a/devel/icu4/files/patch-intltest b/devel/icu4/files/patch-intltest new file mode 100644 index 000000000000..61b6baec5887 --- /dev/null +++ b/devel/icu4/files/patch-intltest @@ -0,0 +1,64 @@ +This fixes the test code as addressing the problem(s) documented in +FreeBSD's + + http://www.freebsd.org/cgi/query-pr.cgi?pr=102629 + +and ICU's + + http://bugs.icu-project.org/cgi-bin/icu-bugs?findid=5366 + +--- test/intltest/restsnew.cpp Tue Dec 27 17:21:28 2005 ++++ test/intltest/restsnew.cpp Tue Nov 7 11:35:57 2006 +@@ -1,5 +1,5 @@ + /******************************************************************** + * COPYRIGHT: +- * Copyright (c) 1997-2005, International Business Machines Corporation and ++ * Copyright (c) 1997-2006, International Business Machines Corporation and + * others. All Rights Reserved. + ********************************************************************/ +@@ -35,9 +35,9 @@ + //*************************************************************************************** + +-#define CONFIRM_EQ(actual,expected) if ((expected)==(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of " + (expected) + (UnicodeString)"\n"); } +-#define CONFIRM_GE(actual,expected) if ((actual)>=(expected)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of x >= " + (expected) + (UnicodeString)"\n"); } +-#define CONFIRM_NE(actual,expected) if ((expected)!=(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of x != " + (expected) + (UnicodeString)"\n"); } ++#define CONFIRM_EQ(actual,expected) if ((expected)==(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of " + (expected)); } ++#define CONFIRM_GE(actual,expected) if ((actual)>=(expected)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of x >= " + (expected)); } ++#define CONFIRM_NE(actual,expected) if ((expected)!=(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (actual) + (UnicodeString)" instead of x != " + (expected)); } + +-#define CONFIRM_UErrorCode(actual,expected) if ((expected)==(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (UnicodeString)u_errorName(actual) + (UnicodeString)" instead of " + (UnicodeString)u_errorName(expected) + (UnicodeString)"\n"); } ++#define CONFIRM_UErrorCode(actual,expected) if ((expected)==(actual)) { record_pass(); } else { record_fail(); errln(action + (UnicodeString)" returned " + (UnicodeString)u_errorName(actual) + (UnicodeString)" instead of " + (UnicodeString)u_errorName(expected)); } + + //*************************************************************************************** +@@ -198,4 +198,12 @@ + NewResourceBundleTest::TestResourceBundles() + { ++ UErrorCode status = U_ZERO_ERROR; ++ loadTestData(status); ++ if(U_FAILURE(status)) ++ { ++ errln("Could not load testdata.dat %s " + UnicodeString(u_errorName(status))); ++ return; ++ } ++ + testTag("only_in_Root", TRUE, FALSE, FALSE); + testTag("only_in_te", FALSE, TRUE, FALSE); +@@ -432,10 +440,16 @@ + logln("Testing ResourceBundle(UErrorCode)\n"); + ResourceBundle defaultresource(err); ++ ResourceBundle explicitdefaultresource(NULL, Locale::getDefault(), err); + if(U_FAILURE(err)){ + errln("Construction of default resourcebundle failed"); + return; + } +- if(strcmp(defaultresource.getLocale().getName(), Locale::getDefault().getName()) != 0){ +- errln("Construction of default resourcebundle didn't take the defaultlocale\n"); ++ // You can't compare the default locale to the resolved locale in the ++ // resource bundle due to aliasing, keywords in the default locale ++ // or the chance that the machine running these tests is using a locale ++ // that isn't available in ICU. ++ if(strcmp(defaultresource.getLocale().getName(), explicitdefaultresource.getLocale().getName()) != 0){ ++ errln("Construction of default resourcebundle didn't take the defaultlocale. Expected %s Got %s err=%s\n", ++ explicitdefaultresource.getLocale().getName(), defaultresource.getLocale().getName(), u_errorName(err)); + } + |