From f76c6b8d0a7966ab43d826dc3e19de4ccaa1f7e4 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 20 May 2021 23:12:38 +0100 Subject: Fix LTO test on Cygwin This partially reverts commit add502c6483bde9dc6a0ba80b3c79163304465a4. In 'linkshared' test, annotate cppfunc() as imported, so an indirection through an import stub is generated, avoiding a relocation size error when building using gcc for Cygwin with LTO on. Align with the example of how to write this portably in [1]. The 'c' language part of that test already gets this right. [1] http://gcc.gnu.org/wiki/Visibility --- test cases/common/6 linkshared/cpplib.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'test cases/common/6 linkshared/cpplib.cpp') diff --git a/test cases/common/6 linkshared/cpplib.cpp b/test cases/common/6 linkshared/cpplib.cpp index 395859d27..247f8201a 100644 --- a/test cases/common/6 linkshared/cpplib.cpp +++ b/test cases/common/6 linkshared/cpplib.cpp @@ -1,8 +1,5 @@ -#if defined _WIN32 - #define DLL_PUBLIC __declspec(dllexport) -#else - #define DLL_PUBLIC __attribute__ ((visibility ("default"))) -#endif +#define BUILDING_DLL +#include "cpplib.h" int DLL_PUBLIC cppfunc(void) { return 42; -- cgit v1.2.3