Commit c2073823 authored by Frank Barchard's avatar Frank Barchard

use __OPTIMIZE__ macro to determine debug vs release.

Debug builds of x86 gcc/clang can run out of register.
Previously NDEBUG or _DEBUG was used to detect a debug build.
But those macros are not set by gentoo builds.
This CL switches to the compiler predefine __OPTIMIZE__ which is
built into clang and gcc.

BUG=libyuv:602
TEST=untested
R=wangcheng@google.com

Review URL: https://codereview.chromium.org/2451503002 .
parent f5d5bd88
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 1630 Version: 1631
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -174,8 +174,7 @@ extern "C" { ...@@ -174,8 +174,7 @@ extern "C" {
// The following functions fail on gcc/clang 32 bit with fpic and framepointer. // The following functions fail on gcc/clang 32 bit with fpic and framepointer.
// caveat: clangcl uses row_win.cc which works. // caveat: clangcl uses row_win.cc which works.
#if defined(NDEBUG) || !(defined(_DEBUG) && defined(__i386__)) || \ #if defined(__x86_64__) || defined(__OPTIMIZE__) || defined(_MSC_VER)
!defined(__i386__) || defined(_MSC_VER)
// TODO(fbarchard): fix build error on android_full_debug=1 // TODO(fbarchard): fix build error on android_full_debug=1
// https://code.google.com/p/libyuv/issues/detail?id=517 // https://code.google.com/p/libyuv/issues/detail?id=517
#define HAS_I422ALPHATOARGBROW_SSSE3 #define HAS_I422ALPHATOARGBROW_SSSE3
...@@ -235,7 +234,7 @@ extern "C" { ...@@ -235,7 +234,7 @@ extern "C" {
#define HAS_ARGBUNATTENUATEROW_AVX2 #define HAS_ARGBUNATTENUATEROW_AVX2
#define HAS_BLENDPLANEROW_AVX2 #define HAS_BLENDPLANEROW_AVX2
#if !(defined(_DEBUG) && defined(__i386__)) #if defined(__x86_64__) || defined(__OPTIMIZE__) || defined(_MSC_VER)
// TODO(fbarchard): fix build error on android_full_debug=1 // TODO(fbarchard): fix build error on android_full_debug=1
// https://code.google.com/p/libyuv/issues/detail?id=517 // https://code.google.com/p/libyuv/issues/detail?id=517
#define HAS_I422ALPHATOARGBROW_AVX2 #define HAS_I422ALPHATOARGBROW_AVX2
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ #ifndef INCLUDE_LIBYUV_VERSION_H_
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 1630 #define LIBYUV_VERSION 1631
#endif // INCLUDE_LIBYUV_VERSION_H_ #endif // INCLUDE_LIBYUV_VERSION_H_
...@@ -1708,7 +1708,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const uint8* y_buf, ...@@ -1708,7 +1708,7 @@ void OMITFP I422ToRGB24Row_SSSE3(const uint8* y_buf,
[u_buf]"+r"(u_buf), // %[u_buf] [u_buf]"+r"(u_buf), // %[u_buf]
[v_buf]"+r"(v_buf), // %[v_buf] [v_buf]"+r"(v_buf), // %[v_buf]
[dst_rgb24]"+r"(dst_rgb24), // %[dst_rgb24] [dst_rgb24]"+r"(dst_rgb24), // %[dst_rgb24]
#if defined(__i386__) && defined(__pic__) #if defined(__i386__)
[width]"+m"(width) // %[width] [width]"+m"(width) // %[width]
#else #else
[width]"+rm"(width) // %[width] [width]"+rm"(width) // %[width]
...@@ -1772,7 +1772,7 @@ void OMITFP I422AlphaToARGBRow_SSSE3(const uint8* y_buf, ...@@ -1772,7 +1772,7 @@ void OMITFP I422AlphaToARGBRow_SSSE3(const uint8* y_buf,
[v_buf]"+r"(v_buf), // %[v_buf] [v_buf]"+r"(v_buf), // %[v_buf]
[a_buf]"+r"(a_buf), // %[a_buf] [a_buf]"+r"(a_buf), // %[a_buf]
[dst_argb]"+r"(dst_argb), // %[dst_argb] [dst_argb]"+r"(dst_argb), // %[dst_argb]
#if defined(__i386__) && defined(__pic__) #if defined(__i386__)
[width]"+m"(width) // %[width] [width]"+m"(width) // %[width]
#else #else
[width]"+rm"(width) // %[width] [width]"+rm"(width) // %[width]
...@@ -2152,7 +2152,7 @@ void OMITFP I422AlphaToARGBRow_AVX2(const uint8* y_buf, ...@@ -2152,7 +2152,7 @@ void OMITFP I422AlphaToARGBRow_AVX2(const uint8* y_buf,
[v_buf]"+r"(v_buf), // %[v_buf] [v_buf]"+r"(v_buf), // %[v_buf]
[a_buf]"+r"(a_buf), // %[a_buf] [a_buf]"+r"(a_buf), // %[a_buf]
[dst_argb]"+r"(dst_argb), // %[dst_argb] [dst_argb]"+r"(dst_argb), // %[dst_argb]
#if defined(__i386__) && defined(__pic__) #if defined(__i386__)
[width]"+m"(width) // %[width] [width]"+m"(width) // %[width]
#else #else
[width]"+rm"(width) // %[width] [width]"+rm"(width) // %[width]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment