Skip to content

Commit f4b4aef

Browse files
committed
Add stubs
1 parent 7a16ad6 commit f4b4aef

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed

contrib/aws-cmake/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ include("${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/AwsThreadAffinity.cmake")
2626
include("${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/AwsThreadName.cmake")
2727
include("${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/AwsSIMD.cmake")
2828
include("${ClickHouse_SOURCE_DIR}/contrib/aws-crt-cpp/cmake/AwsGetVersion.cmake")
29+
set (AWS_STUBS "${ClickHouse_SOURCE_DIR}/contrib/aws-cmake/aws_stubs.cpp")
2930

3031

3132
# Gather sources and options.
@@ -388,6 +389,8 @@ file(GLOB AWS_SDK_GLUE_SRC
388389
list(APPEND AWS_SOURCES ${AWS_SDK_GLUE_SRC})
389390
list(APPEND AWS_PUBLIC_INCLUDES "${AWS_SDK_GLUE_DIR}/include/")
390391

392+
list(APPEND AWS_SOURCES ${AWS_STUBS})
393+
391394
# Add library.
392395
add_library(_aws ${AWS_SOURCES})
393396

contrib/aws-cmake/aws_stubs.cpp

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
// aws_stubs.cpp
2+
#include <cstdio>
3+
#include <cstdlib>
4+
5+
extern "C" {
6+
7+
#define AWS_TRAP(sym) \
8+
__attribute__((weak)) void sym() { \
9+
std::fprintf(stderr, "TRAPPED: " #sym " called\n"); \
10+
std::abort(); \
11+
}
12+
13+
AWS_TRAP(aws_tls_client_ctx_new)
14+
AWS_TRAP(aws_tls_server_ctx_new)
15+
AWS_TRAP(aws_tls_init_static_state)
16+
AWS_TRAP(aws_tls_clean_up_static_state)
17+
AWS_TRAP(aws_mqtt_library_init)
18+
AWS_TRAP(aws_mqtt_library_clean_up)
19+
20+
} // extern "C"

0 commit comments

Comments
 (0)