Skip to content

Commit 10f277c

Browse files
author
Enrico Steffinlongo
authored
Merge pull request #7958 from tautschnig/bugfixes/memory-analyzer-config
Restrict memory-analyzer build to Linux x86_64/i386
2 parents 2bab0b3 + a738f6d commit 10f277c

File tree

5 files changed

+36
-26
lines changed

5 files changed

+36
-26
lines changed

CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,9 @@ function(cprover_default_properties)
199199
XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY ${CBMC_XCODE_ATTRIBUTE_CODE_SIGN_IDENTITY})
200200
endfunction()
201201

202-
if(CMAKE_SYSTEM_NAME STREQUAL Linux)
202+
if(CMAKE_SYSTEM_NAME STREQUAL Linux AND
203+
(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64" OR
204+
CMAKE_SYSTEM_PROCESSOR STREQUAL "i386"))
203205
set(WITH_MEMORY_ANALYZER_DEFAULT ON)
204206
else()
205207
set(WITH_MEMORY_ANALYZER_DEFAULT OFF)

regression/Makefile

+10-9
Original file line numberDiff line numberDiff line change
@@ -66,16 +66,17 @@ DIRS = cbmc-shadow-memory \
6666
book-examples \
6767
# Empty last line
6868

69-
ifeq ($(OS),Windows_NT)
70-
detected_OS := Windows
71-
else
69+
ifndef WITH_MEMORY_ANALYZER
70+
ifeq ($(OS),Windows_NT)
71+
WITH_MEMORY_ANALYZER = 0
72+
else
7273
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
73-
endif
74-
75-
ifeq ($(detected_OS),Linux)
76-
ifneq ($(WITH_MEMORY_ANALYZER),0)
77-
# only set if it wasn't explicitly unset
78-
WITH_MEMORY_ANALYZER=1
74+
detected_ARCH := $(shell sh -c 'uname -m 2>/dev/null || echo Unknown')
75+
ifeq ($(filter-out Linux_x86_64 Linux_i386,$(detected_OS)_$(detected_ARCH)),)
76+
WITH_MEMORY_ANALYZER = 1
77+
else
78+
WITH_MEMORY_ANALYZER = 0
79+
endif
7980
endif
8081
endif
8182

src/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,6 @@ add_subdirectory(symtab2gb)
122122
add_subdirectory(libcprover-cpp)
123123
add_subdirectory(goto-bmc)
124124

125-
if((NOT WIN32 AND NOT APPLE) OR WITH_MEMORY_ANALYZER)
125+
if(WITH_MEMORY_ANALYZER)
126126
add_subdirectory(memory-analyzer)
127127
endif()

src/Makefile

+12-6
Original file line numberDiff line numberDiff line change
@@ -46,16 +46,22 @@ all: cbmc.dir \
4646
symtab2gb.dir \
4747
# Empty last line
4848

49-
ifeq ($(OS),Windows_NT)
50-
detected_OS := Windows
51-
else
52-
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
49+
ifndef WITH_MEMORY_ANALYZER
50+
ifeq ($(OS),Windows_NT)
51+
WITH_MEMORY_ANALYZER = 0
52+
else
53+
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
54+
detected_ARCH := $(shell sh -c 'uname -m 2>/dev/null || echo Unknown')
55+
ifeq ($(filter-out Linux_x86_64 Linux_i386,$(detected_OS)_$(detected_ARCH)),)
56+
WITH_MEMORY_ANALYZER = 1
57+
else
58+
WITH_MEMORY_ANALYZER = 0
59+
endif
60+
endif
5361
endif
5462

5563
ifeq ($(WITH_MEMORY_ANALYZER),1)
5664
all: memory-analyzer.dir
57-
else ifneq ($(filter-out Windows Darwin,$(detected_OS)),)
58-
all: memory-analyzer.dir
5965
endif
6066

6167
###############################################################################

unit/Makefile

+10-9
Original file line numberDiff line numberDiff line change
@@ -201,16 +201,17 @@ SRC += analyses/ai/ai.cpp \
201201
util/xml.cpp \
202202
# Empty last line
203203

204-
ifeq ($(OS),Windows_NT)
205-
detected_OS := Windows
206-
else
204+
ifndef WITH_MEMORY_ANALYZER
205+
ifeq ($(OS),Windows_NT)
206+
WITH_MEMORY_ANALYZER = 0
207+
else
207208
detected_OS := $(shell sh -c 'uname 2>/dev/null || echo Unknown')
208-
endif
209-
210-
ifeq ($(detected_OS),Linux)
211-
ifneq ($(WITH_MEMORY_ANALYZER),0)
212-
# only set if it wasn't explicitly unset
213-
WITH_MEMORY_ANALYZER=1
209+
detected_ARCH := $(shell sh -c 'uname -m 2>/dev/null || echo Unknown')
210+
ifeq ($(filter-out Linux_x86_64 Linux_i386,$(detected_OS)_$(detected_ARCH)),)
211+
WITH_MEMORY_ANALYZER = 1
212+
else
213+
WITH_MEMORY_ANALYZER = 0
214+
endif
214215
endif
215216
endif
216217

0 commit comments

Comments
 (0)