diff --git a/Lama.opam b/Lama.opam index 33dffba4e..558b47ab8 100644 --- a/Lama.opam +++ b/Lama.opam @@ -28,4 +28,8 @@ build: [ "@doc" {with-doc} ] ] -depexts: [ [ "gcc-14-multilib" ] {os-distribution = "ubuntu"} ] \ No newline at end of file +depexts: [ + [ "gcc-i686-linux-gnu" "linux-libc-dev:i386" "libc6-dev-i386-cross"] {os-distribution = "ubuntu"} + [ "libgcc-13-dev-i386-cross" ] {os-distribution = "ubuntu" & os-version >= "24.04" } + [ "libgcc-14-dev-i386-cross" ] {os-distribution = "ubuntu" & os-version >= "24.04" } +] diff --git a/Lama.opam.template b/Lama.opam.template index ca78f1b04..761e39f8b 100644 --- a/Lama.opam.template +++ b/Lama.opam.template @@ -1 +1,5 @@ -depexts: [ [ "gcc-14-multilib" ] {os-distribution = "ubuntu"} ] \ No newline at end of file +depexts: [ + [ "gcc-i686-linux-gnu" "linux-libc-dev:i386" "libc6-dev-i386-cross"] {os-distribution = "ubuntu"} + [ "libgcc-13-dev-i386-cross" ] {os-distribution = "ubuntu" & os-version >= "24.04" } + [ "libgcc-14-dev-i386-cross" ] {os-distribution = "ubuntu" & os-version >= "24.04" } +] diff --git a/runtime32/Makefile b/runtime32/Makefile index 7c48b70fa..7c7878419 100644 --- a/runtime32/Makefile +++ b/runtime32/Makefile @@ -1,6 +1,7 @@ RUNTIME=runtime.a .DEFAULT := $(RUNTIME) +CC := i686-linux-gnu-gcc $(RUNTIME): gc_runtime.o runtime.o ar rc $@ gc_runtime.o runtime.o diff --git a/src/X86_32.ml b/src/X86_32.ml index 0e95be2e6..71ead9279 100644 --- a/src/X86_32.ml +++ b/src/X86_32.ml @@ -833,8 +833,8 @@ let build cmd prog = let objs = find_objects (fst @@ fst prog) cmd#get_include_paths in let buf = Buffer.create 255 in List.iter (fun o -> Buffer.add_string buf o; Buffer.add_string buf " ") objs; - let gcc_cmdline = Printf.sprintf "gcc %s -m32 %s %s.s %s %s/runtime.a" cmd#get_debug cmd#get_output_option cmd#basename (Buffer.contents buf) inc in + let gcc_cmdline = Printf.sprintf "i686-linux-gnu-gcc %s %s %s.s %s %s/runtime.a" cmd#get_debug cmd#get_output_option cmd#basename (Buffer.contents buf) inc in Sys.command gcc_cmdline | `Compile -> - Sys.command (Printf.sprintf "gcc %s -m32 -c %s.s" cmd#get_debug cmd#basename) + Sys.command (Printf.sprintf "i686-linux-gnu-gcc %s -c %s.s" cmd#get_debug cmd#basename) | _ -> invalid_arg "must not happen"