Commit Graph

540 Commits (d9ee956c9c681837517bdc34fcdb3ff3d465cfa0)

Author SHA1 Message Date
Sébastien Hinderer cc3f70b705 Use autoconf to generate the compiler's configuration script 2018-12-21 16:02:47 +01:00
Laurent Thévenoux db99969bc8 Support FMA operation (#1354)
Adds a fused multiply-add operation to the Float module.

The following changes are made:
- configure: check math.h for the C99 fma() operation.
- fma declarations in float.ml[i] (stdlib/).
- C fma() call or emulation in runtime/floats.c.
- dedicated tests in testsuite/tests/fma.
2018-10-26 10:45:36 +02:00
Sébastien Hinderer 6eea292727
Remove the dl_needs_underscore feature (#2115)
This feature could not be enabled anyway
2018-10-25 15:12:22 +02:00
Sébastien Hinderer e473b67081 runtime: move the definition of INT64_LITERAL from m.h to config.h 2018-10-23 09:01:29 +02:00
Sébastien Hinderer b799715cae tools: move the definition of mklib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +02:00
Sébastien Hinderer 04d24edec0 tools: move the definition of syslib from ocamlmklibconfig.ml to ocamlmklib.ml 2018-10-23 09:01:29 +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 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
Sébastien Hinderer 7b28143ecb Change the way ARCH_CODE32 is defined
Before this commit, this C preprocessor macro was defined in
byterun/caml/m.h by the configure script, but just on some architectures
and only in non-PIC mode.

This commit introduces the HAS_ARCH_CODE32 predicate which is inserted
in the m.h file when this is relevant, the ifdef block on PIC
being moved to config.h.

This is to prepare the switch to autoconf, since header files processed
by config.status are not allowed to contain ifdef blocks.
2018-09-17 14:23:35 +02:00
Sébastien Hinderer 6676d9544c
Stop supporting obsolete platforms (#2024)
This commit simplifies the configure script by removing the support
for obsolete platforms. The list of removed platforms is documented
in the associated Changes entry.
2018-09-06 15:52:01 +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
Xavier Leroy 7e79186a12
Remove the C plugins mechanism (#1867)
The mechanism complicates the runtime system and is not very general
(only a few system functions are instrumented).  There are other ways
to intercept system calls that are more general and require no
modification to the source code of the runtime system.
2018-07-03 18:22:51 +01: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 fc835fe41e Remove the BYTECCCOMPOPTS build variable
This variable is actually never defined.
2018-06-25 07:07:40 +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
David Allsopp b5d1929e87 Whitespace and overlong line fixes. 2018-06-14 15:15:34 +01:00
Sébastien Hinderer c226df2716 Remove the NATIVECCPROFOPTS build variable
This variable is actually always empty
2018-06-14 15:25:39 +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
ygrek 1739e4ee13 include xlocale.h if available (because OSX)
ref https://github.com/ocaml/ocaml/pull/1682#issuecomment-377524854
2018-06-01 21:05:10 +02:00
ygrek b8dde22c46 avoid duplocale due to different semantics on BSD
https://www.freebsd.org/cgi/man.cgi?query=newlocale&sektion=3
2018-06-01 21:05:10 +02:00
ygrek 36d142e058 make string_of_float and float_of_string locale-independent 2018-06-01 21:05:10 +02:00
Sébastien Hinderer 09bf2fae0e configure should remove hashbang4 2018-05-18 09:17:59 +02:00
Mark Shinwell 8054e4f819 Add configure option to not install ".byte" executables (#1776)
In environments where the executables compiled to native code,
such as ocamlopt.opt, are always used in preference to the bytecode
versions then space can be saved by not installing the latter.
This patch provides a configure option to do such. It is relatively lightly
engineered; in particular, it won't complain if the native code executables
aren't themselves being built; but given this is an option for knowledgeable
users we think that it is reasonable.
2018-05-14 10:44:01 +02:00
Mark Shinwell ea2d6a1e31
Add configure options to control installation of source artifacts (#1777) 2018-05-14 08:15:44 +01:00
Pierre Chambart 0a42259060 Turn flambda invariants checks off by default (#1686) 2018-04-06 09:49:57 +01:00
Gabriel Scherer 682aceb2a4 Revert "make string_of_float and float_of_string locale-independent (#1185)"
This reverts commit b0181bf8ba.

The revert comes from the fact that it breaks the build on OSX, see

  https://github.com/ocaml/ocaml/pull/1185#issuecomment-377098168
2018-03-29 07:09:09 +02:00
ygrek b0181bf8ba make string_of_float and float_of_string locale-independent (#1185)
notes:

* ifdef fest for MSVC
https://docs.microsoft.com/en-us/cpp/c-runtime-library/locale

* avoid duplocale due to different semantics on BSD
https://www.freebsd.org/cgi/man.cgi?query=newlocale&sektion=3

* mingw links against old msvcrt and doesn't have _create_locale
2018-03-28 16:33:09 +02:00
David Allsopp f0ac94d0c3 Enhance X11 detection logic (#1584) 2018-03-15 11:13:23 +00:00
David Allsopp 4d79045d95 Use gawk on Windows in the build system
awk is symbolic link in Cygwin, which means it can't be used in -pp for
a native Windows build. Just use gawk instead, as no other package
provides the awk command on Cygwin.
2018-02-12 08:29:16 +00:00
Xavier Leroy e71f1021b8
ARM 32-bit port: add support for ARMv8 in 32-bit mode, a.k.a. AArch32 (#1486)
For ARMv8/AArch32, avoid ITE conditional instruction blocks and use
simpler IT blocks instead.
2017-12-28 19:21:50 +01:00
Gabriel Scherer dc3086f92c configure: build the debug and instrumented runtimes by default (#1526)
This commit builds the debug and instrumented runtimes by default.

For a user that discovers a use for either of those, not having built
by default makes the experience pretty bad: they have to recompile
their own OCaml compiler, possibly from a source checkout if the
option is not available on opam...

With this change the total compilation time only increased by
7 seconds on my machine, from 3m24s to 3m33s -- these are sequential
builds, with parallel builds the difference is lost in the noise.

We wish to make -with-instrumented-runtime the default, but not break
the build on systems that do not support it -- when clock_gettime is
missing. This is done by tracking whether -with-instrumented-runtime
was set explicitly or is the default value; in the latter case,
a missing clock_gettime defaults to no instrumented runtime, without
raising an error at configure-time.
2017-12-15 10:03:24 +01:00
Andrey Bergman 0892f934e6 Replace non-existent with_spacetime_call_counts with enable_call_counts in configure. 2017-12-03 16:02:46 -06:00
Andrey Bergman db89791565 Remove unused curseslibs in configure. 2017-12-03 16:02:36 -06:00
Andrey Bergman 75269642cc Remove unused dllccompopt from configure. 2017-12-03 16:02:26 -06:00
Andrey Bergman 91f4dcab85 Remove unused x11_libs from configure. 2017-12-03 16:02:11 -06:00
Xavier Leroy 13785c9276
MPR#7679: make sure `.a` files are erased before calling `ar rc` (#1494)
Otherwise leftover .a files from an earlier compilation may contain
unwanted modules, as shown in MPR#7679.

However, ocamlmklib always erases the destination .a file before
calling the `mkdll` function defined in `#ml` blocks of the
configuration makefile.  Hence there is no need for a `rm` (or `del`)
shell command in `mklib`.

Finally, in the config/Makefile.mingw* files, we can safely assume
"ar" supports the "s" option because this is "ar" from the GNU
binutils, so no need to call ranlib.
2017-11-30 11:25:17 +01:00
Xavier Leroy 852b595ff3
Remove dependencies on curses/terminfo/termcap C library (#1431)
The terminfo C library was used for displaying error messages from the
toplevel.  Instead, just use ANSI escape sequences to display, and a
ioctl() to get the number of lines of the terminal.

- Remove byterun/terminfo.c
- Add primitive to query number of lines to io.c
  with OS-dependent code in unix.c (ioctl-based implementation)
  and win32.c (no implementation yet)
- Add a Terminfo.num_lines function and simplify interface to Terminfo.setup
- Query num_lines every time an error message needs to be highlighted,
  so as to react to windows resizing.
- Bootstrap to enable removal of old primitives.
2017-11-26 15:49:31 +01:00
he32 df44fa572a Fix NetBSD/powerpc to build and work (#1409) 2017-10-20 12:45:04 +01:00
Leo White 6d3a8b904e Merge pull request #1421 from lpw25/call-counts-by-default
Enable call counts in spacetime by default
2017-10-17 13:42:00 +01:00
Leo White 8f6c6aca92 Enable call counts in spacetime by default 2017-10-12 16:52:09 +01:00
Xavier Leroy 970eebe4be MPR#7640: reimplementation of Unix.execvpe (#1414)
Use the system-provided execvpe() if possible.  Otherwise, use
a serious reimplementation written in OCaml and patterned after
the Glibc execvpe() implementation.

Added a test in tests/lib-unix/unix-execvpe.

Don't test Unix.execvpe if we are using the system-provided implementation.
The execvpe() functions provided by Win32 and Cygwin aren't quite to
our specs.  At any rate, the test is there to find bugs in our
implementation of execvpe(), not in others's.
2017-10-10 14:12:19 +02:00
Gabriel Scherer a202aa032b rename the configure-time safe-string options for clarity
-(un)safe-string becomes -(no-)force-safe-string
-(un)safe-string-default becomes -default-unsafe-string

Config.safe_string (and Clflags.unsafe_string) keep their name for
backward-compatibility, as well as the C define CAML_SAFE_STRING
(which corresponds to -force-safe-string).
2017-10-02 14:42:19 +02:00
Gabriel Scherer 6550a30719 safe-string: clarify the relation between configure- and compile-time options 2017-10-02 14:42:19 +02:00
Xavier Leroy 46899afd5e In Sys.getcwd, don't call getwd if HAS_GETWD is not set (follow-up to #1086) (#1335) 2017-09-28 12:25:11 +01:00
Mark Shinwell a90d8c3b40 Revised configuration test for int64 alignment (#1371)
MacOS High Sierra balks at the redefinition of `int64_t`.
2017-09-27 15:45:41 +02:00
Sébastien Hinderer 8b6df3a755 Fix build of ocamlrund and ocamlruni under Unix
Because of previous commits these programs were not using LDFLAGS
when built under Linux.

This commit fixes this.
2017-09-27 12:31:56 +02:00
Nicolás Ojeda Bär 9fe6d0e2c2 Unicode support for the Windows runtime (#1200)
* Add support code

* Explicitly reference ANSI Windows APIs

* Adapt Sys.is_directory

* Adapt ocamlrun

* Add Changes entry

* Add testsuite

* Adapt Unix.open_process{_in,_out,_full,}, Unix.create_process{_env,}

* Adapt headernt.c

* Adapt Pervasives.open_{in,out}, Filename.temp_file, etc.

* Adapt Sys.file_exists

* Adapt Sys.remove

* Adapt Sys.chdir

* Adapt Sys.getcwd

* Adapt Sys.getenv

* Adapt Sys.command

* Adapt Sys.readdir

* Adapt CPLUGINS

* Remove use of FormatMessageA, CreateFileA

* Adapt Unix.mkdir

* Adapt Unix.openfile

* Adapt Unix.readlink

* Adapt Unix.rename

* Adapt Unix.{LargeFile,}.{l,}stat

* Adapt Unix.system

* Adapt Unix.{open,read}dir

* Adapt Unix.link

* Adapt Unix.symlink

* Adapt Unix.getcwd

* Adapt Unix.rmdir

* Adapt Unix.utimes

* Adapt Unix.unlink

* Adapt Unix.chdir

* Adapt Unix.chmod

* Adapt Unix.{execv,execve,execvp,execvpe}

* Compile with -DUNICODE -D_UNICODE under Windows

* Add configure-time switch, Config.windows_unicode

* Adapt Unix.putenv

* Re-implement Unix.environment using GetEnvironmentStrings()

* Use Unicode-aware flexdll

* Adapt Unix.environment

* AppVeyor: bootstrap flexdll

* Adapt tests/embedded/cmmain.c

* Adapt tests/lib-dynlink-csharp/entry.c

* Remove exec tests

* Fixup

* Pass -municode to MinGW compiler

* Try to fix tests/embedded

* Adapt Sys.rename

* Correct Changes entry

* Makefile.several: use $(O) and $(NATIVECODE_ONLY)

* Display => skipped correctly for tests/win-unicode

* Add missing casts to execv* calls

It's not clear why these aren't necessary for with char, but they are
necessary with wchar_t on GCC (but not MSVC).

* Missing header in systhreads (Win32 only)

* Revert "Pass -municode to MinGW compiler"

This reverts commit a4ce7fb319c429068a5b9d1ab14a2cc3969c355f.

* Revert "Try to fix tests/embedded"

This reverts commit 5197d8922295b7b339b970ec3189374aa15de4b8.

* Revert "Remove exec tests"

This reverts commit 306ccef2e79eca5b38ecfa285b912c7bcf3e9f52.

* Don't pass $(LDFLAGS) when build ocamlc.opt

It's already included via CC anyway, and it causes Unicode problems for
Winodws (because the linker options need to be prefixed "-link" to go via
flexlink).

* Use wmain on Windows for ocamlrun

* Build Unicode applications on Windows

* Use wmain in headernt.c

* Minor correction to win-unicode Makefile

* Switch submodule to FlexDLL 0.36

* Build ocamlyacc as an ANSI application

* Revert "Fixup"

This reverts commit 500bd6b575ffd6c5b71c6953e55d740f0b090185.

* Fix casts for execvp/execve

* Remove tabs from test code

* Fix Changes entry

* shell32.lib is no longer necessary

* Free allocated string

* Changes: signal breaking change

* Disable exec_tests

* Protect with CAML_INTERNALS
2017-09-18 17:41:29 +02:00