1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

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.

8c7f4e8f8b did not work for i686-linux
https://travis-ci.org/ruby/ruby/jobs/578808112.
This commit is contained in:
Takashi Kokubun 2019-08-30 22:16:32 +09:00
parent 8c7f4e8f8b
commit b0a291f6f6
No known key found for this signature in database
GPG key ID: 6FFC433B12EE23DD

View file

@ -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_OPTIMIZE_ARGS[] = {MJIT_OPTFLAGS NULL};
static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL}; static const char *const CC_LDSHARED_ARGS[] = {MJIT_LDSHARED GCC_PIC_FLAGS NULL};
static const char *const CC_DLDFLAGS_ARGS[] = { static const char *const CC_DLDFLAGS_ARGS[] = {MJIT_DLDFLAGS NULL};
MJIT_DLDFLAGS // `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__) #if defined __GNUC__ && !defined __clang__ && !defined(__OpenBSD__)
"-nostartfiles", "-nostartfiles",
#endif #endif
@ -792,7 +793,7 @@ compile_c_to_o(const char *c_file, const char *o_file)
"-c", NULL "-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) if (args == NULL)
return false; return false;
@ -816,8 +817,8 @@ link_o_to_so(const char **o_files, const char *so_file)
NULL NULL
}; };
char **args = form_args(6, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS, char **args = form_args(7, CC_LDSHARED_ARGS, CC_CODEFLAG_ARGS,
options, o_files, CC_LIBS, CC_DLDFLAGS_ARGS); options, o_files, CC_LIBS, CC_DLDFLAGS_ARGS, CC_LINKER_ARGS);
if (args == NULL) if (args == NULL)
return false; return false;