mono/mono · warning

Mono Warning: --llvm not enabled in this runtime.

Error message

Mono Warning: --llvm not enabled in this runtime.

What it means

Emitted when the user passes --llvm on a supported architecture but this Mono runtime was compiled WITHOUT ENABLE_LLVM (LLVM backend not linked). It is a non-fatal warning; --llvm is ignored and the Mono JIT backend is used instead.

Source

Thrown at mono/mini/driver.c:1868

				g_free (mono_stats_method_desc);
			mono_stats_method_desc = parse_qualified_method_name (argv [i] + 8);
		} else if (strcmp (argv [i], "--break") == 0) {
			if (i+1 >= argc){
				fprintf (stderr, "Missing method name in --break command line option\n");
				exit (1);
			}
			
			if (!mono_debugger_insert_breakpoint (argv [++i], FALSE))
				fprintf (stderr, "Error: invalid method name '%s'\n", argv [i]);
		} else if (strncmp (argv[i], "--gc-params=", 12) == 0) {
			mono_gc_params_set (argv[i] + 12);
		} else if (strncmp (argv[i], "--gc-debug=", 11) == 0) {
			mono_gc_debug_set (argv[i] + 11);
		} else if (strcmp (argv [i], "--llvm") == 0) {
#ifndef MONO_ARCH_LLVM_SUPPORTED
			fprintf (stderr, "Mono Warning: --llvm not supported on this platform.\n");
#elif !defined(ENABLE_LLVM)
			fprintf (stderr, "Mono Warning: --llvm not enabled in this runtime.\n");
#else
			mono_use_llvm = TRUE;
#endif
		} else if (strcmp (argv [i], "--profile") == 0) {
			mini_add_profiler_argument (NULL);
		} else if (strncmp (argv [i], "--profile=", 10) == 0) {
			mini_add_profiler_argument (argv [i] + 10);
		} else if (argv [i][0] == '-' && argv [i][1] == '-' && mini_parse_debug_option (argv [i] + 2)) {
		} else {
			fprintf (stderr, "Unsupported command line option: '%s'\n", argv [i]);
			exit (1);
		}
	}

	if (trace_options != NULL) {
		/* 
		 * Need to call this before mini_init () so we can trace methods 
		 * compiled there too.

View on GitHub (pinned to 0f53e9e151)

Solutions

  1. Remove --llvm if you do not need it.
  2. Install/rebuild Mono with --enable-llvm (and a compatible mono-llvm).
  3. Verify ENABLE_LLVM via 'mono --version' build metadata or pkg-config mono.

Example fix

# before
mono --llvm app.exe   // ENABLE_LLVM not defined -> warning, ignored
# after (rebuild) ./configure --enable-llvm && make && mono --llvm app.exe
Defensive patterns

Strategy: type-guard

Validate before calling

# Confirm ENABLE_LLVM in the build before relying on --llvm
mono --version 2>&1 | grep -qi 'llvm' || { echo "LLVM not enabled; ignoring --llvm"; unset LLVM_FLAG; }

Type guard

#if defined(ENABLE_LLVM)
    run_with_llvm = 1;
#else
    /* skip --llvm */
#endif

Prevention

When it happens

Trigger: Running 'mono --llvm ...' where MONO_ARCH_LLVM_SUPPORTED is defined but the build did not enable LLVM (the #elif !defined(ENABLE_LLVM) branch fires).

Common situations: Mono package built with --disable-llvm or a minimal build; arch supports LLVM in principle but the vendor build omitted it.

Related errors


AI-assisted analysis of mono/mono@0f53e9e151 (2026-08-13). Data as JSON: /api/errors/c4474d58cfbef2c0. Report an issue: GitHub.