Re: problem building sparse 0.6.0 (sparse-llvm)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 4/25/19 6:55 PM, Randy Dunlap wrote:
> Hi,
> 
> I'm trying to build 0.6.0 and I get these error messages:
> 
>   CC      sparse-llvm.o
> In file included from /usr/include/llvm-c/Types.h:17:0,
>                  from /usr/include/llvm-c/ErrorHandling.h:17,
>                  from /usr/include/llvm-c/Core.h:18,
>                  from sparse-llvm.c:6:
> /usr/include/llvm/Support/DataTypes.h:57:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
>  # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
>    ^
> /usr/include/llvm/Support/DataTypes.h:61:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
>  # error "Must #define __STDC_CONSTANT_MACROS before " \
>    ^
> Makefile:206: recipe for target 'sparse-llvm.o' failed
> 
> 
> Any hints or help on that?
> 
> thanks.
> 

This is what I did to build sparse-llvm.  FWIW.

---
From: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>

Certain macros have to be defined in order to use the llvm
DataTypes.h header file.  Fixes these build errors when building
sparse-llvm:

  CC      sparse-llvm.o
In file included from /usr/include/llvm-c/Types.h:17:0,
                 from /usr/include/llvm-c/ErrorHandling.h:17,
                 from /usr/include/llvm-c/Core.h:18,
                 from sparse-llvm.c:6:
/usr/include/llvm/Support/DataTypes.h:57:3: error: #error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
 # error "Must #define __STDC_LIMIT_MACROS before #including Support/DataTypes.h"
   ^
/usr/include/llvm/Support/DataTypes.h:61:3: error: #error "Must #define __STDC_CONSTANT_MACROS before " "#including Support/DataTypes.h"
 # error "Must #define __STDC_CONSTANT_MACROS before " \
   ^

This is from using llvm 3.8.0.

Signed-off-by: Randy Dunlap <rdunlap@xxxxxxxxxxxxx>
---
 Makefile |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

--- sparse-0.6.0.orig/Makefile
+++ sparse-0.6.0/Makefile
@@ -160,7 +160,8 @@ ifeq ($(shell expr "$(LLVM_VERSION)" : '
 LLVM_PROGS := sparse-llvm
 $(LLVM_PROGS): LD := g++
 LLVM_LDFLAGS := $(shell $(LLVM_CONFIG) --ldflags)
-LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir)
+LLVM_CFLAGS := -I$(shell $(LLVM_CONFIG) --includedir) \
+	-D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS
 LLVM_LIBS := $(shell $(LLVM_CONFIG) --libs)
 LLVM_LIBS += $(shell $(LLVM_CONFIG) --system-libs 2>/dev/null)
 LLVM_LIBS += $(shell $(LLVM_CONFIG) --cxxflags | grep -F -q -e '-stdlib=libc++' && echo -lc++)




[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux