This partially reverts commit add502c648
.
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
pull/8786/head
parent
91aeae558d
commit
f76c6b8d0a
4 changed files with 15 additions and 8 deletions
@ -0,0 +1,12 @@ |
||||
/* See http://gcc.gnu.org/wiki/Visibility#How_to_use_the_new_C.2B-.2B-_visibility_support */ |
||||
#if defined(_WIN32) || defined(__CYGWIN__) |
||||
#ifdef BUILDING_DLL |
||||
#define DLL_PUBLIC __declspec(dllexport) |
||||
#else |
||||
#define DLL_PUBLIC __declspec(dllimport) |
||||
#endif |
||||
#else |
||||
#define DLL_PUBLIC __attribute__ ((visibility ("default"))) |
||||
#endif |
||||
|
||||
int DLL_PUBLIC cppfunc(void); |
Loading…
Reference in new issue