Commit Graph

234 Commits (8721dc4e896d80cc389be30e3862c317b91975dc)

Author SHA1 Message Date
Greta Yorsh e08a9688fc Eliminate dead `ICatch` handlers (#2321) 2019-08-06 12:23:13 +01:00
Greta Yorsh 4bcb195565 Fix test for arm targets 2019-07-15 10:25:26 +01:00
Greta Yorsh 63f62123df Improve test for function sections 2019-07-15 10:25:26 +01:00
David Allsopp 31f828a5f7 Use boot ocamllex when building ocamltest 2019-06-24 07:56:05 +01:00
Sébastien Hinderer cc58f7a81a ocamltest: fix the ocamldebug test
When running ocamldebug, one needs to include the directory where the
standard library is built in the source tree.
2019-06-07 11:11:57 +02:00
Jacques-Henri Jourdan 052a950dea Statistical memory profiling of blocks allocated in the major heap. 2019-05-09 16:40:45 +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
Sébastien Hinderer fec02ff66d ocamltest: define and export the arch variable 2019-04-17 15:48:10 +02:00
Damien Doligez 123334881a Harden ocamltest against errors in scripts and hooks 2019-04-02 17:24:16 +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
Sébastien Hinderer b56c4ff3d0
Get rid of the direct call to the C preprocessor in the testsuite (#8528)
Call the C preprocessor through the C compiler rather than calling it
directly.

This required the definition of a new ocamltest variable,
ocaml_filetype_flag, which makes it possible to override the filetype
inferred by the compiler from the extnesion of the source file.
2019-03-21 18:12:43 +01:00
Mark Shinwell dbede46c2e
Improve the packing mechanism used to build Dynlink (#2268) 2019-03-19 10:26:35 +00:00
Mark Shinwell 0933593596 Fix ppc64 TOC load for exception handler addresses (#8506)
The address was loaded from the TOC into register r0.  This generated  bad code in the "big TOC" case, as r0 was used as index register.  The fix is to use another temporary register instead of r0.
Add "arch_power" builtin to ocamltest.
Add test case.
2019-03-18 13:31:57 +01:00
Sébastien Hinderer f48b107bc7 Clarify the invocation of the C preprocessor
Most of the time, the C preprocessor needs to be invoked through the C
compiler, e.g. so that the paths to the header files are resolved properly.
In some cases, though, we really need to be able to call the C
preprocessor directly, just to expand macros in .ml files (this only
happens in the testsuite, at the moment). In those cases, it is
simply impossible to call the C preprocessor through the compiler,
e.g. because this would require the input files to have a '.c'
extension, which the OCaml compiler would misinterprete as meaning this file
should be compiled with the C compiler.

Thus, this commit clarifies the distinction between CPP and DIRECT_CPP
and provides both variables to the build system. The ocamltest build system
is also updated to take advantage of this.

We rely on autoconf's macros to detect how to call the C preprocessor
via the C compiler, except for the MSVC port where its value is hard-coded
to guarantee backward compatibility.
2019-03-13 10:49:31 +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
Armaël Guéneau 00411d41f4 ocamltest: explicitly set OCAML_ERROR_STYLE
Explicitly set OCAML_ERROR_STYLE to its default value when running tests,
instead of inheriting the one coming from the outside environment.
2019-02-27 15:13:56 +01:00
Sébastien Hinderer 520e22a24e ocmaltest: fix paths_same_file in run_unix.c 2019-02-15 14:48:20 +01:00
Fourchaux 1946594bd7 Fixing typos in various files (#2246)
Note: Typos found with https://github.com/codespell-project/codespell

Here is the (semi-manual) command used to get (and correct) the typos:

$ codespell -i 3 -w --skip=".png,.gif,./ocaml/boot,./ocaml/.git,./ocaml/manual/styles,./ocaml/manual/manual/htmlman" -L minimise,instal,contructor,"o'caml",cristal,pres,clos,cmo,uint,iff,te,objext,nto,nd,mut,upto,larg,exten,leage,mthod,delte,tim,atleast,langage,hten,iwth,mke,contant,succint,methids,eles,valu,clas,modul,que,classe,missings,froms,defaut,correspondance,differents,configury,reachs,cas,approche,normale,dur,millon,amin,oje,transfert
2019-02-13 14:04:56 +01:00
Xavier Leroy 0d70c27b7d Avoid the use of Variable-Length Arrays (#2242)
Variable-Length Arrays (VLAs) are a feature of ISO C 1999 that is
slightly controversial.

For one thing, VLAs are an optional feature of ISO C 2011, so a C11
compliant compiler can elect not to implement them.  This is the case
for CompCert.  Some of us find it worthwhile to test CompCert on the
OCaml code base.

For another thing, VLAs come with a risk of stack overflow.

There is only one occurrence of a VLA in OCaml's 58 KLOC of C code.
This commit replaces it by malloc() and free().
2019-02-11 10:11:24 +01:00
Damien Doligez 6015d60fc6
ocamltest: fix `bsd` and `not-bsd` built-in actions (#2223) 2019-02-07 13:07:09 +01:00
David Allsopp 23d582f58e Eliminate assert false for corrupt cmas 2019-02-01 16:18:53 +01:00
David Allsopp 432fd739aa Missing dependency in ocamltest Makefile 2019-02-01 16:18:53 +01:00
David Allsopp 25995a03fc Skip toplevel tests in -no-shared-libs
If the toplevel doesn't support shared libraries, skip any toplevel
tests which will load cma files which have C stubs (e.g. unix.cma). The
present implementation is suboptimal - really, it would be better to
create a custom toplevel, but it only affects one test at the moment.
2019-02-01 16:18:53 +01:00
David Allsopp a3172267c4 Fix using -custom with -no-shared-libs
ocamltest links bytecode executables in custom-runtime mode if they have
C files, but it should also do this for any .cma files which require C
stubs on platforms which don't support dynamic C libraries.
2019-02-01 16:18:53 +01:00
David Allsopp 92709c09b5 Add no-shared-libraries to ocamltest 2019-02-01 16:18:53 +01:00
Nicolás Ojeda Bär ba8eeb36bc ocamltest: do not remove intermediate file to avoid unnecessary rebuilding (#2224) 2019-01-21 15:16:54 +01:00
Damien Doligez 6bbb913693 last commit before branching 4.08 2019-01-18 15:29:36 +01:00
David Allsopp a9a76b58a8 Add hasstr and hassysthreads ocamltest actions
Skipped if the given library hasn't been built.
2019-01-08 17:27:42 +01:00
David Allsopp 97e9865aa9 Add debugger ocamltest action
Skipped if the debugger has not been built.
2019-01-08 17:27:42 +01:00
David Allsopp d889a0279a Add hasunix ocamltest action
This test is skipped if *neither* unix nor win32unix have been built.
2019-01-08 17:27:42 +01:00
Sébastien Hinderer d258bb78ac Build system: use ocamlc -depend rather than ocamldep 2019-01-03 16:43:23 +01:00
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00
Gabriel Scherer 295f71cb96 make alldepend (with new one-dep-per-file printing) 2018-12-12 09:38:49 +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
Thomas Refis d68e0e2077
Provide a way to build the bytecode compiler using Dune (#2093) 2018-10-10 16:16:00 +01: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 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 cec4beae58 Use ROOTDIR in ocamltest Makefile 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
Jérémie Dimino 9124ab82d1
Deprecate Pervasives (#1605)
- inline Pervasives in Stdlib and re-add Pervasives as a deprecated
module that aliases all elements of Stdlib except the stdlib modules.

- remove special case for Stdlib.Pervasives in printtyp.ml
2018-08-27 12:42:14 +01:00
Hugo Heuzard 1ac5954ca7 depend 2018-08-06 13:19:28 +01:00
Gabriel Radanne 1be47bf7ab Just some tbl things. (#1699) 2018-07-23 13:19:41 +01:00
David Allsopp a5f69b0395 Differentiate skipped vs ignored tests
If a test fails or is skipped, then ocamltest skips all the tests below
it. This makes the output of the testsuite a little hard to interpret.

Alter the output so n/a is displayed for the tests underneath - this has
the effect of reducing the number of reported skipped tests back to
pre-ocamltest levels.
2018-07-01 13:13:51 +02:00
Sébastien Hinderer d3e73595e5 Merge the asmrun and byterun directories into the runtime directory 2018-06-28 17:50:33 +02:00
Sébastien Hinderer fc835fe41e Remove the BYTECCCOMPOPTS build variable
This variable is actually never defined.
2018-06-25 07:07:40 +02:00
Gabriel Scherer f3aca2376f
Merge pull request #1821 from gasche/makefiles-consistent-opt-targets
Makefiles: consistently offer `allopt` and `opt.opt` targets
2018-06-24 00:46:50 +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
Sébastien Hinderer a10a3f5806 Rename build variable SHAREDCCCOMPOPTS to SHAREDLIB_CFLAGS 2018-06-20 14:01:42 +02:00