-
Notifications
You must be signed in to change notification settings - Fork 4.8k
/
vpp_vcl.patch
153 lines (146 loc) · 4.67 KB
/
vpp_vcl.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
diff --git src/CMakeLists.txt src/CMakeLists.txt
index 68d0a4f..9bf7ade 100644
--- src/CMakeLists.txt
+++ src/CMakeLists.txt
@@ -50,13 +50,8 @@ include(cmake/ccache.cmake)
##############################################################################
# VPP Version
##############################################################################
-execute_process(
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND scripts/version
- OUTPUT_VARIABLE VPP_VERSION
- OUTPUT_STRIP_TRAILING_WHITESPACE
-)
+set(VPP_VERSION 24.03-dev)
if (VPP_PLATFORM)
set(VPP_VERSION ${VPP_VERSION}-${VPP_PLATFORM_NAME})
endif()
@@ -277,8 +272,7 @@ elseif(${CMAKE_SYSTEM_NAME} MATCHES "Linux|FreeBSD")
find_package(OpenSSL)
set(SUBDIRS
vppinfra svm vlib vlibmemory vlibapi vnet vpp vat vat2 vcl vpp-api
- plugins tools/vppapigen tools/g2 tools/perftool cmake pkg
- tools/appimage
+ tools/vppapigen cmake pkg
)
elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Darwin")
set(SUBDIRS vppinfra)
diff --git src/cmake/ccache.cmake src/cmake/ccache.cmake
index a7b395b..d6a4c5b 100644
--- src/cmake/ccache.cmake
+++ src/cmake/ccache.cmake
@@ -14,7 +14,7 @@
##############################################################################
# ccache
##############################################################################
-option(VPP_USE_CCACHE "Use ccache compiler cache." ON)
+option(VPP_USE_CCACHE "Use ccache compiler cache." OFF)
if(VPP_USE_CCACHE)
find_program(CCACHE_FOUND ccache)
message(STATUS "Looking for ccache")
diff --git src/cmake/library.cmake src/cmake/library.cmake
index 45b3944..b1dcc56 100644
--- src/cmake/library.cmake
+++ src/cmake/library.cmake
@@ -24,7 +24,7 @@ macro(add_vpp_library lib)
set_target_properties(${lo} PROPERTIES POSITION_INDEPENDENT_CODE ON)
target_compile_options(${lo} PUBLIC ${VPP_DEFAULT_MARCH_FLAGS})
- add_library(${lib} SHARED)
+ add_library(${lib} STATIC)
target_sources(${lib} PRIVATE $<TARGET_OBJECTS:${lo}>)
if(VPP_LIB_VERSION)
diff --git src/tools/vppapigen/CMakeLists.txt src/tools/vppapigen/CMakeLists.txt
index 04ebed5..bfabc3a 100644
--- src/tools/vppapigen/CMakeLists.txt
+++ src/tools/vppapigen/CMakeLists.txt
@@ -11,22 +11,6 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-find_package(
- Python3
- REQUIRED
- COMPONENTS Interpreter
-)
-
-execute_process(
- COMMAND ${Python3_EXECUTABLE} -c "import ply"
- RESULT_VARIABLE _rv
- OUTPUT_QUIET
-)
-
-if (NOT ${_rv} EQUAL 0)
- message( FATAL_ERROR "The \"ply\" Python3 package is not installed.")
-endif()
-
install(
FILES vppapigen.py
RENAME vppapigen
diff --git src/tools/vppapigen/vppapigen.py src/tools/vppapigen/vppapigen.py
index 2b0ce99..f28a173 100755
--- src/tools/vppapigen/vppapigen.py
+++ src/tools/vppapigen/vppapigen.py
@@ -7,6 +7,13 @@ import logging
import binascii
import os
from subprocess import Popen, PIPE
+
+# Put ply on the path ...
+plypath = os.path.join(
+ os.environ["EXT_BUILD_ROOT"],
+ os.path.dirname(os.environ["PLYPATHS"].split()[0]))
+sys.path += [plypath]
+
import ply.lex as lex
import ply.yacc as yacc
diff --git src/vcl/CMakeLists.txt src/vcl/CMakeLists.txt
index 610b422..c5e6f8c 100644
--- src/vcl/CMakeLists.txt
+++ src/vcl/CMakeLists.txt
@@ -35,6 +35,8 @@ if (LDP_HAS_GNU_SOURCE)
add_compile_definitions(HAVE_GNU_SOURCE)
endif(LDP_HAS_GNU_SOURCE)
+file(COPY vppcom.h DESTINATION ${CMAKE_LIBRARY_OUTPUT_DIRECTORY})
+
add_vpp_library(vcl_ldpreload
SOURCES
ldp_socket_wrapper.c
diff --git src/vppinfra/CMakeLists.txt src/vppinfra/CMakeLists.txt
index f34ceed..51fd2be 100644
--- src/vppinfra/CMakeLists.txt
+++ src/vppinfra/CMakeLists.txt
@@ -233,13 +233,28 @@ option(VPP_USE_EXTERNAL_LIBEXECINFO "Use external libexecinfo (useful for non-gl
if(VPP_USE_EXTERNAL_LIBEXECINFO)
set(EXECINFO_LIB execinfo)
endif()
-add_vpp_library(vppinfra
- SOURCES ${VPPINFRA_SRCS}
- LINK_LIBRARIES m ${EXECINFO_LIB}
- INSTALL_HEADERS ${VPPINFRA_HEADERS}
- COMPONENT libvppinfra
- LTO
-)
+
+# GCC versions 11 and 12 at least have some kind of bug when
+# LTO runs out of memory and breaking Envoy builds with gcc
+# as a result. So we conditionally disable LTO on GCC builds
+# to workaround the issue.
+if(CMAKE_C_COMPILER_ID STREQUAL "GNU")
+ add_vpp_library(vppinfra
+ SOURCES ${VPPINFRA_SRCS}
+ LINK_LIBRARIES m ${EXECINFO_LIB}
+ INSTALL_HEADERS ${VPPINFRA_HEADERS}
+ COMPONENT libvppinfra
+ )
+else()
+ add_vpp_library(vppinfra
+ SOURCES ${VPPINFRA_SRCS}
+ LINK_LIBRARIES m ${EXECINFO_LIB}
+ INSTALL_HEADERS ${VPPINFRA_HEADERS}
+ COMPONENT libvppinfra
+ LTO
+ )
+endif()
+
##############################################################################
# vppinfra headers