aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 14:00:04 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-10-07 14:00:04 +0000
commit41e4c47c5a58e2f597d7f350c101447ad5c11490 (patch)
tree6121e61287f2ee5bac48c79aa305f5b31c15a401 /include
parentca67625d5e89dcdf7e820364afc20b2d4d0f3355 (diff)
downloadruby-41e4c47c5a58e2f597d7f350c101447ad5c11490.tar.gz
include/ruby/intern.h: don't modify MJIT_FUNC_EXPORTED
on most of platforms except mswin. Changing it to static was needed for mswin because it doesn't use transform_mjit_header, but for platforms that use it, it causes link error like: /usr/bin/ld: /tmp/_ruby_mjit_p21652u0.o: relocation R_X86_64_PC32 against undefined symbol `rb_vm_search_method_slowpath' can not be used when making a shared object; recompile with -fPIC /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status include/ruby/defines.h: MJIT_FUNC_EXPORTED moved to intern.h git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64942 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/defines.h5
-rw-r--r--include/ruby/intern.h5
2 files changed, 6 insertions, 4 deletions
diff --git a/include/ruby/defines.h b/include/ruby/defines.h
index b7409a3e6c..fb80813f05 100644
--- a/include/ruby/defines.h
+++ b/include/ruby/defines.h
@@ -361,6 +361,11 @@ ruby_xrealloc2_with_location(void *ptr, size_t s1, size_t s2, const char *file,
#define MJIT_SYMBOL_EXPORT_BEGIN RUBY_SYMBOL_EXPORT_BEGIN
#define MJIT_SYMBOL_EXPORT_END RUBY_SYMBOL_EXPORT_END
+#if defined(MJIT_HEADER) && defined(_MSC_VER)
+# undef MJIT_FUNC_EXPORTED
+# define MJIT_FUNC_EXPORTED static
+#endif
+
#ifndef RUBY_EXTERN
#define RUBY_EXTERN extern
#endif
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index 3c625b42e9..11a97cb6a2 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -36,12 +36,9 @@ extern "C" {
/* On mswin, MJIT header transformation can't be used since cl.exe can't output
preprocessed output preserving macros. So this `MJIT_STATIC` is needed
- to force non-static function to static on MJIT header to avoid symbol conflict.
- `MJIT_FUNC_EXPORTED` is also changed to `static` on MJIT header for the same reason. */
+ to force non-static function to static on MJIT header to avoid symbol conflict. */
#ifdef MJIT_HEADER
# define MJIT_STATIC static
-# undef MJIT_FUNC_EXPORTED
-# define MJIT_FUNC_EXPORTED static
#else
# define MJIT_STATIC
#endif