diff options
| author | Andrea Corallo | 2021-02-16 22:54:49 +0100 |
|---|---|---|
| committer | Andrea Corallo | 2021-02-19 23:02:42 +0100 |
| commit | 39792cf62987ecc1a772f6a2027d6b32c70e8312 (patch) | |
| tree | 22bb1c6991acb16f43b504da5dd73c2e735573c1 /src/comp.c | |
| parent | 92fe7a91f4c88bb8661d4f1f15739849ddc01754 (diff) | |
| download | emacs-39792cf62987ecc1a772f6a2027d6b32c70e8312.tar.gz emacs-39792cf62987ecc1a772f6a2027d6b32c70e8312.zip | |
* Work around bug#46495 (GCC PR99126)
* src/comp.c (gcc_jit_context_add_command_line_option): Import for
dynamic load.
(Fcomp__compile_ctxt_to_file): Disable GCC "isolate-paths" on GCC
10.
Diffstat (limited to 'src/comp.c')
| -rw-r--r-- | src/comp.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/comp.c b/src/comp.c index 24c40f7c3ed..a8b8ef95fa1 100644 --- a/src/comp.c +++ b/src/comp.c | |||
| @@ -56,6 +56,7 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */ | |||
| 56 | #undef gcc_jit_block_end_with_return | 56 | #undef gcc_jit_block_end_with_return |
| 57 | #undef gcc_jit_block_end_with_void_return | 57 | #undef gcc_jit_block_end_with_void_return |
| 58 | #undef gcc_jit_context_acquire | 58 | #undef gcc_jit_context_acquire |
| 59 | #undef gcc_jit_context_add_command_line_option | ||
| 59 | #undef gcc_jit_context_add_driver_option | 60 | #undef gcc_jit_context_add_driver_option |
| 60 | #undef gcc_jit_context_compile_to_file | 61 | #undef gcc_jit_context_compile_to_file |
| 61 | #undef gcc_jit_context_dump_reproducer_to_file | 62 | #undef gcc_jit_context_dump_reproducer_to_file |
| @@ -124,6 +125,8 @@ DEF_DLL_FN (const char *, gcc_jit_context_get_first_error, | |||
| 124 | DEF_DLL_FN (gcc_jit_block *, gcc_jit_function_new_block, | 125 | DEF_DLL_FN (gcc_jit_block *, gcc_jit_function_new_block, |
| 125 | (gcc_jit_function *func, const char *name)); | 126 | (gcc_jit_function *func, const char *name)); |
| 126 | DEF_DLL_FN (gcc_jit_context *, gcc_jit_context_acquire, (void)); | 127 | DEF_DLL_FN (gcc_jit_context *, gcc_jit_context_acquire, (void)); |
| 128 | DEF_DLL_FN (void, gcc_jit_context_add_command_line_option, | ||
| 129 | (gcc_jit_context *ctxt, const char *optname)); | ||
| 127 | DEF_DLL_FN (void, gcc_jit_context_add_driver_option, | 130 | DEF_DLL_FN (void, gcc_jit_context_add_driver_option, |
| 128 | (gcc_jit_context *ctxt, const char *optname)); | 131 | (gcc_jit_context *ctxt, const char *optname)); |
| 129 | DEF_DLL_FN (gcc_jit_field *, gcc_jit_context_new_field, | 132 | DEF_DLL_FN (gcc_jit_field *, gcc_jit_context_new_field, |
| @@ -312,6 +315,7 @@ init_gccjit_functions (void) | |||
| 312 | LOAD_DLL_FN (library, gcc_jit_struct_set_fields); | 315 | LOAD_DLL_FN (library, gcc_jit_struct_set_fields); |
| 313 | LOAD_DLL_FN (library, gcc_jit_type_get_const); | 316 | LOAD_DLL_FN (library, gcc_jit_type_get_const); |
| 314 | LOAD_DLL_FN (library, gcc_jit_type_get_pointer); | 317 | LOAD_DLL_FN (library, gcc_jit_type_get_pointer); |
| 318 | LOAD_DLL_FN_OPT (library, gcc_jit_context_add_command_line_option); | ||
| 315 | LOAD_DLL_FN_OPT (library, gcc_jit_context_add_driver_option); | 319 | LOAD_DLL_FN_OPT (library, gcc_jit_context_add_driver_option); |
| 316 | LOAD_DLL_FN_OPT (library, gcc_jit_global_set_initializer); | 320 | LOAD_DLL_FN_OPT (library, gcc_jit_global_set_initializer); |
| 317 | LOAD_DLL_FN_OPT (library, gcc_jit_version_major); | 321 | LOAD_DLL_FN_OPT (library, gcc_jit_version_major); |
| @@ -330,6 +334,7 @@ init_gccjit_functions (void) | |||
| 330 | #define gcc_jit_block_end_with_return fn_gcc_jit_block_end_with_return | 334 | #define gcc_jit_block_end_with_return fn_gcc_jit_block_end_with_return |
| 331 | #define gcc_jit_block_end_with_void_return fn_gcc_jit_block_end_with_void_return | 335 | #define gcc_jit_block_end_with_void_return fn_gcc_jit_block_end_with_void_return |
| 332 | #define gcc_jit_context_acquire fn_gcc_jit_context_acquire | 336 | #define gcc_jit_context_acquire fn_gcc_jit_context_acquire |
| 337 | #define gcc_jit_context_add_command_line_option fn_gcc_jit_context_add_command_line_option | ||
| 333 | #define gcc_jit_context_add_driver_option fn_gcc_jit_context_add_driver_option | 338 | #define gcc_jit_context_add_driver_option fn_gcc_jit_context_add_driver_option |
| 334 | #define gcc_jit_context_compile_to_file fn_gcc_jit_context_compile_to_file | 339 | #define gcc_jit_context_compile_to_file fn_gcc_jit_context_compile_to_file |
| 335 | #define gcc_jit_context_dump_reproducer_to_file fn_gcc_jit_context_dump_reproducer_to_file | 340 | #define gcc_jit_context_dump_reproducer_to_file fn_gcc_jit_context_dump_reproducer_to_file |
| @@ -4375,6 +4380,16 @@ DEFUN ("comp--compile-ctxt-to-file", Fcomp__compile_ctxt_to_file, | |||
| 4375 | if (!EQ (HASH_VALUE (func_h, i), Qunbound)) | 4380 | if (!EQ (HASH_VALUE (func_h, i), Qunbound)) |
| 4376 | compile_function (HASH_VALUE (func_h, i)); | 4381 | compile_function (HASH_VALUE (func_h, i)); |
| 4377 | 4382 | ||
| 4383 | /* Work around bug#46495 (GCC PR99126). */ | ||
| 4384 | #if defined (WIDE_EMACS_INT) \ | ||
| 4385 | && (defined (LIBGCCJIT_HAVE_gcc_jit_context_add_command_line_option) \ | ||
| 4386 | || defined (WINDOWSNT)) | ||
| 4387 | Lisp_Object version = Fcomp_libgccjit_version (); | ||
| 4388 | if (!NILP (version) && XFIXNUM (XCAR (version)) == 10) | ||
| 4389 | gcc_jit_context_add_command_line_option (comp.ctxt, | ||
| 4390 | "-fdisable-tree-isolate-paths"); | ||
| 4391 | #endif | ||
| 4392 | |||
| 4378 | add_driver_options (); | 4393 | add_driver_options (); |
| 4379 | 4394 | ||
| 4380 | if (comp.debug) | 4395 | if (comp.debug) |