[Mesa-stable] [Mesa-dev] [PATCH] swr: push/pop DEBUG macro around llvm includes
Jose Fonseca
jfonseca at vmware.com
Fri Jun 17 09:33:06 UTC 2016
On 17/06/16 03:13, Tim Rowley wrote:
> llvm redefines DEBUG; adding push/pop prevents a undefined reference
> to debug_refcnt_state in llvm-3.7+.
> ---
> src/gallium/drivers/swr/swr_shader.cpp | 9 ++++++---
> src/gallium/drivers/swr/swr_state.cpp | 6 +++++-
> 2 files changed, 11 insertions(+), 4 deletions(-)
>
> diff --git a/src/gallium/drivers/swr/swr_shader.cpp b/src/gallium/drivers/swr/swr_shader.cpp
> index 8af0700..3d966a8 100644
> --- a/src/gallium/drivers/swr/swr_shader.cpp
> +++ b/src/gallium/drivers/swr/swr_shader.cpp
> @@ -21,14 +21,17 @@
> * IN THE SOFTWARE.
> ***************************************************************************/
>
> +// llvm redefines DEBUG
> +#pragma push_macro("DEBUG")
I think you might want to undefine DEBUG here too.
See src/gallium/auxiliary/gallivm/lp_bld_misc.cpp
Jose
> #include "JitManager.h"
> +#include "llvm-c/Core.h"
> +#include "llvm/Support/CBindingWrapping.h"
> +#pragma pop_macro("DEBUG")
> +
> #include "state.h"
> #include "state_llvm.h"
> #include "builder.h"
>
> -#include "llvm-c/Core.h"
> -#include "llvm/Support/CBindingWrapping.h"
> -
> #include "tgsi/tgsi_strings.h"
> #include "gallivm/lp_bld_init.h"
> #include "gallivm/lp_bld_flow.h"
> diff --git a/src/gallium/drivers/swr/swr_state.cpp b/src/gallium/drivers/swr/swr_state.cpp
> index 3eeb98d..36ab353 100644
> --- a/src/gallium/drivers/swr/swr_state.cpp
> +++ b/src/gallium/drivers/swr/swr_state.cpp
> @@ -21,9 +21,13 @@
> * IN THE SOFTWARE.
> ***************************************************************************/
>
> +// llvm redefines DEBUG
> +#pragma push_macro("DEBUG")
> +#include "JitManager.h"
> +#pragma pop_macro("DEBUG")
> +
> #include "common/os.h"
> #include "jit_api.h"
> -#include "JitManager.h"
> #include "state_llvm.h"
>
> #include "gallivm/lp_bld_tgsi.h"
>
More information about the mesa-stable
mailing list