Commit Graph

44 Commits (master)

Author SHA1 Message Date
Nicolás Ojeda Bär 540996d21e Remove Spacetime 2020-10-08 20:28:12 +02:00
David Allsopp 001c2d1283 Restore Cygwin64 support 2020-09-21 13:36:03 +01:00
Sébastien Hinderer f3ff1337a1 Build system: honour the CFLAGS and CPPFLAGS build variables
With this commit, it becomes possible to provide C compiler and preprocessor
flags to use in addition to those defined by the build system.

As required by the GNU coding standards, the flags can be provided
either at configure or at make invocation.

The provided CFLAGS and CPPFLAGS will also be taken into account
when C code is compiled by ocamlc/ocamlopt.

This commit removes the explicit reference to CFLAGS in the
configuration for the xlc compiler, since it is not necessary any longer.
2020-08-06 14:30:50 +02:00
Xavier Leroy 08e58c836e
More efficient management of code fragments (#9654)
* Introducing codefrag: a new runtime module to work with code fragments

This module collects all the operations on code fragments performed in
various places of the runtime systems.  Applies both to bytecode and
to native code.

The implementation is based on skiplists, so that "lookup fragment by
PC" and "lookup fragment by number" are efficient (logarithmic in the
number of code fragments).  "Lookup fragment by digest" remains
linear-time.

The new module also improves the handling of digests: now it is
possible to mark a code fragment as "no digest" i.e. not marshal-able.

* Use the new "codefrag" runtime module for marshaling and for the
  debugger interface

Replace the previous handling of code fragments with calls to the
functions provided by the "codefrag" runtime module.
2020-06-11 10:39:19 +02:00
Xavier Leroy 9a5f3b1967 Add skip lists as a reusable data structure
The implementation is taken from globroots.c, but made reusable elsewhere.
2020-06-08 14:12:53 +02:00
Gabriel Scherer 5b2c687ddc typo fix 2020-05-18 15:29:16 +02:00
Gabriel Scherer 17dcf49610 please check-typo despite all the sand 2020-05-18 15:15:04 +02:00
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02:00
David Allsopp 942105f49e Remove unneeded $(otherfiles) in runtime/Makefile
No longer required, and in fact causing breakages now that -MG isn't used.
2020-05-03 16:07:07 +01:00
David Allsopp c948b8d051 Don't use -MG
It's a subtly broken thing to do, as discovered on the ARM workers on
Inria's CI.
2020-05-03 16:03:46 +01:00
David Allsopp 617522ec95 Restore compatibility with GNU make 3.81
It's the macOS default installed version still. The dependency generation
inadvertently relies on behaviour introduced in GNU make 3.82 a decade ago.

The fix in otherlibs/systhreads/Makefile also corrects missing
NATIVE_CPPFLAGS when generating st_stubs.n.d, so st_stubs.n.o now
correctly depends on caml/stacks.h instead of caml/stack.h
2020-05-03 16:00:28 +01:00
David Allsopp 7cfd81073e Remove unnecessary -MG from systhreads
It's use in runtime/Makefile is also clarified.
2020-05-01 10:33:48 +01:00
David Allsopp ac2a9dd188 Cease committing C dependendency information
When building for the first time, the only requirement is that generated
header files have been built (jumptbl.h, version.h and opnames.h).
Detailed dependency information is only required when headers have been
edited.

COMPUTE_DEPS in Makefile.config controls whether C dependency
information should be generated on a per-file basis. This variable is
controlled by a new --disable-dependency-generation in configure which
is enabled for Git checkouts and disabled for tarballs (i.e. releases).

The Microsoft C compiler (cl) cannot generate dependencies in a
consistent way which we can consume, so for a Git checkout configure
searches for an additional C compiler in order to compute dependencies.
This is obviously not required for a user-build.

As a result, the MSVC port can now safely run make alldepend, since only
OCaml dependency information is committed to the repo after this change.

CI does not need to waste time testing the dependency information,
because it only tests a single build. A single Travis job has been added
which tests the build system code to generate the dependency information
(and provides a single `make -j` run in CI, although Inria's CI also
tests parallel building continuously).
2020-04-17 14:11:22 +01:00
David Allsopp 3a40b2fd94 Introduce Makefile.build_config.in
This moves the configure-generated parts of Makefile.common to a
separate (generated) Makefile, allowing Makefile.common to be a normal
Makefile.

OCaml's build system Makefile's now include Makefile.build_config (which
itself includes Makefile.config) but Makefile.config is still installed
as before. This allows configure to generate variables which are
specific to the build process and are not intended to be exported to the
installation.
2020-04-17 13:53:49 +01:00
Enguerrand Decorne b7f0494df5 Rewrite the instrumented runtime to store traces in the CTF format.
The instrumentation code in the instrumented runtime was replaced
with new APIs to gather runtime statistics and output them in a new format
(Common Trace Format).
This commit also exposes new functions in the Gc module to pause or resume
instrumentation during a program execution (Gc.eventlog_pause and
Gc.eventlog_resume).
2020-04-30 10:32:01 +02:00
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +01:00
David Allsopp cc6c09edbe Clean runtime/primitives.new 2019-10-15 10:37:12 +01:00
David Allsopp d4a566573f Allow make to be invoked before configure
This should be improved to give better warnings for when Makefile.config
and Makefile.common are required.
2018-12-04 10:28:36 +00:00
David Allsopp e4f3aa8c81 Don't assume . in AWKPATH
Ensure all script invocations explicitly refer to a directory.
2020-03-20 09:38:33 +00:00
David Allsopp bc867cebf8 Use $AWK not awk
Ensures gawk is used if available.
2020-03-20 09:36:07 +00:00
Sébastien Hinderer 407ab46f21 runtime/Makefile: Get rid of two useless calls to cat
Their output was piped to the tr command, so it's better to redirect
tr's standard input directly. This commit also replaces $^ by $< which
seems more accurate here.
2020-02-19 11:37:14 +01:00
Xavier Leroy 2c4e6e8144 Fix preprocessor error during make depend
Currently, "make depend" computes dependencies in bytecode mode and in native-code mode for all .c files.  For signals_nat.c, this causes an error in bytecode mode, because HAS_STACK_OVERFLOW_DETECTION is defined but CONTEXT_SP is not defined, as no -DTARGET_$(ARCH) option is given on the command line.

This commit separates bytecode-relevant source files and native-code-relevant source files when computing dependencies.
2019-10-21 15:44:21 +02:00
KC Sivaramakrishnan d227d36304 Domain state support for msvc32 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan c674a9a443 Domain state support for msvc64 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan d6c350a1c9 Add domain_state.tbl to install targets 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan fc6f028492 Introduce domain state and steal exception pointer 2019-08-23 09:50:05 +05:30
David Allsopp b6869ee66c Only define -DOCAML_STDLIB_DIR when needed 2019-07-19 16:45:50 +01:00
David Allsopp 777cfef8ca Make dynlink_*.o depend on Makefile.config
dynlink.c uses OCAML_STDLIB_DIR, which is derived from Makefile.config.
This makes that dependency explicit, so re-configuring will trigger a
rebuild of dynlink_*.o
2019-07-19 16:44:59 +01:00
Stephen Dolan 35ea7eb9a4 Avoid rebuilding the world when files containing primitives change. 2019-05-27 13:24:41 +01:00
Gabriel Scherer 01b93c8596 Revert "Merge pull request #8690 from stedolan/primitives-rebuilding"
This reverts commit 74cf20429d, reversing
changes made to 295ee133dd.
2019-05-23 10:54:00 +02:00
Stephen Dolan e3d2c28ad9 Avoid rebuilding the world when files containing primitives change. 2019-05-22 16:05:48 +01:00
Jacques-Henri Jourdan 052a950dea Statistical memory profiling of blocks allocated in the major heap. 2019-05-09 16:40:45 +02:00
Nicolás Ojeda Bär 8897fe60cc make clean: do not remove emacs backups 2019-04-10 14:18:04 +02:00
Sébastien Hinderer 2314abc2ae
runtime: re-enable build/install of PIC libraries (#8573) 2019-04-02 17:38:47 +02:00
Mark Shinwell 2cc1ea26b9 Remove gprof support (#2314)
This commit removes support for gprof-based profiling (the -p option to ocamlopt).  It follows a discussion on the core developers' list, which indicated that removing gprof support was a reasonable thing to do. The rationale is that there are better easy-to-use profilers out there now, such as perf for Linux and Instruments on macOS; and the gprof support has always been patchy across targets. We save a whole build of the runtime and simplify some other parts of the codebase by removing it.
2019-03-16 19:56:53 +01:00
David Allsopp d96f1b31dd Clean-up runtime/ld.conf
Missed in GPR#1852
2018-12-06 18:14:10 +00:00
Damien Doligez 6fa3d820df
fix PR#2146 (#2149) 2018-11-16 11:31:26 +01:00
Jérémie Dimino 4fadd45f2b
Make a few int64 primitives use [@@unboxed] stubs on 32bits (#2146) 2018-11-13 16:40:37 +00:00
Sébastien Hinderer b42f4e3aaf Build system: cosmetic fix
Under Unix, the LDFLAGS were passed twice when building the
programs in the runtime directory. This commit fixes this.
2018-10-23 11:12:50 +02:00
Sébastien Hinderer ccae1e2876
Define OCAML_STDLIB_DIR in runtime/Makefile rather than in s.h (#2059) 2018-09-25 16:04:11 +02:00
Sébastien Hinderer 01b65ac0af Introduce and use ROOTDIR in more makefiles 2018-09-17 14:51:01 +02:00
Sébastien Hinderer ba6362a07d Move config/Makefile to Makefile.config
In order to prepare the transition to autoconf, this commit moves the
configuration Makefile out of the config directory which will disappear
and gives it the name it will have once intstalled, namely Makefile.config.
2018-09-17 14:23:35 +02:00
Damien Doligez b6cf38d9d6
MPR#7814: fix non-prefixed symbol names in debug and instrumented runtimes (#1900)
* make `names_of_instructions` a static variable
* use lowercase names for CAML_INSTR functions, variables, and structs
* add changelog entry
2018-07-13 16:06:36 +02:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00