Skip to content

Commit

Permalink
Squashed 'ocaml/' changes from 5bf2820..b11eea1
Browse files Browse the repository at this point in the history
b11eea1 flambda-backend: Introduce Import_info (#1036)
bc5b135 flambda-backend: Fix `ocamlobjinfo` on flambda2 .cmx files (#1029)
c8babbd flambda-backend: Compilation_unit optimisations (#1035)
e8d3e22 flambda-backend: Use 4.14.0 opam switch for building (includes upgrading ocamlformat to 0.24.1) (#1030)
eb14a86 flambda-backend: Port PR81 from ocaml-jst (#1024)
131bc12 flambda-backend: Merge ocaml-jst 2022-12-13 (#1022)
06c189a flambda-backend: Make stack allocation the default (#1013)
98debd5 flambda-backend: Initial support for value slots not of value kind (#946)
deb1714 flambda-backend: Add is_last flag to closinfo words (#938)
d07fce1 flambda-backend: Disable poll insertion in Configure (#967)
0f1ce0e flambda-backend: Regenerate ocaml/configure autoconf 2.69 (instead of 2.71) (#1012)
27132d8 flambda-backend: Fix for spurious typing error related to expanding through functor arguments (#997)
724fb68 flambda-backend: Use `Compilation_unit.t` instead of `Ident.t` for globals (#871)
396d5b8 flambda-backend: Add a test for frametable setup in natdynlinked libraries (#983)
b73ab12 flambda-backend: Fix invocation of `caml_shared_startup` in native dynlink (#980)
7c7d75a flambda-backend: Fix split_default_wrapper which did not trigger anymore with flambda2 (#970)
8fb75bd flambda-backend: Port ocaml/ocaml#11727 and ocaml/ocaml#11732 (#965)
fdb7987 flambda-backend: Fix include functor issue after 4.14 merge. (#948)
9745cdb flambda-backend: Print -dprofile/-dtimings output to stdout like 4.12 (#943)
5f51f21 flambda-backend: Merge pull request #932 from mshinwell/4.14-upgrade
841687d flambda-backend: Run make alldepend in ocaml/ (#936)
72a7658 flambda-backend: Remove reformatting changes only in dynlink/dune (preserving PR889 and adjusting to minimise diff)
6d758cd flambda-backend: Revert whitespace changes in dune files, to match upstream
c86bf6e flambda-backend: Remove duplicate tests for polling
971dbeb flambda-backend: Testsuite fixes
32f8356 flambda-backend: Topeval fix for symbols patch
befea01 flambda-backend: Compilation fixes / rectify merge faults
a84543f flambda-backend: Merge ocaml-jst
8e65056 flambda-backend: Merge ocaml-jst
4d70045 flambda-backend: Remove filename from system frametable (amd64) (#920)
5e57b7d flambda-backend: Bugfix for runtime frame_descr logic for C frames (#918)
6423d5e flambda-backend: Merge pull request #914 from mshinwell/merge-ocaml-jst-2022-10-24
ead605c flambda-backend: Add a missing Extract_exception (#916)
c8f1481 flambda-backend: Resolve conflicts and add specialise/specialised attributes to Builtin_attributes
cf4d0d3 flambda-backend: Merge fixes (#21)
c2f742f flambda-backend: Re-enable some tests for Flambda2 (#881)
3d38d13 flambda-backend: Long frames in frametable (#797)
85aec7b flambda-backend: Add loop attribute to Builtin_attributes
c0f16e3 flambda-backend: Compilation fixes
90dea23 flambda-backend: Merge flambda-backend/main
5acc6ea flambda-backend: Fixes after merge
e501946 flambda-backend: Merge ocaml-jst
115083b flambda-backend: Merge ocaml-jst
9943b2e flambda-backend: Revert "Revert "Transform tail-recursive functions into recursive continuations (#893)"" (#909)
ce339f1 flambda-backend: Fix alloc modes and call kinds for overapplications (#902)
e6a317c flambda-backend: Revert "Transform tail-recursive functions into recursive continuations (#893)"
853c488 flambda-backend: Transform tail-recursive functions into recursive continuations (#893)
5a977e4 flambda-backend: Fix missing End_region primitives on switch arms (#898)
7fa7f9d flambda-backend: Add missing dependencies to Dune files (#889)
3cd36f0 flambda-backend: Have Lambda `Pgetglobal` and `Psetglobal` take `Compilation_unit.t` (#896)
7565915 flambda-backend: [@poll error] attribute (#745)
9eb9448 flambda-backend: Backport the main safepoints PRs (#740)
689bdda flambda-backend: Add strict mode for ocamldep (#892)

git-subtree-dir: ocaml
git-subtree-split: b11eea1
  • Loading branch information
mshinwell committed Dec 28, 2022
1 parent f19369b commit f97a773
Show file tree
Hide file tree
Showing 221 changed files with 9,945 additions and 7,090 deletions.
169 changes: 122 additions & 47 deletions .depend

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ jobs:

- name: i386
config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386'
os: ubuntu-latest
os: ubuntu-20.04
ocamlparam: ''
boot_config: CC='cc32' AS='as --32' ASPP='gcc -m32 -c' -host i386-linux PARTIALLD='ld -r -melf_i386'
boot_cachekey: 32bit
Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ _build
/ocamldoc/test_stdlib
/ocamldoc/test_latex
/ocamldoc/test
/ocamldoc/stdlib_man

/ocamltest/.dep
/ocamltest/ocamltest
Expand All @@ -143,6 +144,7 @@ _build
/otherlibs/dynlink/dynlink_compilerlibs/*.ml
/otherlibs/dynlink/dynlink_compilerlibs/*.mli
/otherlibs/dynlink/dynlink_compilerlibs/.depend
/otherlibs/dynlink/dynlink_compilerlibs.mli
/otherlibs/threads/marshal.mli
/otherlibs/threads/stdlib.mli
/otherlibs/threads/unix.mli
Expand Down Expand Up @@ -240,6 +242,7 @@ _build
/tools/ocamlprof
/tools/ocamlprof.opt
/tools/opnames.ml
/tools/ocamlmklibconfig.ml
/tools/dumpobj
/tools/dumpobj.opt
/tools/dumpapprox
Expand Down
30 changes: 28 additions & 2 deletions HACKING.jst.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

ocaml-jst has a dune-based build system which is different from
upstream OCaml. To get started, you'll need a working install of OCaml
4.12 and dune, e.g. via OPAM:
4.14 and dune, e.g. via OPAM:

$ opam switch create 4.12.0
$ opam switch create 4.14.0
$ eval $(opam env)
$ opam install dune

Expand All @@ -28,3 +28,29 @@ to build without running the testsuite, or:
$ make -f Makefile.jst hacking

to start a continuously polling build of the compiler.

Note that the dune-based build system is entirely separate from the main
Makefile, and so you will need to use `make -f Makefile.jst install`
to install after building.

## Testing

As demonstrated above, you can

$ make -f Makefile.jst runtest-upstream

to run the entire testsuite. As a shorter synonym, you may also

$ make -f Makefile.jst test

If you want to run just one test or one test directory, you can

$ make -f Makefile.jst test-one TEST=<<test file here>>
$ make -f Makefile.jst test-one DIR=<<test dir here>>

where the test file or test dir are specified with respect to the
`testsuite/tests` directory. For example:

$ make -f Makefile.jst test-one TEST=typing-local/local.ml
$ make -f Makefile.jst test-one DIR=typing-local

18 changes: 16 additions & 2 deletions Makefile.common-jst
Original file line number Diff line number Diff line change
Expand Up @@ -169,15 +169,18 @@ main_build = _build/main

# The following horror will be removed when work to allow the testsuite to
# run on an installed tree (led by David Allsopp) is completed.
.PHONY: runtest-upstream
runtest-upstream: _install
.PHONY: runtest-upstream test install_for_test
install_for_test: _install
rm -rf _runtest
mkdir _runtest
ln -s ../_install _runtest/_install
$(cpl) -a $(ocamldir)/testsuite _runtest/testsuite
# replace backend-specific testsuite/tools with their new versions
rm _runtest/testsuite/tools/*
cp -a testsuite/tools/* _runtest/testsuite/tools/
# replace backend-specific testsuite/tests/asmcomp with their new versions
rm _runtest/testsuite/tests/asmcomp/*
cp -a testsuite/tests/asmcomp/* _runtest/testsuite/tests/asmcomp/
# replace backend-specific testsuite/tests/asmgen with their new versions
rm _runtest/testsuite/tests/asmgen/*
cp -a testsuite/tests/asmgen/* _runtest/testsuite/tests/asmgen/
Expand Down Expand Up @@ -247,6 +250,7 @@ runtest-upstream: _install
# ocamltest itself
mkdir _runtest/ocamltest
cp $(main_build)/$(ocamldir)/ocamltest/ocamltest.byte _runtest/ocamltest/ocamltest
test: install_for_test
if [ "$(middle_end)" = "flambda2" ]; then \
for dir in `cd ocaml/testsuite; ls -1 -d tests/*`; do \
if ! grep -q "^ $$dir " testsuite/flambda2-test-list; then \
Expand Down Expand Up @@ -277,6 +281,16 @@ runtest-upstream: _install
fi \
fi)

runtest-upstream: test

test-one: install_for_test
(export OCAMLSRCDIR=$$(pwd)/_runtest; \
export CAML_LD_LIBRARY_PATH=$$(pwd)/_runtest/lib/ocaml/stublibs; \
if $$(which gfortran > /dev/null 2>&1); then \
export LIBRARY_PATH=$$(dirname $$(gfortran -print-file-name=libgfortran.a)); \
fi; \
cd _runtest/testsuite && make one $(if $(TEST),TEST="tests/$(TEST)") $(if $(DIR),DIR="tests/$(DIR)"))

# This target is like a polling version of upstream "make ocamlopt"
.PHONY: hacking
hacking: _build/_bootinstall
Expand Down
1 change: 1 addition & 0 deletions Makefile.config.in
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ STDLIB_MANPAGES=@stdlib_manpages@
NAKED_POINTERS=@naked_pointers@
INTEL_JCC_BUG_CFLAGS=@intel_jcc_bug_cflags@
STACK_ALLOCATION=@stack_allocation@
POLL_INSERTION=@poll_insertion@
DUNE=@dune@

### Native command to build ocamlrun.exe
Expand Down
5 changes: 3 additions & 2 deletions asmcomp/asmgen.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ let linear_unit_info =
let reset () =
start_from_emit := false;
if should_save_before_emit () then begin
linear_unit_info.unit <- Compilation_unit.get_current_exn ();
linear_unit_info.unit <- Compilation_unit.get_current_or_dummy ();
linear_unit_info.items <- [];
end

Expand Down Expand Up @@ -272,7 +272,8 @@ let compile_implementation ?toplevel ~backend ~prefixname ~middle_end
~asm_filename:(asm_filename prefixname) ~keep_asm:!keep_asm_file
~obj_filename:(prefixname ^ ext_obj)
(fun () ->
Ident.Set.iter Compilenv.require_global program.required_globals;
Compilation_unit.Set.iter Compilenv.require_global
program.required_globals;
let clambda_with_constants =
middle_end ~backend ~prefixname ~ppf_dump program
in
Expand Down
Loading

0 comments on commit f97a773

Please sign in to comment.