From 24f5a24c18b013cc25f61a136ed9927ce1b0c696 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Thu, 15 Dec 2022 19:34:23 +0100 Subject: [PATCH] BUILD: 51d: fix build issue with recent compilers With gcc-11.2 and binutils-2.37 I'm getting link errors due to multiply defined symbols when enabling USE_51DEGREES_V4. This is caused by two variables being present in hash.h instead of hash.c, hence they're defined twice. This patch just moves them to hash.c and turns their declaration to extern. No backport is needed since this was introduced in 2.8-dev. --- addons/51degrees/dummy/v4hash/hash/hash.c | 3 +++ addons/51degrees/dummy/v4hash/hash/hash.h | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/addons/51degrees/dummy/v4hash/hash/hash.c b/addons/51degrees/dummy/v4hash/hash/hash.c index 96e56050d9..e9a739ed45 100644 --- a/addons/51degrees/dummy/v4hash/hash/hash.c +++ b/addons/51degrees/dummy/v4hash/hash/hash.c @@ -36,6 +36,9 @@ static fiftyoneDegreesHeaders dummyHeaders = { }; static fiftyoneDegreesDataSetBase dummyDataSet = { &dummyHeaders }; +fiftyoneDegreesConfigHash fiftyoneDegreesHashInMemoryConfig; +fiftyoneDegreesPropertiesRequired fiftyoneDegreesPropertiesDefault; + fiftyoneDegreesDataSetBase* fiftyoneDegreesDataSetGet( fiftyoneDegreesResourceManager *manager) { return &dummyDataSet; diff --git a/addons/51degrees/dummy/v4hash/hash/hash.h b/addons/51degrees/dummy/v4hash/hash/hash.h index d899f6a382..5d04d17662 100644 --- a/addons/51degrees/dummy/v4hash/hash/hash.h +++ b/addons/51degrees/dummy/v4hash/hash/hash.h @@ -189,7 +189,7 @@ typedef struct fiftyone_degrees_config_hash_t { bool usePredictiveGraph; } fiftyoneDegreesConfigHash; -fiftyoneDegreesConfigHash fiftyoneDegreesHashInMemoryConfig; +extern fiftyoneDegreesConfigHash fiftyoneDegreesHashInMemoryConfig; typedef struct fiftyone_degrees_property_available_t { @@ -206,7 +206,7 @@ typedef struct fiftyone_degrees_properties_required_t { fiftyoneDegreesPropertiesAvailable *existing; } fiftyoneDegreesPropertiesRequired; -fiftyoneDegreesPropertiesRequired fiftyoneDegreesPropertiesDefault; +extern fiftyoneDegreesPropertiesRequired fiftyoneDegreesPropertiesDefault; typedef struct fiftyone_degrees_memory_reader_t { byte *startByte;