summaryrefslogtreecommitdiff
path: root/mjit.c
diff options
context:
space:
mode:
authornormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-25 02:52:29 +0000
committernormal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-06-25 02:52:29 +0000
commit65ab2ab1c053a3277b2dedbbba52bbaafb59b65f (patch)
tree74f93e060906826bc7b2c3332fc2bf56ca91ade0 /mjit.c
parentd3e8d4f35aabceef90445532b10b160a5ef52fcf (diff)
mjit.c: set PIC flags on clang for FreeBSD and glibc
This seems required on FreeBSD 11.1 (clang 4.0.0) and Debian stretch (clang 3.8.1) for shared libraries. Note: Not checking __linux__ because there are statically-linked Linux distros (I don't know if they can support MJIT). But glibc doesn't support static linking, so we guard on that. Maybe other platforms will need this, too. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index 2f025a66b6..b207986c2b 100644
--- a/mjit.c
+++ b/mjit.c
@@ -616,7 +616,9 @@ free_list(struct rb_mjit_unit_list *list)
static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS NULL};
static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL};
-#if defined __GNUC__ && !defined __clang__
+#if defined(__GNUC__) && \
+ (!defined(__clang__) || \
+ (defined(__clang__) && (defined(__FreeBSD__) || defined(__GLIBC__))))
#define GCC_PIC_FLAGS "-Wfatal-errors", "-fPIC", "-shared", "-w", \
"-pipe",
#else