From a2df4a3f769a63822144c874660eb9461f233c22 Mon Sep 17 00:00:00 2001 From: Brad King Date: Wed, 8 Apr 2015 13:07:44 -0400 Subject: liblzma: Disable XL compiler optimizations altogether Revert commit 82c51a8a (liblzma: Disable XL compiler optimizations in one source to avoid crash, 2015-04-02) and instead add a compiler flag to disable optimizations in every source of liblzma. Somehow the XL compiler optimizations create incorrect behavior in liblzma and lead to crashes or truncated output during compression. --- Utilities/cmliblzma/CMakeLists.txt | 6 ++++++ Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c | 3 --- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Utilities/cmliblzma/CMakeLists.txt b/Utilities/cmliblzma/CMakeLists.txt index d991438..991c699 100644 --- a/Utilities/cmliblzma/CMakeLists.txt +++ b/Utilities/cmliblzma/CMakeLists.txt @@ -211,4 +211,10 @@ ENDIF() ADD_LIBRARY(cmliblzma ${LZMA_SRCS}) +IF(CMAKE_C_COMPILER_ID STREQUAL "XL") + # Disable the XL compiler optimizer because it causes crashes + # and other bad behavior in liblzma code. + SET_PROPERTY(TARGET cmliblzma PROPERTY COMPILE_FLAGS "-qnooptimize") +ENDIF() + INSTALL(FILES COPYING DESTINATION ${CMAKE_DOC_DIR}/cmliblzma) diff --git a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c index fc54d8d..d3a6348 100644 --- a/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c +++ b/Utilities/cmliblzma/liblzma/lzma/lzma_encoder_optimum_normal.c @@ -8,9 +8,6 @@ // You can do whatever you want with this file. // /////////////////////////////////////////////////////////////////////////////// -#if defined(__IBMC__) -# pragma options optimize=0 -#endif #include "lzma_encoder_private.h" #include "fastpos.h" -- cgit v0.12