diff --git a/share/libc/stdint.h b/share/libc/stdint.h
index 77d5775d9d55181dce274b0b27c5d606953cc9cb..839a90e3dc1132e9b5b6a947ef2c27164faf0ec4 100644
--- a/share/libc/stdint.h
+++ b/share/libc/stdint.h
@@ -147,9 +147,9 @@ typedef __UINTMAX_T uintmax_t;
 /* ISO C: 7.18.2.4 - Done directly with definition of corresponding types. */
 
 /* ISO C: 7.18.2.5 */
-#define INTMAX_MIN __FC_INTMAX_MIN
-#define INTMAX_MAX __FC_INTMAX_MAX
-#define UINTMAX_MAX __FC_UINTMAX_MAX
+#define INTMAX_MIN __INTMAX_MIN
+#define INTMAX_MAX __INTMAX_MAX
+#define UINTMAX_MAX __UINTMAX_MAX
 
 /* ISO C: 7.18.3 */
 
diff --git a/share/libc/sys/socket.h b/share/libc/sys/socket.h
index 5885125caafe53c8d88ffdb47095ed3a97f7d89a..f96e482a5e5a6ada267a7e4d7f40605abbf8503c 100644
--- a/share/libc/sys/socket.h
+++ b/share/libc/sys/socket.h
@@ -25,7 +25,7 @@
 #include "../features.h"
 __PUSH_FC_STDLIB
 __BEGIN_DECLS
-#include "../__fc_machdep.h"
+#include "__fc_machdep.h"
 
 #include "../errno.h"
 
diff --git a/share/libc/sys/types.h b/share/libc/sys/types.h
index 73ac60e89245e728374ec8684164b1d3b5ff3c3a..38ae7d90f8b15a832c296f94cc8f0607f4f09dee 100644
--- a/share/libc/sys/types.h
+++ b/share/libc/sys/types.h
@@ -26,7 +26,7 @@
 __PUSH_FC_STDLIB
 __BEGIN_DECLS
 
-#include "../__fc_machdep.h"
+#include "__fc_machdep.h"
 #include "../__fc_define_id_t.h"
 #include "../__fc_define_pid_t.h"
 #include "../__fc_define_size_t.h"
diff --git a/share/machdeps/.machdep_gcc_x86_16.yaml.validated b/share/machdeps/.machdep_gcc_x86_16.yaml.validated
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/share/machdeps/.machdep_msvc_x86_64.yaml.validated b/share/machdeps/.machdep_msvc_x86_64.yaml.validated
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/share/machdeps/Makefile b/share/machdeps/Makefile
index 3a71d5b18f210b0094de91e58a3ec57a9881b2cc..4c402758ded58ac45d7f05c8174d948287c0032e 100644
--- a/share/machdeps/Makefile
+++ b/share/machdeps/Makefile
@@ -19,8 +19,9 @@
 #  for more details (enclosed in the file licenses/LGPLv2.1).            #
 #                                                                        #
 ##########################################################################
+MANUAL_MACHDEPS=machdep_gcc_x86_16.yaml machdep_msvc_x86_64.yaml
 
-update-all: machdep_*.yaml
+update-all: machdep_*.yaml $(MANUAL_MACHDEPS:%=.%.validated)
 
 machdep_avr_16.yaml \
 machdep_gcc_x86_32.yaml \
@@ -35,8 +36,10 @@ machdep_%.yaml: machdep_gcc_%.yaml Makefile
              -e 's/sizeof_void: .*/sizeof_void: -1/' \
              -e 's/alignof_fun: .*/alignof_fun: -1/' \
              -e 's/compiler: .*/compiler: generic/' \
+             -e 's/machdep_name: *machdep_gcc_\([[:alnum:]]*\)/machdep_name: machdep_\1/' \
              $< > $@
 
-machdep_gcc_x86_16.yaml machdep_msvc_x86_64.yaml: %.yaml: machdep-schema.yaml
-	@echo "$@ is newer than $< and must be updated manually"
-	@exit 1
+.%.validated: % machdep-schema.yaml
+	@echo "Checking $*"
+	@./make_machdep/make_machdep.py --from-file $* --check-only
+	@touch $@
diff --git a/share/machdeps/machdep-schema.yaml b/share/machdeps/machdep-schema.yaml
index 3d8626026e8283545a6e869d0fbbd9745aa4eb3e..fd2956acbcc81e99978ca204a30930468e090c84 100644
--- a/share/machdeps/machdep-schema.yaml
+++ b/share/machdeps/machdep-schema.yaml
@@ -153,6 +153,14 @@ little_endian:
 
   type: boolean
 
+machdep_name:
+
+  description: |
+    name of the machdep. Will be used to define a macro allowing
+    to know during preprocessing which machdep has been selected.
+
+  type: string
+
 mb_cur_max:
 
   description: expansion of 'MB_CUR_MAX' macro
diff --git a/share/machdeps/machdep_avr_16.yaml b/share/machdeps/machdep_avr_16.yaml
index 3f4ec114124259142e80c1d5bc8b2905aa874261..be0110cb5e3988fd8abf5762d309f3e4b917e8b7 100644
--- a/share/machdeps/machdep_avr_16.yaml
+++ b/share/machdeps/machdep_avr_16.yaml
@@ -144,6 +144,7 @@ has__builtin_va_list: true
 intptr_t: int
 l_tmpnam: '20'
 little_endian: true
+machdep_name: machdep_avr_16
 mb_cur_max: ((size_t)16)
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/machdep_gcc_x86_16.yaml b/share/machdeps/machdep_gcc_x86_16.yaml
index e93b8af1b5daa67b42a0c3b1864f63ded4d2fe36..118a19fb1548543d496bf287413418c08dbc9032 100644
--- a/share/machdeps/machdep_gcc_x86_16.yaml
+++ b/share/machdeps/machdep_gcc_x86_16.yaml
@@ -168,3 +168,4 @@ l_tmpnam: '2048'
 tmp_max: '0xFFFFFFFF'
 rand_max: '32767'
 mb_cur_max: '((size_t)16)'
+machdep_name: machdep_gcc_x86_16
diff --git a/share/machdeps/machdep_gcc_x86_32.yaml b/share/machdeps/machdep_gcc_x86_32.yaml
index be5520f7fd3a839c9e48dd785dd6554f8c366c18..86de296ecf7f02dbb761b11da6096955ff6dc3be 100644
--- a/share/machdeps/machdep_gcc_x86_32.yaml
+++ b/share/machdeps/machdep_gcc_x86_32.yaml
@@ -142,6 +142,7 @@ has__builtin_va_list: true
 intptr_t: int
 l_tmpnam: '20'
 little_endian: true
+machdep_name: machdep_gcc_x86_32
 mb_cur_max: ((size_t) 16 )
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/machdep_gcc_x86_64.yaml b/share/machdeps/machdep_gcc_x86_64.yaml
index 4e076e08a4d2e5906dd6e40e2ffefcc032dc1e3d..8e471be4afade2fe6aa4b582f0b6dbb949a0eb25 100644
--- a/share/machdeps/machdep_gcc_x86_64.yaml
+++ b/share/machdeps/machdep_gcc_x86_64.yaml
@@ -142,6 +142,7 @@ has__builtin_va_list: true
 intptr_t: long
 l_tmpnam: '20'
 little_endian: true
+machdep_name: machdep_gcc_x86_64
 mb_cur_max: ((size_t) 16 )
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/machdep_msvc_x86_64.yaml b/share/machdeps/machdep_msvc_x86_64.yaml
index 6f0b88d2cd77377e4a3ab272b38d2e820c88e316..aec2dd33a28c81c1a8a540503fcdddbf6ec36ccd 100644
--- a/share/machdeps/machdep_msvc_x86_64.yaml
+++ b/share/machdeps/machdep_msvc_x86_64.yaml
@@ -96,7 +96,7 @@ errno:
 has__builtin_va_list: false
 intptr_t: signed long long
 little_endian: true
-nsig: 23
+nsig: '23'
 ptrdiff_t: long long
 # NB: wasn't defined at all in old __fc_machdep.h
 sig_atomic_t: int
@@ -129,5 +129,6 @@ fopen_max: '16'
 filename_max: '2048'
 l_tmpnam: '20'
 tmp_max: '0xFFFFFFFF'
-rand_max: 32767
+rand_max: '32767'
 mb_cur_max: '((size_t)16)'
+machdep_name: machdep_msvc_x86_64
diff --git a/share/machdeps/machdep_ppc_32.yaml b/share/machdeps/machdep_ppc_32.yaml
index c5d951a413026c3ea134bd53197fff75933a6e39..a295dd8ab58d0bc0c582c3e068d3b2100acccca1 100644
--- a/share/machdeps/machdep_ppc_32.yaml
+++ b/share/machdeps/machdep_ppc_32.yaml
@@ -144,6 +144,7 @@ has__builtin_va_list: true
 intptr_t: int
 l_tmpnam: '20'
 little_endian: false
+machdep_name: machdep_ppc_32
 mb_cur_max: ((size_t)16)
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/machdep_x86_16.yaml b/share/machdeps/machdep_x86_16.yaml
index a514e4449743947ba97aea6d78a5e45e22e303df..276ec58c4c65720960ab9156834f3d506ae754af 100644
--- a/share/machdeps/machdep_x86_16.yaml
+++ b/share/machdeps/machdep_x86_16.yaml
@@ -168,3 +168,4 @@ l_tmpnam: '2048'
 tmp_max: '0xFFFFFFFF'
 rand_max: '32767'
 mb_cur_max: '((size_t)16)'
+machdep_name: machdep_x86_16
diff --git a/share/machdeps/machdep_x86_32.yaml b/share/machdeps/machdep_x86_32.yaml
index 1ae9be5b6d86cd6ed93c0f4ced6c8639d2af9d70..5b8d5ad1fe6077b83d327eddb87fb0a6f76cd1e7 100644
--- a/share/machdeps/machdep_x86_32.yaml
+++ b/share/machdeps/machdep_x86_32.yaml
@@ -142,6 +142,7 @@ has__builtin_va_list: true
 intptr_t: int
 l_tmpnam: '20'
 little_endian: true
+machdep_name: machdep_x86_32
 mb_cur_max: ((size_t) 16 )
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/machdep_x86_64.yaml b/share/machdeps/machdep_x86_64.yaml
index e0b2e7dd95cafd285e531185608adbe20a0aae71..c572ec0c4a15cb8ecf123056f804f54babb46c6e 100644
--- a/share/machdeps/machdep_x86_64.yaml
+++ b/share/machdeps/machdep_x86_64.yaml
@@ -142,6 +142,7 @@ has__builtin_va_list: true
 intptr_t: long
 l_tmpnam: '20'
 little_endian: true
+machdep_name: machdep_x86_64
 mb_cur_max: ((size_t) 16 )
 nsig: (64 + 1)
 posix_version: 200809L
diff --git a/share/machdeps/make_machdep/make_machdep.py b/share/machdeps/make_machdep/make_machdep.py
index de474f0e2ea49ae1267ba8aa6e9c20a7baded287..531334e8659a52a1fd9d0ab618de2a34eb164d9d 100755
--- a/share/machdeps/make_machdep/make_machdep.py
+++ b/share/machdeps/make_machdep/make_machdep.py
@@ -51,7 +51,7 @@ my_path = Path(sys.argv[0]).parent
 
 parser = argparse.ArgumentParser(prog="make_machdep")
 parser.add_argument("-v", "--verbose", action="store_true")
-parser.add_argument("-o", default=sys.stdout, type=argparse.FileType("w"), dest="dest_file")
+parser.add_argument("-o", type=argparse.FileType("w"), dest="dest_file")
 parser.add_argument("--compiler", default="cc", help="which compiler to use; default is 'cc'")
 parser.add_argument(
     "--compiler-version",
@@ -83,33 +83,22 @@ parser.add_argument(
     type=str,
     help="flags to be given to the compiler (other than those set by --cpp-arch-flags); default is '-c'",
 )
-parser.add_argument("--check", action="store_true")
+parser.add_argument(
+    "--check",
+    action="store_true",
+    help="checks that the generated machdep is conforming to the schema"
+)
+parser.add_argument(
+    "--check-only",
+    action="store_true",
+    help="must be used in conjunction with --from-file to check that the provided input file is conforming to the schema"
+)
 
 args, other_args = parser.parse_known_args()
 
 if not args.compiler_flags:
     args.compiler_flags = ["-c"]
 
-
-if args.from_file:
-    orig_file = open(args.from_file, "r")
-    orig_machdep = yaml.safe_load(orig_file)
-    orig_file.close()
-    if not "compiler" in orig_machdep or not "cpp_arch_flags" in orig_machdep:
-        raise Exception("Missing fields in yaml file")
-    args.compiler = orig_machdep["compiler"]
-    if isinstance(orig_machdep["cpp_arch_flags"], list):
-        args.cpp_arch_flags = orig_machdep["cpp_arch_flags"]
-    else:  # old version of the schema used a single string
-        args.cpp_arch_flags = orig_machdep["cpp_arch_flags"].split()
-
-
-def print_machdep(machdep):
-    if args.in_place:
-        args.dest_file = open(args.from_file, "w")
-    yaml.dump(machdep, args.dest_file, indent=4, sort_keys=True)
-
-
 def make_schema():
     schema_filename = my_path.parent / "machdep-schema.yaml"
     with open(schema_filename, "r") as schema:
@@ -124,13 +113,40 @@ def check_machdep(machdep):
         from jsonschema import validate, ValidationError
 
         validate(machdep, schema)
+        return True
     except ImportError:
         warnings.warn("jsonschema is not available: no validation will be performed")
+        return True
     except OSError:
         warnings.warn(f"error opening {schema_filename}: no validation will be performed")
+        return True
     except ValidationError:
         warnings.warn("machdep object is not conforming to machdep schema")
+        return False
 
+if args.from_file:
+    orig_file = open(args.from_file, "r")
+    orig_machdep = yaml.safe_load(orig_file)
+    orig_file.close()
+    if args.check_only:
+        if check_machdep(orig_machdep):
+            exit(0)
+        else:
+            exit(1)
+    if not "compiler" in orig_machdep or not "cpp_arch_flags" in orig_machdep:
+        raise Exception("Missing fields in yaml file")
+    args.compiler = orig_machdep["compiler"]
+    if isinstance(orig_machdep["cpp_arch_flags"], list):
+        args.cpp_arch_flags = orig_machdep["cpp_arch_flags"]
+    else:  # old version of the schema used a single string
+        args.cpp_arch_flags = orig_machdep["cpp_arch_flags"].split()
+
+def print_machdep(machdep):
+    if args.from_file and args.in_place:
+        args.dest_file = open(args.from_file, "w")
+    elif args.dest_file is None:
+        args.dest_file = sys.stdout
+    yaml.dump(machdep, args.dest_file, indent=4, sort_keys=True)
 
 def make_machdep():
     machdep = {}
@@ -251,7 +267,6 @@ def find_macros_value(output,is_list=False,entry=None):
     if args.verbose:
         print(f"compiler output is:{output}")
 
-
 for (f, typ) in source_files:
     p = my_path / f
     cmd = compilation_command + [str(p)]
@@ -304,6 +319,12 @@ version = version_output.stdout.splitlines()[0]
 machdep["compiler"] = args.compiler
 machdep["cpp_arch_flags"] = args.cpp_arch_flags
 machdep["version"] = version
+if args.from_file and args.in_place:
+    machdep["machdep_name"] = Path(args.from_file).stem
+elif args.dest_file:
+    machdep["machdep_name"] = Path(args.dest_file.name).stem
+else:
+    machdep["machdep_name"] = "anonymous_machdep"
 
 missing_fields = [f for [f, v] in machdep.items() if v is None]
 
@@ -311,7 +332,4 @@ if missing_fields:
     print("WARNING: the following fields are missing from the machdep definition:")
     print(", ".join(missing_fields))
 
-if args.check:
-    check_machdep(machdep)
-
 print_machdep(machdep)
diff --git a/src/kernel_internals/runtime/machdep.ml b/src/kernel_internals/runtime/machdep.ml
index 154d2406396ac6416929a0b770e381d6a7fa54fb..a5cbdd49eb3303548e92e158c565f402fdeeac52 100644
--- a/src/kernel_internals/runtime/machdep.ml
+++ b/src/kernel_internals/runtime/machdep.ml
@@ -49,6 +49,7 @@ let gen_byte_order fmt mach =
 let no_signedness s =
   let s = Option.value  ~default:s (Extlib.string_del_prefix "signed" s) in
   let s = Option.value  ~default:s (Extlib.string_del_prefix "unsigned" s) in
+  let s = String.trim s in
   if s = "" then "int" else s
 
 let suff_of_kind =
@@ -123,8 +124,10 @@ let std_type_name mach =
     "unsigned", ("UINT", false);
     "unsigned int", ("UINT", false);
     "long", ("LONG", true);
+    "signed long", ("LONG", true);
     "unsigned long", ("ULONG", false);
     "long long", ("LLONG", true);
+    "signed long long", ("LLONG" ,true);
     "unsigned long long", ("ULLONG", false)
   ]
 
@@ -203,6 +206,7 @@ let gen_define_errno_macro fmt (name, v) =
 let gen_all_defines fmt mach =
   Format.fprintf fmt "/* Machdep-specific info for Frama-C's libc */@\n";
   Format.fprintf fmt "#ifndef __FC_MACHDEP@\n#define __FC_MACHDEP@\n";
+  gen_define_int fmt ("__FC_" ^ (String.uppercase_ascii mach.machdep_name)) 1;
   gen_byte_order fmt mach;
   gen_fixed_size_family fmt 8 mach;
   gen_fixed_size_family fmt 16 mach;
@@ -228,7 +232,7 @@ let gen_all_defines fmt mach =
   gen_intlike_max fmt "__FC_UINTPTR" mach.uintptr_t mach;
   gen_intlike_min fmt "__FC_WCHAR" mach.wchar_t mach;
   gen_intlike_max fmt "__FC_WCHAR" mach.wchar_t mach;
-  gen_intlike_max fmt "__SSIZE_MAX" mach.ssize_t mach;
+  gen_intlike_max fmt "__SSIZE" mach.ssize_t mach;
   gen_intlike_min fmt "__FC_PTRDIFF" mach.ptrdiff_t mach;
   gen_intlike_max fmt "__FC_PTRDIFF" mach.ptrdiff_t mach;
   gen_intlike_min fmt "__FC_WINT" mach.wint_t mach;
diff --git a/src/kernel_internals/runtime/machdep.mli b/src/kernel_internals/runtime/machdep.mli
index bba72de46465f0e009bd4afc14f99b28c6290e94..8b4118076abaed9de7cb95cf8b3b47e7f67d6ec8 100644
--- a/src/kernel_internals/runtime/machdep.mli
+++ b/src/kernel_internals/runtime/machdep.mli
@@ -22,8 +22,12 @@
 
 (** Managing machine-dependent information. *)
 
-(** generates a [__fc_machdep.h] file in a temp directory and returns the
-    directory name. The generated header contains all [#define] directives
+
+(** Prints on the given formatter all [#define] directives
     required by [share/libc/features.h] and other system-dependent headers.
 *)
+val gen_all_defines: Format.formatter -> Cil_types.mach -> unit
+
+(** generates a [__fc_machdep.h] file in a temp directory and returns the
+    directory name, to be added to the search path for preprocessing stdlib *)
 val generate_machdep_header: Cil_types.mach -> Filepath.Normalized.t
diff --git a/src/kernel_services/ast_data/cil_types.ml b/src/kernel_services/ast_data/cil_types.ml
index 36c2d0cd2359eef15e75f3de6f191b44a81f084f..a42c8f7076d57e46602167c90f9a2fc90b86e7cd 100644
--- a/src/kernel_services/ast_data/cil_types.ml
+++ b/src/kernel_services/ast_data/cil_types.ml
@@ -1916,6 +1916,7 @@ type mach = {
   mb_cur_max: string; (* expansion of MB_CUR_MAX macro *)
   nsig: string; (* expansion of non-standard NSIG macro, empty if undefined *)
   errno: (string * string) list; (* list of macros defining errors in errno.h*)
+  machdep_name: string; (* name of the machdep *)
 }
 
 (*
diff --git a/src/kernel_services/ast_queries/cil_datatype.ml b/src/kernel_services/ast_queries/cil_datatype.ml
index 8a146f1e941dd1d16c1c6592cb47924b2737ccd0..b92229e2a90c7b69f5a13df9f0bb76f9e3355904 100644
--- a/src/kernel_services/ast_queries/cil_datatype.ml
+++ b/src/kernel_services/ast_queries/cil_datatype.ml
@@ -2682,6 +2682,7 @@ let dummy_machdep =
       "eilseq", "84";
       "erange", "34";
     ];
+    machdep_name = "dummy";
   }
 
 module Machdep = Datatype.Make_with_collections(struct
diff --git a/src/kernel_services/ast_queries/file.ml b/src/kernel_services/ast_queries/file.ml
index bf84049df3f24a71ef15ad6187bb725676409598..2431ccb6c45cecef9f17d97bbf439d2886e6a2cc 100644
--- a/src/kernel_services/ast_queries/file.ml
+++ b/src/kernel_services/ast_queries/file.ml
@@ -396,6 +396,7 @@ type mach = Cil_types.mach = {
   mb_cur_max: string;
   nsig: string;
   errno: (string * string) list [@of_yaml yaml_dict_to_list];
+  machdep_name: string;
 }
 [@@deriving yaml]
 
@@ -419,6 +420,14 @@ let get_machdep () =
     | Error (`Msg s) ->
       Kernel.fatal "Error during machdep parsing: %s" s
 
+let print_machdep_header () =
+  if Kernel.PrintMachdepHeader.get () then begin
+      Machdep.gen_all_defines Format.std_formatter (get_machdep());
+      raise Cmdline.Exit
+    end else Cmdline.nop
+
+let () = Cmdline.run_after_exiting_stage print_machdep_header
+
 let list_available_machdeps () =
   CustomMachdeps.fold (fun m _ acc -> m :: acc) (default_machdeps ())
 
diff --git a/src/kernel_services/plugin_entry_points/kernel.ml b/src/kernel_services/plugin_entry_points/kernel.ml
index 656d60a3774fceaca97f28f2d8ac9d387ad585c1..a3507a0ac08575dd11e660d284a235db59edd8c4 100644
--- a/src/kernel_services/plugin_entry_points/kernel.ml
+++ b/src/kernel_services/plugin_entry_points/kernel.ml
@@ -429,6 +429,18 @@ module PrintMachdep =
       let help = "pretty print selected machdep"
     end)
 
+let () = Parameter_customize.set_group help
+let () = Parameter_customize.set_cmdline_stage Cmdline.Exiting
+let () = Parameter_customize.set_negative_option_name ""
+module PrintMachdepHeader =
+  False
+    (struct
+      let module_name = "PrintMachdepHeader"
+      let option_name = "-print-machdep-header"
+      let help =
+        "print on standard output the content of the generated __fc_machdep.h"
+    end)
+
 let () = Parameter_customize.set_group help
 let () = Parameter_customize.set_negative_option_name ""
 module DumpDependencies =
diff --git a/src/kernel_services/plugin_entry_points/kernel.mli b/src/kernel_services/plugin_entry_points/kernel.mli
index 0c9a85462af183fe4fa69472d76847ca85d3c3cf..0685544536d9ef176374d7f4ae65d02eb2567b1c 100644
--- a/src/kernel_services/plugin_entry_points/kernel.mli
+++ b/src/kernel_services/plugin_entry_points/kernel.mli
@@ -320,6 +320,10 @@ module PrintMachdep : Parameter_sig.Bool
 (** Behavior of option "-print-machdep"
     @since Phosphorus-20170501-beta1 *)
 
+module PrintMachdepHeader : Parameter_sig.Bool
+(** Behavior of option "-print-machdep-header"
+    @since Frama-C+dev *)
+
 module PrintLibc: Parameter_sig.Bool
 (** Behavior of option "-print-libc"
     @since Phosphorus-20170501-beta1 *)
diff --git a/tests/libc/runtime.c b/tests/libc/runtime.c
index ec7f02cf510f4293be5c1215a9fc6d403eae49ef..4ddb32fbb5c8dfcd6aae7415de4ba865ed028e49 100644
--- a/tests/libc/runtime.c
+++ b/tests/libc/runtime.c
@@ -1,6 +1,6 @@
 /* run.config*
    COMMENT: tests that the runtime can compile without errors (for PathCrawler, E-ACSL, ...)
-   CMD: gcc -D__FC_MACHDEP_X86_64 @FRAMAC_SHARE@/libc/__fc_runtime.c -Wno-attributes -std=c99 -Wall -Wwrite-strings -o @DEV_NULL@
+   CMD: @frama-c@ -print-machdep-header > __fc_machdep.h && gcc -I. -D__FC_MACHDEP_X86_64 @FRAMAC_SHARE@/libc/__fc_runtime.c -Wno-attributes -std=c99 -Wall -Wwrite-strings -o @DEV_NULL@
    OPT:
  */
 
diff --git a/tests/misc/custom_machdep.c b/tests/misc/custom_machdep.c
index 1e4388831b27dbee4287855c97700278b425b7f2..0fb4129d94d66d50f0bab3022463360254ea5ed8 100644
--- a/tests/misc/custom_machdep.c
+++ b/tests/misc/custom_machdep.c
@@ -5,10 +5,10 @@
    OPT: -cpp-extra-args="-I./@PTEST_NAME@ -D__FC_MACHDEP_CUSTOM" -machdep custom -print -then -print
   COMMENT: we need a -then to test double registering of a machdep
  EXIT: 0
+ MODULE:
  DEPS: @PTEST_NAME@/__fc_machdep_custom.h
    OPT: -cpp-extra-args="-I./@PTEST_NAME@ -D__FC_MACHDEP_CUSTOM" -machdep %{dep:@PTEST_DIR@/@PTEST_NAME@.yaml} -print
 */
-#include "__fc_machdep_custom.h"
 // most of the following includes are not directly used, but they test if
 // the custom machdep has defined the necessary constants
 #include <ctype.h>
diff --git a/tests/misc/custom_machdep.ml b/tests/misc/custom_machdep.ml
index d54408c49147ee7551c33516b9d6297d2961a872..859ea43d5d791e301d341c8d31ee8e78e63de703 100644
--- a/tests/misc/custom_machdep.ml
+++ b/tests/misc/custom_machdep.ml
@@ -55,6 +55,7 @@ let mach =
       "eilseq", "84";
       "erange", "34";
     ];
+    machdep_name = "custom_machdep";
   }
 
 let mach2 = { mach with compiler = "baz" }
diff --git a/tests/misc/custom_machdep.yaml b/tests/misc/custom_machdep.yaml
index 3d6c9ab0b58e15f69317632be22ce59085ebff6a..6e66f3e4667510741e042e14385e8e63964dff42 100644
--- a/tests/misc/custom_machdep.yaml
+++ b/tests/misc/custom_machdep.yaml
@@ -42,11 +42,12 @@ filename_max: '1023'
 l_tmpnam: '255'
 tmp_max: '255'
 rand_max: '0xFFFFFE'
-mb_cur_max: 16
+mb_cur_max: '16'
 sig_atomic_t: int
 time_t: long
 nsig: ''
 errno:
   edom: "33"
   eilseq: "84"
-  erange": "34"
+  erange: "34"
+machdep_name: custom_machdep
diff --git a/tests/syntax/assembly_gmp.c b/tests/syntax/assembly_gmp.c
index 0d39854c42ebfe3febd235f71c57c8f1622c99ba..fb707e0976786536b638ca7bb56e24bddab1e60b 100644
--- a/tests/syntax/assembly_gmp.c
+++ b/tests/syntax/assembly_gmp.c
@@ -86,7 +86,7 @@ File modified by CEA LIST for inclusion in Frama-C test suite
 #endif
 
 #ifndef add_mssaaaa
-#error "This test must run with machdep equals to x86_32, x86_64 or ppc_32"
+#error "This test must run with machdep equals to gcc_x86_32, gcc_x86_64, or ppc_32"
 #endif
 
 #define umul_ppmm(ph, pl, m0, m1) \
diff --git a/tests/syntax/machdep_char_unsigned.ml b/tests/syntax/machdep_char_unsigned.ml
index df75a01c3917b8ac92fd8d1ef9b5090dbe72e49c..fd26eedff20b1cb389541eaf444dc60e36354f05 100644
--- a/tests/syntax/machdep_char_unsigned.ml
+++ b/tests/syntax/machdep_char_unsigned.ml
@@ -54,6 +54,7 @@ let md = {
     "eilseq", "84";
     "erange", "34";
   ];
+  machdep_name = "machdep_char_unsigned";
 }
 
 let () =