diff options
author | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-25 02:52:29 +0000 |
---|---|---|
committer | normal <normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-06-25 02:52:29 +0000 |
commit | 65ab2ab1c053a3277b2dedbbba52bbaafb59b65f (patch) | |
tree | 74f93e060906826bc7b2c3332fc2bf56ca91ade0 /mjit.c | |
parent | d3e8d4f35aabceef90445532b10b160a5ef52fcf (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.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -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 |