Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Start testing on OCaml 4.13 #88

Merged
merged 15 commits into from
Oct 2, 2021
Prev Previous commit
Next Next commit
working 4.13 cross compiler
  • Loading branch information
anmonteiro committed Oct 2, 2021
commit 622e160061d4d18cdb914711b6c9091a6abe4cbe
28 changes: 28 additions & 0 deletions cross/cross_4_13.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
diff --git a/runtime/Makefile b/runtime/Makefile
index 3e40bdc6e..e8e4bc404 100644
--- a/runtime/Makefile
+++ b/runtime/Makefile
@@ -265,7 +265,9 @@ build_config.h: $(ROOTDIR)/Makefile.config sak$(EXE)
# Libraries and programs

ocamlrun$(EXE): prims.$(O) libcamlrun.$(A)
- $(MKEXE) -o $@ $^ $(LIBS)
+ cp $(OCAMLRUN) $@
+ chmod 755 $@
+ # $(MKEXE) -o $@ $^ $(LIBS)

ocamlruns$(EXE): prims.$(O) libcamlrun_non_shared.$(A)
$(call MKEXE_USING_COMPILER,$@,$^ $(LIBS))
diff --git a/tools/Makefile b/tools/Makefile
index 094f213e0..b20cefb3e 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -316,7 +316,7 @@ caml_tex := caml-tex$(EXE)
# configuration.
$(caml_tex): INCLUDES += $(addprefix -I $(ROOTDIR)/otherlibs/,str $(UNIXLIB))
$(caml_tex): $(caml_tex_files)
- $(OCAMLRUN) $(ROOTDIR)/ocamlc$(EXE) -nostdlib -I $(ROOTDIR)/stdlib \
+ $(CAMLC) -nostdlib -I $(ROOTDIR)/stdlib \
$(LINKFLAGS) -linkall -o $@ -no-alias-deps $^

# we need str and unix which depend on the bytecode version of other tools
12 changes: 9 additions & 3 deletions cross/ocaml.nix
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,11 @@ in
configureFlagsArray+=("PARTIALLD=$LD -r" "ASPP=$CC -c")
'';
configureFlags = o.configureFlags ++ [ "--disable-ocamldoc" ];
postConfigure = ''
echo 'SAK_CC=${buildPackages.stdenv.cc}/bin/gcc' >> Makefile.config
echo 'SAK_CFLAGS=$(OC_CFLAGS) $(OC_CPPFLAGS)' >> Makefile.config
echo 'SAK_LINK=$(SAK_CC) $(SAK_CFLAGS) $(OUTPUTEXE)$(1) $(2)' >> Makefile.config
'';

buildPhase = ''
runHook preBuild
Expand Down Expand Up @@ -235,9 +240,10 @@ in
'';
installTargets = o.installTargets ++ [ "installoptopt" ];
patches = [
(if lib.versionOlder "4.12" ocaml.version then ./cross_4_12.patch
else if lib.versionOlder "4.11" ocaml.version then ./cross_4_11.patch else
throw "OCaml ${ocaml.version} not supported for cross-compilation")
(if lib.versionOlder "4.13" ocaml.version then ./cross_4_13.patch
else if lib.versionOlder "4.12" ocaml.version then ./cross_4_12.patch
else if lib.versionOlder "4.11" ocaml.version then ./cross_4_11.patch
else throw "OCaml ${ocaml.version} not supported for cross-compilation")
];
});
fixOCamlPackage = b:
Expand Down