From 711dd14affd5d0d918cd5fd245328450e60c7111 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 3 Mar 2020 12:30:21 +0100 Subject: [PATCH] Don't define http_protocol and tls_protocol variables multiple times. As of gcc 10, the code generator emits globals without explicit initializer from .bss to .data, leading to: ld: listener.o:(.rodata+0x60): multiple definition of `http_protocol'; http.o:(.data.rel.ro.local+0x0): first defined here ld: tls.o:(.data.rel.ro.local+0x0): multiple definition of `tls_protocol'; listener.o:(.rodata+0x68): first defined here collect2: error: ld returned 1 exit status --- src/http.h | 2 +- src/tls.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/http.h b/src/http.h index c93b8c2f..828cee05 100644 --- a/src/http.h +++ b/src/http.h @@ -29,6 +29,6 @@ #include #include "protocol.h" -const struct Protocol *const http_protocol; +extern const struct Protocol *const http_protocol; #endif diff --git a/src/tls.h b/src/tls.h index 9b3b1c4d..14602c33 100644 --- a/src/tls.h +++ b/src/tls.h @@ -28,6 +28,6 @@ #include "protocol.h" -const struct Protocol *const tls_protocol; +extern const struct Protocol *const tls_protocol; #endif