Skip to content

Commit 44eb888

Browse files
committed
__declspec(dllimport) on 64-bit MSVC not 32-bit
The reason to add __declspec(dllimport) is that [void *_imp__XXX = &XXX;] inserted by flexlink for unresolved __declspec(dllimport) symbols are automatically 64-bit references on 64-bit MSVC archs. That removes the 'RELOC_REL32, target is too far' errors. On 32-bit MSVC archs, the RELOC_REL32 erro should not be encountered since all DLLs will be within the same 2GiB virtual address space.
1 parent 42ac100 commit 44eb888

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
diff --git a/runtime/caml/misc.h b/runtime/caml/misc.h
2-
index c605f87..43e8762 100644
2+
index c605f87..41c5e50 100644
33
--- a/runtime/caml/misc.h
44
+++ b/runtime/caml/misc.h
5-
@@ -116,6 +116,8 @@ CAMLdeprecated_typedef(addr, char *);
5+
@@ -114,7 +114,7 @@ CAMLdeprecated_typedef(addr, char *);
6+
7+
#ifndef CAMLDLLIMPORT
68
#if defined(SUPPORT_DYNAMIC_LINKING) && defined(ARCH_SIXTYFOUR) \
7-
&& (defined(__CYGWIN__) || defined(__MINGW32__))
9+
- && (defined(__CYGWIN__) || defined(__MINGW32__))
10+
+ && (defined(__CYGWIN__) || defined(__MINGW32__) || defined(_MSC_VER))
811
#define CAMLDLLIMPORT __declspec(dllimport)
9-
+ #elif defined(SUPPORT_DYNAMIC_LINKING) && defined(_MSC_VER)
10-
+ #define CAMLDLLIMPORT __declspec(dllimport)
1112
#else
1213
#define CAMLDLLIMPORT
13-
#endif

0 commit comments

Comments
 (0)