summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
authorTakashi Kokubun <takashikkbn@gmail.com>2019-08-30 13:16:32 (GMT)
committerTakashi Kokubun <takashikkbn@gmail.com>2019-08-30 13:33:21 (GMT)
commitb0a291f6f6a5834fd84807eb48be906ade429871 (patch)
treef50cbf53bc1eb94afa7f26a5383697f8ff91905f /mjit_worker.c
parent8c7f4e8f8b7f9e74195ea0eb51f39014fec342c0 (diff)
Split CC_LINKER_ARGS from CC_DLDFLAGS_ARGS
to drop MJIT_DLDFLAGS from compile_c_to_o for OpenBSD failure https://rubyci.org/logs/rubyci.s3.amazonaws.com/openbsd65/ruby-master/log/20190830T110008Z.fail.html.gz. 8c7f4e8f8b7f9e74195ea0eb51f39014fec342c0 did not work for i686-linux https://travis-ci.org/ruby/ruby/jobs/578808112.
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index 7bdc3c4..516dd87 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -268,8 +268,9 @@ static const char *const CC_DEBUG_ARGS[] = {MJIT_DEBUGFLAGS NULL};
static const char *const CC_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL};
static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL};
-static const char *const CC_DLDFLAGS_ARGS[] = {
- MJIT_DLDFLAGS
+static const char *const CC_DLDFLAGS_ARGS[] = {MJIT_DLDFLAGS NULL};
+// `CC_LINKER_ARGS` are linker flags which must be passed to `-c` as well.
+static const char *const CC_LINKER_ARGS[] = {
#if defined __GNUC__ && !defined __clang__ && !defined(__OpenBSD__)
"-nostartfiles",
#endif
@@ -792,7 +793,7 @@ compile_c_to_o(const char *c_file, const char *o_file)
"-c", NULL
};
- char **args = form_args(3, cc_common_args, CC_CODEFLAG_ARGS, files);
+ char **args = form_args(4, cc_common_args, CC_CODEFLAG_ARGS, files, CC_LINKER_ARGS);
if (args == NULL)
return false;
@@ -816,8 +817,8 @@ link_o_to_so(const char **o_files, const char *so_file)
NULL
};
- char **args = form_args(6, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
- options, o_files, CC_LIBS, CC_DLDFLAGS_ARGS);
+ char **args = form_args(7, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
+ options, o_files, CC_LIBS, CC_DLDFLAGS_ARGS, CC_LINKER_ARGS);
if (args == NULL)
return false;