Skip to content

Commit 471b1e4

Browse files
committed
[test-suite][mips] Disable setlocale calls in consumer-typeset test
When running the test-suite through qemu an error can occur when the host and target architecture differ in endianness. This happens when the test calls setlocale. The glibc implementation of this call reads /usr/lib/locale/locale-archive as raw bites. Since the endianness doesn't match, the numbers read from the archive don't make sense and cause the check to fail. This patch disables the setlocale call so the test passes regardless of endianness. Patch by Miloš Stojanović Differential Revision: http://reviews.llvm.org/D55708 llvm-svn: 350066
1 parent 3824679 commit 471b1e4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

MultiSource/Benchmarks/MiBench/consumer-typeset/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
list(APPEND CPPFLAGS -DOS_UNIX=1 -DOS_DOS=0 -DOS_MAC=0 -DDB_FIX=0 -DUSE_STAT=1 -DSAFE_DFT=0 -DCOLLATE=1 -DLIB_DIR="lout.lib" -DFONT_DIR="font" -DMAPS_DIR="maps" -DINCL_DIR="include" -DDATA_DIR="data" -DHYPH_DIR="hyph" -DLOCALE_DIR="locale" -DCHAR_IN=1 -DCHAR_OUT=0 -DLOCALE_ON=1 -DASSERT_ON=1 -DDEBUG_ON=0 -DPDF_COMPRESSION=0 -D_FORTIFY_SOURCE=0)
2+
3+
if(ARCH STREQUAL "Mips")
4+
list(APPEND CPPFLAGS -DCOLLATE=0 -DLOCALE_ON=0)
5+
endif()
6+
27
list(APPEND LDFLAGS -lm)
38
set(RUN_OPTIONS -x -I data/include -D data/data -F data/font -C data/maps -H data/hyph large.lout)
49

MultiSource/Benchmarks/MiBench/consumer-typeset/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ PROG = consumer-typeset
44
# FORTIFY_SOURCE is turned off for this benchmark because the type lies at some
55
# point in this program and FORIFY implementations rely on the correct type.
66
CPPFLAGS = -DOS_UNIX=1 -DOS_DOS=0 -DOS_MAC=0 -DDB_FIX=0 -DUSE_STAT=1 -DSAFE_DFT=0 -DCOLLATE=1 -DLIB_DIR=\"lout.lib\" -DFONT_DIR=\"font\" -DMAPS_DIR=\"maps\" -DINCL_DIR=\"include\" -DDATA_DIR=\"data\" -DHYPH_DIR=\"hyph\" -DLOCALE_DIR=\"locale\" -DCHAR_IN=1 -DCHAR_OUT=0 -DLOCALE_ON=1 -DASSERT_ON=1 -DDEBUG_ON=0 -DPDF_COMPRESSION=0 -D_FORTIFY_SOURCE=0
7+
8+
ifeq ($(ARCH),Mips)
9+
CPPFLAGS += -DCOLLATE=0 -DLOCALE_ON=0
10+
endif
11+
712
LDFLAGS = -lm
813
RUN_OPTIONS = -x -I $(PROJ_SRC_DIR)/data/include -D $(PROJ_SRC_DIR)/data/data -F $(PROJ_SRC_DIR)/data/font -C $(PROJ_SRC_DIR)/data/maps -H $(PROJ_SRC_DIR)/data/hyph $(PROJ_SRC_DIR)/large.lout
914

0 commit comments

Comments
 (0)