From 066cd812374460e5ca8be9a88f494fe3f5bf911e Mon Sep 17 00:00:00 2001 From: Damjan Marion Date: Thu, 5 Nov 2020 17:55:53 +0100 Subject: build: run garbage collection while linking plugins Ask linker to remove symbols which are not referenced or exported. Type: improvement Change-Id: Iec01fda7ec5b14bab8f36d25c2652bd6fe619961 Signed-off-by: Damjan Marion --- src/cmake/plugin.cmake | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src') diff --git a/src/cmake/plugin.cmake b/src/cmake/plugin.cmake index 516588c7b8b..2aae89510c1 100644 --- a/src/cmake/plugin.cmake +++ b/src/cmake/plugin.cmake @@ -46,6 +46,9 @@ macro(add_vpp_plugin name) add_library(${plugin_name} SHARED ${PLUGIN_SOURCES} ${api_includes}) set_target_properties(${plugin_name} PROPERTIES NO_SONAME 1) target_compile_options(${plugin_name} PRIVATE "-fvisibility=hidden") + target_compile_options (${plugin_name} PRIVATE "-ffunction-sections") + target_compile_options (${plugin_name} PRIVATE "-fdata-sections") + target_link_libraries (${plugin_name} "-Wl,--gc-sections") set(deps "") if(PLUGIN_API_FILES) list(APPEND deps ${plugin_name}_api_headers) -- cgit 1.2.3-korg >stable/1606 Vector Packet ProcessingGrokmirror user
summaryrefslogtreecommitdiffstats
blob: bce671f766c99c3aeb72fa2af8201cac12214639 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# Minimal clang-format version is 8

BasedOnStyle: GNU
UseTab: Always
SpaceAfterCStyleCast: true
SortIncludes: false
AlignConsecutiveMacros: true
BreakBeforeTernaryOperators: false
BreakBeforeBinaryOperators: None
ContinuationIndentWidth: 2

ForEachMacros:
  - 'clib_bitmap_foreach'
  - 'pool_foreach'
  - 'pool_foreach_index'
  - 'vec_foreach'
  - 'vec_foreach_backwards'
  - 'vec_foreach_index'
  - 'vec_foreach_index_backwards'
  - 'vlib_foreach_rx_tx'
  - 'foreach_vlib_main'