Commit Graph

67 Commits (fab58a938a61c62bb66ed70ce2563e1657d9f53b)

Author SHA1 Message Date
Gabriel Scherer fab58a938a makefiles: move the inclusion of Makefile.build_config in Makefile.common 2020-05-06 12:10:02 +02: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
David Allsopp 13786d7d12 Ensure make distclean works on an unconfigured tree 2019-10-15 11:46:36 +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
Florian Angeletti 95a5399b28
ocamldebug: initialize all functions in Env (#9356)
Switch ocamldebug to compiler-libs in order to avoid hidden dependencies issue. 

In particular, the Env module is only fully initialized after the Typemod and Includemod modules have been linked. Calling `Env.find_type` before that initialization may result in an assert false when functor-derived types are involved.
2020-03-11 09:44:00 +01:00
Florian Angeletti 40e40a9c20 compilerlibs: expose parsers for 'Longident.t's 2020-01-09 16:45:39 +01:00
Florian Angeletti e667d9fb8d debugger: rename parser and lexer modules 2020-01-06 14:14:55 +01:00
Gabriel Scherer 986745cbbc debugger Makefile: use ocamlc.opt when available
On my machine the sequential build time goes from 3.7s to 1.3s
2019-10-12 10:23:29 +02:00
Jeremie Dimino 2d31ebfc8b Add support for [@@immediate64]
Signed-off-by: Jeremie Dimino <jeremie@dimino.org>
2019-09-24 07:56:15 +01: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
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
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
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
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
Sébastien Hinderer d258bb78ac Build system: use ocamlc -depend rather than ocamldep 2019-01-03 16:43:23 +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
Mark Shinwell 6526a0c3d9 Make (nat)dynlink sound 2018-11-12 17:44:26 +00: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
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
Gabriel Scherer cbb92d2817 remove unused ocamlyacc dependencies, never put it in boot/ 2018-09-01 23:17:06 +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
Nicolás Ojeda Bär a2db438da8
Build ocamldebug with debugging information (-g) 2018-07-24 12:54:43 +02:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
Gabriel Scherer 3702f53692 factorize common makefile definitions in Makefile.common 2018-03-29 17:04:05 +02:00
Gabriel Scherer afcd29eb0c makefiles: turn the 'install' command into a variable
(Suggestion made by Sébastien Hinderer during review.)
2018-03-29 14:40:23 +02:00
Gabriel Scherer ecfd39f127 makefiles: use 'install' instead of 'cp' in 'make install' targets
I can observe weird performance bottlenecks on my machine caused by
the use of 'cp' in the 'install' scripts of OCaml. When installing
into a directory that is already populated by an existing
installation, 'make install' can routinely take 10s on my machine¹. After this
change it reliably takes 1.5s, independently of whether the
destination is already populated or not.

¹: a brtfs filesystem on an old-ish SSD

Why I care
----------

An extra 10s delay due to 'make install' can be noticeable in tight
change-build-install-test feedback loops for a compiler change where
we change the compiler, have a fast 'make world.opt' due to
incremental builds, install the change and test it -- possibly after
installing a couple opam packages, which can be fairly quick.

Partial diagnosis
-----------------

The performance issue seems to be caused by the fact that 'cp' (at
least the GNU coreutils version), when the file already exists,
replaces it by opening it in writeonly+truncate mode and writing the
file content ('strace' shows that the delay is caused within an
'openat' call). In particular, using the --remove-destination option
(which changes 'cp' to just remove the destination file before
copying) removes the performance issue, but this option seems missing
from the BSD/OSX 'cp' so it could cause portability issue.

Change
------

The present commit rewrites the 'install' targets of all Makefiles to
use the 'install' command instead. 'install' by default gives
executable-like permission to the destination file, instead of reusing
the source file's permissions, so we specify manually the permission
modes, depending on whether the installed file is an executable (or
dynamically-linked library) or just data (including other compiled
object files).

Testing
-------

I checked manually that the permissions of the installed files are
identical to the ones of the current 'cp'-using targets, except for
some '.mli' file in middle_end which currently have +x bits enabled
for no good reason.

Remark: To test this, playing with the DESTDIR variable is very useful
(this lets you install to a new directory (or the same as before)
without having to re-run the configure script). I used the following,
fairly slow shell script to collect permissions:

    for f in $(find $DESTDIR); do \
      echo $(basename $f) $(ls -l $f | cut -d' ' -f1); \
    done | sort

Remark: it is important to run `sync` in-between 'make install' runs
to avoid timing effects due to filesystem or disk caching
strategies. I believe that this corresponds to the natural time delay
(and unrelated disk activity) that would occur in realistic
change-install-test feedback loops.
2018-03-29 14:40:22 +02:00
Gabriel Scherer 0489cfaf9e build_path_prefix_map: update .depend and Makefiles 2018-03-01 17:41:28 +01:00
Runhang Li 6f51424a9b
Fix corner case GADT exp bug. 2016-11-15 09:08:16 -08:00
Sébastien Hinderer 8ea571c5a5 Merge makefiles in the debugger directory. (#764) 2016-08-26 09:07:20 +02:00
Damien Doligez 5401ce8473 Update headers for the new license.
Remains to be done: remove all headers in testsuite/tests.
2016-02-18 16:59:16 +01:00
Wojciech Meyer e8acf5f821 build: allow $(UNIXDIR) to be "win32unix".
(Patch by Adrien Nader!)

Several commits ago, I made a change that replaced includes for
"otherlibs/unix" with "otherlibs/$(UNIXLIB)", making it possible to
include "win32unix".
Apparently I forgot to do it for debugger/Makefile or skipped it on
purpose since it only matters for cross-compilation and cross-compiling
the debugger is not supported (yet).
Change it now rather than forget it later.

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@14164 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2013-09-18 20:56:34 +00:00
Damien Doligez def31744f9 remove all $Id keywords
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13013 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2012-10-15 17:50:56 +00:00
Damien Doligez 3b507dd1aa renaming of Objective Caml to OCaml and cleanup of copyright headers
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@11156 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2011-07-27 14:17:02 +00:00
Xavier Leroy 776ae225a0 ocamldebug under Win32 (S. Le Gall, Lexifi)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@8955 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2008-07-29 08:31:41 +00:00
Nicolas Pouillard 87919802b8 Pass a Lexing.position value to make source_of_module, get_buffer and show
listing more accurate.
Also move the yes_or_no function to it's own module Question to avoid a
module dependency cycle, since Lexer use Parser types and Parser
implementation use Input_handling that defined yes_or_no that use Lexer.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-12-09 13:49:10 +00:00
Xavier Leroy 50b395daee Utiliser notre copie privee de dynlink (raison: le -pack dans ../otherlibs/dynlink)
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7423 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2006-05-11 15:51:31 +00:00
Damien Doligez 1ced22dda7 PR#3767 features 1 and 2: display full location of events instead of one position
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@7031 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2005-08-25 15:35:16 +00:00
Xavier Leroy e2b313a055 Rendre ocamlc -output-obj compatible avec Dynlink et le toplevel
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6130 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2004-02-22 15:07:51 +00:00
Damien Doligez b108b8a068 debut de reforme des locations
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5966 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2003-11-21 16:10:57 +00:00
Xavier Leroy 75dd00ea5f L'appel a expunge n'est pas vraiment necessaire
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5273 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-11-18 09:23:31 +00:00
Xavier Leroy 5e152f7945 - Revu en profondeur la verification des CRC d'interfaces.
Cela corrige le PR#1064.
- Les CRC des modules constituant un programme sont stockes dans
  l'executable bytecode, section CRCS.  Revu Dynlink pour utiliser ces
  CRC au lieu d'attendre de l'utilisateur qu'il les fournisse.
  MAJ du debugger en consequence.
- Introduction et utilisation du fichier stdlib/StdlibModules.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5272 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-11-17 16:42:12 +00:00
Damien Doligez e22208ccca fix PR#1202
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@5200 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-10-29 17:53:24 +00:00
Jacques Garrigue b148bb401e acceleration des Makefiles
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4758 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-04-27 14:45:33 +00:00
Daniel de Rauglaudre 50161b7513 Regroupement des impressions "outcometree" dans un seul module oprint.ml.
Ajout de hooks de print dans toploop.mli.


git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4396 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-02-13 11:09:19 +00:00
Damien Doligez 42f72c7694 ajout -warn-error
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@4282 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2002-01-20 15:12:32 +00:00
Xavier Leroy 7f60a0fa9e Suppression de Dllpath
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3952 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-10-30 10:02:42 +00:00
Pierre Weis 74472b9c2f Ajout de Dllpath
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3685 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-08-30 10:12:36 +00:00
Xavier Leroy ddd99c7e5d Chargement dynamique de primitives C
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3677 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2001-08-28 14:47:48 +00:00
Xavier Leroy 6e389e924c EXE manquants
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3306 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
2000-10-10 12:31:22 +00:00