summaryrefslogtreecommitdiff
path: root/mjit_worker.c
diff options
context:
space:
mode:
Diffstat (limited to 'mjit_worker.c')
-rw-r--r--mjit_worker.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/mjit_worker.c b/mjit_worker.c
index c09268f3e3..9c77722905 100644
--- a/mjit_worker.c
+++ b/mjit_worker.c
@@ -215,6 +215,8 @@ static VALUE valid_class_serials;
/* Used C compiler path. */
static const char *cc_path;
+/* Used C compiler flags. */
+static const char **cc_common_args;
/* Name of the precompiled header file. */
static char *pch_file;
/* The process id which should delete the pch_file on mjit_finish. */
@@ -238,10 +240,11 @@ static char *libruby_pathflag;
#if defined(__GNUC__) && \
(!defined(__clang__) || \
(defined(__clang__) && (defined(__FreeBSD__) || defined(__GLIBC__))))
-#define GCC_PIC_FLAGS "-Wfatal-errors", "-fPIC", "-shared", "-w", \
- "-pipe",
+# define GCC_PIC_FLAGS "-Wfatal-errors", "-fPIC", "-shared", "-w", "-pipe",
+# define MJIT_CFLAGS_PIPE 1
#else
-#define GCC_PIC_FLAGS /* empty */
+# define GCC_PIC_FLAGS /* empty */
+# define MJIT_CFLAGS_PIPE 0
#endif
static const char *const CC_COMMON_ARGS[] = {
@@ -741,7 +744,7 @@ make_pch(void)
rest_args[len - 2] = header_file;
rest_args[len - 3] = pch_file;
verbose(2, "Creating precompiled header");
- args = form_args(3, CC_COMMON_ARGS, CC_CODEFLAG_ARGS, rest_args);
+ args = form_args(3, cc_common_args, CC_CODEFLAG_ARGS, rest_args);
if (args == NULL) {
mjit_warning("making precompiled header failed on forming args");
CRITICAL_SECTION_START(3, "in make_pch");
@@ -785,7 +788,7 @@ compile_c_to_o(const char *c_file, const char *o_file)
# ifdef __clang__
files[4] = pch_file;
# endif
- args = form_args(5, CC_COMMON_ARGS, CC_CODEFLAG_ARGS, files, CC_LIBS, CC_DLDFLAGS_ARGS);
+ args = form_args(5, cc_common_args, CC_CODEFLAG_ARGS, files, CC_LIBS, CC_DLDFLAGS_ARGS);
if (args == NULL)
return FALSE;