Commit Graph

698 Commits (master)

Author SHA1 Message Date
KC Sivaramakrishnan a84b20e601 Remove unnecessary prerequite from make rule for domainstate.mli 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan 8ab825d7e9 Fix makefile, gitignore and a stray extern declaration 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan f7920a127f Domain state works on Power64 2019-08-23 09:50:05 +05:30
KC Sivaramakrishnan b212aed0cb Make depend and fix typos 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
Greta Yorsh 351edb49bb Add compile-time option -function-sections 2019-07-15 10:25:26 +01:00
David Allsopp 668055de77 Missing beforedepend dependencies for Menhir
Ensures that Menhir's sources are in place for a "from scratch"
`make alldepend`
2019-06-24 07:55:15 +01:00
Gabriel Scherer 8ba174facf Makefile: ocamllex does not depend on ocamlc, it uses BOOT_OCAMLC
It seems that the dependency was introduced in 1998
  87b17301f4
and it was already unnecessary at the time.
2019-06-24 08:17:58 +02:00
David Allsopp 93ee6b43b0
Move AST testing rules to Makefile.dev (#8743)
Makefile.dev is only included if a Git clone is detected.

make evaluates macros in target specifications when the Makefile is
read, which meant that the build-all-asts target caused `git ls-files`
to be called on every invocation of make. This tweaks it to be a
recursive call to make which puts the $(AST_FILES) macro in the recipe
where it is only evaluated when the target is requested.
2019-06-18 14:35:06 +01:00
David Allsopp 1fd3ddf8a0 Drop dependency utils/config.ml <-- Makefile
The recipe is trivial, so the dependency promotes unnecessary rebuilding.
2019-06-16 16:29:17 +02:00
David Allsopp 5231ae1283 Always build flexdll/flexlink.exe with camlheader 2019-06-10 11:17:54 +01:00
David Allsopp 627608a00a Missing -nostdlib options in flexdll bootstrap
If OCaml was already installed, camlheader would be used from the
installation when building the bytecode flexdll/flexlink.exe
2019-06-10 11:17:54 +01:00
Mark Shinwell 6cbdfad125 Move some code from Asmgen to the middle end directory etc. (#2288)
Followup to (#2281)
2019-05-10 15:11:22 +02:00
Sébastien Hinderer a201ade7f3 Build system: make ocamllex silent by default (#8664)
This commit makes e.g. make -s world.opt completely
silent when everything works, in order to increase the visibility of
any unexpected message occurring during the build.
This will be useful for instance during CI, in particular it should
make it easier to catch undefined build variables.

The implementation is straightforward. The OCAMLLEX_FLAGS variable is
defined in Makefile.common.in and then used consistently by all
lexing recipes.

In addition, in tools/Makefile, the two rules producing the lexers
from cvt_emit.mll and make_opcodes.mll have been replaced by a
pattern-rule and the useless .SUFFIXES target has been removed.
2019-05-07 11:32:05 +02:00
Xavier Leroy 01f2ac8d70 Check that native-code is supported in world.opt
Previously, if the native-code compiler is not supported
(e.g. because configure doesn't recognize the target architecture,
or is run with --disable-native-compiler), "make world.opt"
fails late and with a mysterious error message
(a warning about undeclared C functions in runtime/roots_nat.c
or runtime/backtrace_nat.c, typically).

This commit ensures that "make world.opt", "make opt" and "make opt.opt"
fail immediately with a meaningful error message if the native-code
compiler is not supported.

Note: in "world.opt", make sure that "checknative" is run, and only
then "coldstart"; don't run them in parallel.
2019-05-02 19:43:17 +02:00
Thomas Refis 8ee36fe2db turn off warning 40 2019-04-16 10:41:35 +01:00
Nicolás Ojeda Bär 8897fe60cc make clean: do not remove emacs backups 2019-04-10 14:18:04 +02:00
Mark Shinwell 72ea849d2a
Move some middle-end files around (#2281)
* Various file moves in the middle end: this is the first stage of improving separation between the middle end and backend.
* Creation of file_formats/ directory (with associated file moves) to hold the definitions of compilation artifact formats.
* Creation of lambda/ directory (with associated file moves) to hold Lambda language definition files, transformation passes and construction passes from Typedtree.
* Disable (hopefully temporarily) dynlink, debugger and ocamldoc for the dune build.
2019-04-01 17:18:47 +01:00
Isaac Avram 87f999734b Merge remote-tracking branch 'origin/trunk' into tast_iterator2 2019-03-25 13:49:04 -07:00
Isaac Avram 8468464354 Updated Makefile 2019-03-23 19:12:43 -07:00
Stephen Dolan f495bfb7cb
Merge pull request #8514 from stedolan/boot-ocamlc-opt
Use boot/ocamlc.opt for building, if available.
2019-03-22 12:22:14 +00:00
Stephen Dolan 46c427f519 Use boot/ocamlc.opt for building, if available. 2019-03-20 10:31:46 +00:00
Mark Shinwell dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Jérémie Dimino c413136fa3 Delete otherlib/{graph,win32graph} (#2318)
The Graphics library is now distributed as a separate package.
The sources are at https://github.com/ocaml/graphics .

Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-03-18 15:05:57 +01:00
Mark Shinwell e3a62eef91
Add Compute_ranges pass (#2291) 2019-03-18 08:52:34 +00:00
Mark Shinwell 36c163248d Remove support for compiler plugins (#2276)
After consultation on the core developers' list I am proposing this patch to remove support for compiler plugins.

The main motivations for removing compiler plugins are:
- They are a potential security risk.
 - They increase the complexity of the build system and make maintenance of the Dynlink libraries more difficult (although actually, this complexity could probably be reduced after #2268 is merged).
 - Many applications of plugins should be able to be expressed by building custom compiler drivers that link against compilerlibs.

* Remove compiler plugins and hooks
* Add new function Dynlink.unsafe_get_global_symbol but keep it outside the documented API.
* Remove otherlibs/dynlink/nodynlink.ml
* Update Changes
2019-03-13 11:46:37 +01:00
Nicolás Ojeda Bär 612dbf1b74 Makefile: adapt to removal from vmthreads 2019-03-11 20:52:17 +01:00
Mark Shinwell 7cb0da58f1
Don't generate Clambda constants during Cmmgen, etc. (#2280) 2019-03-05 17:09:40 +00:00
David Allsopp 8831395f32 Move FLEXDLL_DIR definition to utils/Makefile (#2259)
Missed in d68e0e207. Fixes second part of MPR#7923.
2019-02-28 11:21:52 +01:00
Mark Shinwell 3133699187
Add bytecomp/opcodes.mli (#2265) 2019-02-26 16:17:38 +00:00
Gabriel Scherer 93f0ce31bb env refactoring: separate the cmi/crc handling into a persistent_env module
Persistent_env is a new module that handles the relation between the
type-checking state and the "persistent" typing information laying in
.cmi files on the filesystem. In particular, it handles the collection
and production of CRC information for the .cmi files being read and
written to the filesystem; the using modules (in our case, only Env)
are in charge of turning the cmi files into higher-level information
(components and signatures).

Persistent_env exposes a type `'a t` of a persistent environment,
which acts as a mutable store of `'a` values. There is no global state
in the module itself: while Env (and thus the OCaml type-checker) uses
a single global persistent environment, it should be possible to
create several independent environments to represent, for example,
several independent type-checking sessions.
2019-02-18 17:02:47 +01:00
Pierre Chambart 45b28a90b2 Move Semantics_of_primitives into asmcomp 2019-02-11 17:16:44 +01:00
Pierre Chambart 6dfd40f72f Push clambda_primitives to flambda 2019-02-11 17:16:44 +01:00
Pierre Chambart db80c8e15f Define and use Clambda_primitives
The primites for Clambda are now different from lambda ones. This will
now allow to clean those that don't make any sense in the backend.
2019-02-11 17:16:43 +01:00
Vlad Frolov 925c7dcf20
[Makefile] Fixed a bug in partialclean target 2019-02-04 00:06:42 +02:00
Jeremie Dimino 7e0862a212 Refactor load path management and initial environment
- Add a Load_path module which caches files lookup

- Instead of falling back to the external environment, allow to
  declare in the environment that a module comes from the external
  world. This allows persistent structures to shadows non-persistent
  ones
2019-01-30 16:36:38 +00:00
Nicolás Ojeda Bär 9eda39597a Remove explicit dependencies 2019-01-12 20:50:36 +01:00
Nicolás Ojeda Bär 0998b3ac4e Remove unnecessary compilation rules 2019-01-12 08:59:34 +01:00
Nicolás Ojeda Bär fe617f638f Remove unnecessary ocamldep call 2019-01-12 08:57:12 +01:00
Nicolás Ojeda Bär 8cc9013688 Do not call ocamldep on non-existing files 2019-01-12 08:57:12 +01:00
Gabriel Scherer 46ef054330 Makefiles: restructure CAMLDEP usage to easily add flags
This change should be a refactoring no-op.

Before, a DEPFLAGS variable existed in some makefiles to contain
include directories to be passed to ocamldep invocations, but no
support for easily adding command-line flags to ocamldep was available
(invocations would systematically use -slash, which was duplicated
across callsites).

With this PR, a new DEPINCLUDES variable contains the include
directories, and DEPFLAGS is repurposed to contain other command-line
flags for the tool -- currently "slash".
2018-12-12 09:30:55 +01:00
David Allsopp a875e64571 Missing clean items from GPR#1063 2018-12-06 18:14:38 +00:00
Thomas Refis af328e176b
remove typedtreeMap (#2173) 2018-11-29 15:51:45 +01:00
Rodolphe Lepigre ca227428f4 Typedecl: split immediacy to a separate unit Typedecl_variance
get_unboxed_type_representation is used in several other modules, and
split into its own Typedecl_unboxed unit.

(pair-programming with Gabriel Scherer)
2018-11-23 12:05:33 +01:00
Gabriel Scherer 24ea989c02 Typedecl: split variance to a separate unit Typedecl_variance
(pair-programming with Rodolphe Lepigre)
2018-11-23 12:05:33 +01:00
Gabriel Scherer 0e0b10fd75 Typedecl: split abstract properties to a separate unit Typedecl_properties
(pair-programming with Rodolphe Lepigre)
2018-11-23 12:03:11 +01:00
Gabriel Scherer f6837be875
Merge pull request #2151 from fpottier/improvements
Parser improvements, with a possible bug fix along the way.
2018-11-22 08:23:58 +01:00
Thomas Refis 5daea80728 fix partialclean for compdynlink_common (review and approved by mshinwell) 2018-11-20 15:46:48 +00:00
Thomas Refis aa77d3b93d
fix dune build following natdynlink modifications (#2154)
- silence some principality warning in otherlibs/dynlink
- shared some script between the makefile and the dune files
2018-11-20 15:06:47 +01:00
François Pottier de8df5dbb0 Exclude `boot/menhir/parser.{ml,mli}` from the list of source files
used by `make build-all-asts` and related commands.

Indeed, the idea is to check that the ASTs do not change when the parser is
modified -- the parser's source itself, if included, would always produce a
false positive.
2018-11-20 11:52:47 +01:00
Mark Shinwell 690116890e Various Makefile / dependency fixes 2018-11-15 10:42:49 +00:00
Mark Shinwell 960cef2e7d Fix makefile problems 2018-11-14 16:20:06 +00:00
Mark Shinwell a4c88eab27 Fixing dynlink makefiles 2018-11-14 13:10:08 +00:00
Mark Shinwell 6526a0c3d9 Make (nat)dynlink sound 2018-11-12 17:44:26 +00:00
Gabriel Scherer d4959ae5ff Makefile: reuse new rules of otherlibs/Makefile 2018-11-12 16:28:01 +01:00
Gabriel Scherer cbefaee438 minor typo fix 2018-11-09 20:37:03 +01:00
Alain Frisch 7baf33d6ad
Fix PR6638: add dedicated wrning for "unused open!" (#1110) 2018-11-09 13:41:34 +01:00
alainfrisch 0d968e357b Move variable printer to Pprintast
- The code responsible for printing Syntaxerr errors is moved to the
  Parse module (so that it can depend on the variable printer in
  Pprintast).

- Pprintast becomes a dependency for a few tools that link some
  compiler modules in an ad hoc way (they would better be implemented
  in terms of compiler-libs).
2018-11-06 13:12:54 +01:00
Thomas Refis e292cb97c5 correctly register dependencies 2018-10-11 17:13:22 +01:00
Thomas Refis d68e0e2077
Provide a way to build the bytecode compiler using Dune (#2093) 2018-10-10 16:16:00 +01:00
Mark Shinwell 2b5f13c913 GPR#2056 (Backend_var) 2018-09-28 17:59:01 +02:00
Sébastien Hinderer 132b3a151d
Get rid of the standard_runtime configuration variable (#2066)
This configuration variable was formerly used by the -make_runtime and
-use_runtime option but this is no longer the case.
2018-09-25 15:29:18 +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
David Allsopp 6fab940f38 Export SUPPORTS_SHARED_LIBRARIES in ocamlc -config 2018-09-13 13:40:17 +01:00
Gabriel Scherer ef00dc7317 remove experimental/
This subdirectory was used to store experimental patches on some older
version-control system where branching (or discussing branches?) was
inconvenient. It doesn't make much sense anymore now, and getting rid
of it simplifies a couple places that had to grow around it.

Suggested-by: Nicolás Ojeda Bär

(no change entry needed)
2018-09-08 16:53:08 +02:00
Gabriel Scherer e024eeecd8 Makefile rules to test parser changes by comparing -dparsetree output 2018-09-08 12:24:29 +02:00
David Allsopp b069f692b4 Remove space from end of FLEXLINK_ENV 2018-09-07 08:34:53 +02:00
David Allsopp ad07b6d9b5 Use $(addprefix ...) and spacing adjustments 2018-09-07 08:34:53 +02:00
David Allsopp 4756a576f0 Move FLEXLINK_ENV definition to Makefile.common 2018-09-07 08:34:53 +02:00
David Allsopp 171a97407d Harden flexlink.opt target
If an error occurs while making flexlink.opt, the bytecode image was not
restored. It's now restored even if an error occurs while building the
native code image.
2018-09-07 08:34:53 +02:00
David Allsopp c13c200f87 Standardise setting and use of OCAML_FLEXLINK
Some Makefiles were using export to set OCAML_FLEXLINK "globally" while
others set a variable FLEXLINK_ENV and set the environment explicitly.

All Makefiles now use FLEXLINK_ENV and also only invoke it on linking
commands (rather than, for example, all invocations of ocamlopt).
2018-09-07 08:34:53 +02:00
Gabriel Scherer 9e84a038cb Makefile: make the parser.mly timestamp heuristic more robust
Reviewed by Sébastien Hinderer.

(no change entry needed)
2018-09-06 12:17:17 +02:00
Gabriel Scherer 51912516fa [minor] documentation improvements for Makefile.menhir 2018-09-06 11:10:48 +02:00
octachron 075bf9bed6 doc: remove unprefix trick 2018-09-03 13:59:32 +01:00
Gabriel Scherer a0d2aeb7e1 Menhir update test: use POSIX (find .. -prune -newer) instead of bash's -nt 2018-09-02 12:04:05 +02:00
Gabriel Scherer cbb92d2817 remove unused ocamlyacc dependencies, never put it in boot/ 2018-09-01 23:17:06 +02:00
Gabriel Scherer ac265e9ea3 (minor) remove unused CAMLYACC variables 2018-09-01 23:17:06 +02:00
Gabriel Scherer d09349f631 rename parsing/parser_menhir into parsing/parser 2018-09-01 23:17:06 +02:00
Gabriel Scherer e6ecea4008 remove the yacc parser
The large diff in boot/menhir/parser_menhir.ml comes from the fact
that the token list is now included in it, instead of being merely
a reference to the yacc parsers' Parser.token type.
2018-09-01 23:17:06 +02:00
Gabriel Scherer f571282d7d menhir parser: rename MenhirLib into CamlinternalMenhirLib
The goal of this change is to avoid conflicts encountered by
compiler-libs users that would also use their own MenhirLib runtime
for their own parsers.

I first tried to implement a solution to this module-name-conflict
issue using module aliases and -open, but this proven too fragile and
too difficult to get right.
2018-09-01 23:17:04 +02:00
Gabriel Scherer cbea1b6b69 menhir parser: move .mlyp to .mly, no cpp step anymore 2018-09-01 23:17:04 +02:00
Gabriel Scherer fc89685a17 Makefile: emit a warning if parser_menhir.mlyp is more recent 2018-09-01 23:17:03 +02:00
Gabriel Scherer 9a38c848fc Setup and use a Menhir parser for the OCaml grammar (REBASE POINT)
Uses the new $symbolstartpos feature of Menhir
to get locations identical to the OCamlYacc ones.

REBASE POINT: at the point of this commit, using a diff program
on parser.mly and parser_menhir.mlyp should give identical results
after the header code. If you rebase the Menhir-parser patchset
against a newer ocamlyacc parser (parser.mly), those two files
will have diverged, and you need to merge the parser.mly change
back into parser_menhir.mlyp -- and then deal with them in the
rest of the patch series.
2018-09-01 23:17:03 +02:00
Drup abc0b7e3ed Add compile_common.ml which contains the basic compilation pipeline.
Factorize the part from compile.ml and optcompile.ml.
2018-07-27 15:07:43 +02:00
Xavier Clerc 7e29162582 Pass the elements from `BUILD_PATH_PREFIX_MAP` to the assembler (#1930) 2018-07-27 12:25:23 +02:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
Xavier Clerc cd06e22582 Shadow the polymorphic comparison in the middle-end (#1811) 2018-07-11 13:50:02 +02:00
Valentin Gatien-Baron 7a6758b03b makefile: install .cmx from middle end directory 2018-07-01 18:49:30 -04:00
Valentin Gatien-Baron 7973231f60 makefile: define OPTCOMP, the native equivalent of BYTECOMP 2018-07-01 18:49:30 -04:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Xavier Clerc 9c182f7e24 Add -dcamlprimc + pass -fdebug-prefix-map when available (#1845)
- Introduce `-dcamlprimc`, to keep the generated C file containing the primitive list
- Use `-fdebug-prefix-map` for compiling temporary C files when this option is supported
2018-06-27 14:56:29 +01:00
Sébastien Hinderer 507f27ccb0 Makefile, .gitignore: remove `make backup` leftovers 2018-06-20 17:16:35 +02:00
Sébastien Hinderer 85fa27f7e9 Rename C compiler related build variables
This commit renames a few C compiler related build variables so that
they are reserved for the build system. They will then be re-introduced,
but this time as user varialbes whose value can be freely customized
when compiling the package, without risking to conflict with those
command-line flags that are required by the build system itself.

Here are the variables this commit renames:

- CFLAGS -> OC_CFLAGS
- CPPFLAGS -> OC_CPPFLAGS
- LDFLAGS -> OC_LDFLAGS

Note: before this commit the compilation of scheduler.c in
otherlibs/threads was relying on make's implicit rule to compile C files.

Since this commit stops using the standard variables for flags,
it is necessary to introduce an explicit rule to compile C files
and that makes use of the newly introduced variables.
2018-06-20 14:01:42 +02:00
David Allsopp 02a3091a7d Export ARCH64 to config/Makefile as well as m.h
Allows it to be used more easily in the build system.
2018-06-11 22:52:00 +01:00
Sébastien Hinderer 96545e8cd0 Document the bootstrap procedure
* Remove the now obsolete comments at the beginning of the main Makefile
 * Move and fix documentation of the bootstrap from INSTALL to
   HACKING-bootstrap.adoc
 * Update install instructions
2018-05-31 15:45:25 +02:00
Sébastien Hinderer 4a2fa2978f Root Makefile enhancements
This commit contains the following fixes and enhancements to the
root Makefile:

 * coreall: add dependency on runtime
 * all: before this commit, this target was depending on runtime and started
   by making coreall. This commit simplifies this and just makes this target
   depend on coreall, which is both simpler and semantically more accurate.
 * compare: let this target exit if the comparison fails
 * bootstrap: this commit removes the final invocation to make compare.
   The comparison was actually done twice, (1) as the final step of coreboot
   and (2) as the final step of bootstrap. The motivation for that was to
   ensure that the comparison messages were not lost and did appear last.
   Actually, it turns out that if the comparison fails, it makes no
   sense to continue the bootstrap process. That's why compare now exits
   immediately when it fails and there is thus no need to perform it twice.
 * Get rid of backup and restore targets which have become obsolete
   with the use of a revision control system
2018-05-31 14:35:57 +02:00
Sébastien Hinderer b2240b9878 Make sure the make_opcode tool is run using byterun/ocamlrun
This tool is used to compile ocamlc. Given that make_opcodes is itself
recompiled as part of the bootstrap process, it needs to be run on the new
(rather than old) runtime. In other words, make_opcodes needs to be run
using byterun/ocamlrun rather than boot/ocamlrun.

This commit fixes this.
2018-05-31 14:35:57 +02:00
Sébastien Hinderer ecb42aa78f Makefile: the promote-cross target should use cp rather than stripdebug
The compiler's bootstrap procedure involves calling the promote-cross
target of the root Makefile.

When this target is invoked e.g. in the context of an executable
magic number update, it is actually not possible to use the stripdebug
tool.

Thus, this commit makes sure the promote-cross target uses cp
to promote the bytecode tools, rather than stripdebug.

This is not an issue because in the promote rule used later
during the bootstrap the stripdebug tool can be used, so that the
bytecode executables one gets after a complete bootstrap will remain
small and won't contain any debugging symbol.
2018-05-31 14:35:57 +02:00
Sébastien Hinderer 712f08872a Root Makefile: clean testsuite only once
There were two recipes to run make clean in the testsuite directory.
This commit gets rid of one of them.
2018-05-29 16:46:06 +02:00
Sébastien Hinderer 0704a4b78a Root Makefile: simplify tests target
* Remove dependencies

 * Simplify recipe
2018-05-29 16:45:58 +02:00