Skip to content

Commit

Permalink
Link llvm statically and hide private symbols
Browse files Browse the repository at this point in the history
This fixes:

Set hide private symbols to on to avoid the following error:
 free(): invalid pointer
 Aborted (core dumped)

Reference: apache/tvm#9362
  • Loading branch information
cgerum committed Jul 4, 2022
1 parent 7b96974 commit 1f50ed4
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 8 deletions.
13 changes: 10 additions & 3 deletions cmake/cuda_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ set(USE_GRAPH_RUNTIME ON)
set(USE_GRAPH_RUNTIME_DEBUG ON)

# Whether enable additional vm profiler functions
set(USE_VM_PROFILER ON)
set(USE_PROFILER ON)

# Whether enable uTVM standalone runtime
set(USE_MICRO_STANDALONE_RUNTIME OFF)
Expand All @@ -116,7 +116,7 @@ set(USE_MICRO_STANDALONE_RUNTIME OFF)
# - OFF: disable llvm, note this will disable CPU codegen
# which is needed for most cases
# - /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is available.
set(USE_LLVM ON)
set(USE_LLVM "llvm-config --ignore-libllvm --link-static")

#---------------------------------------------
# Contrib libraries
Expand Down Expand Up @@ -264,7 +264,7 @@ set(USE_TF_TVMDSOOP OFF)
set(USE_FALLBACK_STL_MAP OFF)

# Whether to use hexagon device
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON OFF)
set(USE_HEXAGON_SDK /path/to/sdk)

# Whether to use ONNX codegen
Expand All @@ -278,3 +278,10 @@ set(USE_TARGET_ONNX ON)
# - OFF: disable PAPI support.
# - /path/to/folder/containing/: Path to folder containing papi.pc.
set(USE_PAPI OFF)


# Set hide private symbols to on to avoid the following error:
# free(): invalid pointer
# Aborted (core dumped)
# Reference: https://github.com/apache/tvm/issues/9362
set(HIDE_PRIVATE_SYMBOLS ON)
12 changes: 9 additions & 3 deletions cmake/micro_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ set(USE_GRAPH_EXECUTOR ON)
set(USE_GRAPH_EXECUTOR_DEBUG ON)

# Whether enable additional vm profiler functions
set(USE_VM_PROFILER OFF)
set(USE_PROFILER OFF)

# Whether enable uTVM standalone runtime
set(USE_MICRO_STANDALONE_RUNTIME ON)
Expand All @@ -116,7 +116,7 @@ set(USE_MICRO_STANDALONE_RUNTIME ON)
# - OFF: disable llvm, note this will disable CPU codegen
# which is needed for most cases
# - /path/to/llvm-config: enable specific LLVM when multiple llvm-dev is available.
set(USE_LLVM ON)
set(USE_LLVM "llvm-config --ignore-libllvm --link-static")

#---------------------------------------------
# Contrib libraries
Expand Down Expand Up @@ -264,8 +264,14 @@ set(USE_TF_TVMDSOOP OFF)
set(USE_FALLBACK_STL_MAP OFF)

# Whether to use hexagon device
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON OFF)
set(USE_HEXAGON_SDK /path/to/sdk)

# Whether to use ONNX codegen
set(USE_TARGET_ONNX ON)

# Set hide private symbols to on to avoid the following error:
# free(): invalid pointer
# Aborted (core dumped)
# Reference: https://github.com/apache/tvm/issues/9362
set(HIDE_PRIVATE_SYMBOLS ON)
11 changes: 9 additions & 2 deletions cmake/nocuda_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ set(USE_GRAPH_RUNTIME ON)
set(USE_GRAPH_RUNTIME_DEBUG ON)

# Whether enable additional vm profiler functions
set(USE_VM_PROFILER ON)
set(USE_PROFILER ON)

# Whether enable uTVM standalone runtime
set(USE_MICRO_STANDALONE_RUNTIME OFF)
Expand Down Expand Up @@ -264,7 +264,7 @@ set(USE_TF_TVMDSOOP OFF)
set(USE_FALLBACK_STL_MAP OFF)

# Whether to use hexagon device
set(USE_HEXAGON_DEVICE OFF)
set(USE_HEXAGON OFF)
set(USE_HEXAGON_SDK /path/to/sdk)

# Whether to use ONNX codegen
Expand All @@ -278,3 +278,10 @@ set(USE_TARGET_ONNX ON)
# - OFF: disable PAPI support.
# - /path/to/folder/containing/: Path to folder containing papi.pc.
set(USE_PAPI OFF)


# Set hide private symbols to on to avoid the following error:
# free(): invalid pointer
# Aborted (core dumped)
# Reference: https://github.com/apache/tvm/issues/9362
set(HIDE_PRIVATE_SYMBOLS ON)

0 comments on commit 1f50ed4

Please sign in to comment.