@@ -242,8 +242,11 @@ typedef struct MonoAotOptions {
242
242
gboolean child ;
243
243
char * tool_prefix ;
244
244
char * as_prefix ;
245
+ char * as_name ;
246
+ char * as_options ;
245
247
char * ld_flags ;
246
248
char * ld_name ;
249
+ char * ld_options ;
247
250
char * mtriple ;
248
251
char * llvm_path ;
249
252
char * temp_path ;
@@ -8940,10 +8943,16 @@ mono_aot_parse_options (const char *aot_options, MonoAotOptions *opts)
8940
8943
opts -> tool_prefix = g_strdup (arg + strlen ("tool-prefix=" ));
8941
8944
} else if (str_begins_with (arg , "as-prefix=" )) {
8942
8945
opts -> as_prefix = g_strdup (arg + strlen ("as-prefix=" ));
8946
+ } else if (str_begins_with (arg , "as-name=" )) {
8947
+ opts -> as_name = g_strdup (arg + strlen ("as-name=" ));
8948
+ } else if (str_begins_with (arg , "as-options=" )) {
8949
+ opts -> as_options = g_strdup (arg + strlen ("as-options=" ));
8943
8950
} else if (str_begins_with (arg , "ld-flags=" )) {
8944
8951
opts -> ld_flags = g_strdup (arg + strlen ("ld-flags=" ));
8945
8952
} else if (str_begins_with (arg , "ld-name=" )) {
8946
8953
opts -> ld_name = g_strdup (arg + strlen ("ld-name=" ));
8954
+ } else if (str_begins_with (arg , "ld-options=" )) {
8955
+ opts -> ld_options = g_strdup (arg + strlen ("ld-options=" ));
8947
8956
} else if (str_begins_with (arg , "soft-debug" )) {
8948
8957
opts -> soft_debug = TRUE;
8949
8958
// Intentionally undocumented x2-- deprecated
@@ -13222,8 +13231,16 @@ compile_asm (MonoAotCompile *acfg)
13222
13231
#ifdef TARGET_OSX
13223
13232
g_string_append (acfg -> as_args , "-c -x assembler " );
13224
13233
#endif
13234
+ const char * as_binary_name = acfg -> aot_opts .as_name ;
13235
+ if (as_binary_name == NULL ) {
13236
+ as_binary_name = AS_NAME ;
13237
+ }
13238
+ const char * as_options = acfg -> aot_opts .as_options ;
13239
+ if (as_options == NULL ) {
13240
+ as_options = AS_OPTIONS ;
13241
+ }
13225
13242
13226
- command = g_strdup_printf ("\"%s%s\" %s %s -o %s %s" , as_prefix , AS_NAME , AS_OPTIONS ,
13243
+ command = g_strdup_printf ("\"%s%s\" %s %s -o %s %s" , as_prefix , as_binary_name , as_options ,
13227
13244
acfg -> as_args ? acfg -> as_args -> str : "" ,
13228
13245
wrap_path (objfile ), wrap_path (acfg -> asm_fname ));
13229
13246
aot_printf (acfg , "Executing the native assembler: %s\n" , command );
@@ -13234,7 +13251,7 @@ compile_asm (MonoAotCompile *acfg)
13234
13251
}
13235
13252
13236
13253
if (acfg -> llvm && !acfg -> llvm_owriter ) {
13237
- command = g_strdup_printf ("\"%s%s\" %s %s -o %s %s" , as_prefix , AS_NAME , AS_OPTIONS ,
13254
+ command = g_strdup_printf ("\"%s%s\" %s %s -o %s %s" , as_prefix , as_binary_name , as_options ,
13238
13255
acfg -> as_args ? acfg -> as_args -> str : "" ,
13239
13256
wrap_path (acfg -> llvm_ofile ), wrap_path (acfg -> llvm_sfile ));
13240
13257
aot_printf (acfg , "Executing the native assembler: %s\n" , command );
@@ -13283,16 +13300,21 @@ compile_asm (MonoAotCompile *acfg)
13283
13300
13284
13301
str = g_string_new ("" );
13285
13302
const char * ld_binary_name = acfg -> aot_opts .ld_name ;
13303
+
13304
+ const char * ld_options = acfg -> aot_opts .ld_options ;
13305
+ if (ld_options == NULL ) {
13306
+ ld_options = LD_OPTIONS ;
13307
+ }
13286
13308
#if defined(LD_NAME )
13287
13309
if (ld_binary_name == NULL ) {
13288
13310
ld_binary_name = LD_NAME ;
13289
13311
}
13290
13312
if (acfg -> aot_opts .tool_prefix )
13291
- g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , LD_OPTIONS );
13313
+ g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , ld_options );
13292
13314
else if (acfg -> aot_opts .llvm_only )
13293
13315
g_string_append_printf (str , "%s" , acfg -> aot_opts .clangxx );
13294
13316
else
13295
- g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , LD_OPTIONS );
13317
+ g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , ld_options );
13296
13318
#else
13297
13319
if (ld_binary_name == NULL ) {
13298
13320
ld_binary_name = "ld" ;
@@ -13301,7 +13323,7 @@ compile_asm (MonoAotCompile *acfg)
13301
13323
// Default (linux)
13302
13324
if (acfg -> aot_opts .tool_prefix )
13303
13325
/* Cross compiling */
13304
- g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , LD_OPTIONS );
13326
+ g_string_append_printf (str , "\"%s%s\" %s" , tool_prefix , ld_binary_name , ld_options );
13305
13327
else if (acfg -> aot_opts .llvm_only )
13306
13328
g_string_append_printf (str , "%s" , acfg -> aot_opts .clangxx );
13307
13329
else
@@ -14232,8 +14254,11 @@ aot_opts_free (MonoAotOptions *aot_opts)
14232
14254
g_free (aot_opts -> dedup_include );
14233
14255
g_free (aot_opts -> tool_prefix );
14234
14256
g_free (aot_opts -> as_prefix );
14257
+ g_free (aot_opts -> as_name );
14258
+ g_free (aot_opts -> as_options );
14235
14259
g_free (aot_opts -> ld_flags );
14236
14260
g_free (aot_opts -> ld_name );
14261
+ g_free (aot_opts -> ld_options );
14237
14262
g_free (aot_opts -> mtriple );
14238
14263
g_free (aot_opts -> llvm_path );
14239
14264
g_free (aot_opts -> temp_path );
0 commit comments