Commit Graph

486 Commits (837ecff306a7fcec03a86b975161fc812bd2e5cc)

Author SHA1 Message Date
yallop 65c932253b String_val: return 'const char *' when -safe-string is globally enabled (#1274) 2017-08-03 14:19:13 +01:00
Mark Shinwell ba12f90fee Spacetime configure test 2017-08-03 08:20:04 +01:00
Gabriel Scherer 890c8bb2ca [minor] harden config/Makefile against '#' in PREFIX
The opam-compiler-conf script will generate an opam switch name
(and thus a directory name) from the name of the current git
branch. Branches named 'PR#1234-foo-bar' would have the ./configure
script generate a config/Makefile with the lines

    PREFIX=~/.opam/4.06.0+local-git-PR#1234-foo-bar
    BINDIR=$(PREFIX)/bin
    BYTERUN=$(BINDIR)/ocamlrun
    LIBDIR=$(PREFIX)/lib/ocaml

The '#' in the first line parses as the start of a comment, so
the second part is ignored and the build system would then install
in ~/.opam/4.06.0+local-git-PR instead.

After this change, config/Makefile starts with:

    # generated by ./configure --prefix ~/.opam/4.06.0+local-git-PR#1234-foo-bar
    CONFIGURE_ARGS=--prefix ~/.opam/4.06.0+local-git-PR\#1234-foo-bar
    PREFIX=~/.opam/4.06.0+local-git-PR\#1234-foo-bar
2017-07-23 08:19:55 +02:00
AlexOnWork 72940fe95f Disable cplugins feature by default (#1242)
* Disable cplugins feature by default

* Both --with-cplugins and --no-cplugins configure options

* Added Changes entry for GPR#1242
2017-07-20 15:53:48 +02:00
Damien Doligez e6d64aacbd take @shindere's remarks into account 2017-07-18 13:12:34 +02:00
Damien Doligez f78128a7d7 merge 4.05 into trunk 2017-07-18 13:03:54 +02:00
Damien Doligez 2d03974c12 PR#7452: tweak GCC options to try to work around the Skylake/Kaby lake bug (#1228) 2017-07-12 11:39:26 +02:00
yallop de6ec33c6e Restrict Unix.environment in privileged contexts; add Unix.unsafe_environment (#1217)
* Restrict Unix.environment to return an empty array in privileged environments.

* Add Unix.unsafe_environment.

Unix.unsafe_environment is an analogue of Unix.environment that
returns the process environment regardless of privileges.
2017-06-30 11:31:10 +02:00
Damien Doligez fee01100fb Some tweaks for MPR#7557 (#1213)
* fall back to __secure_getenv when secure_getenv is not available

* use secure_getenv for instrumented runtimes

* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
2017-06-28 14:08:07 +02:00
Damien Doligez cf100bae04 Some tweaks for MPR#7557 (#1213)
* fall back to __secure_getenv when secure_getenv is not available

* use secure_getenv for instrumented runtimes

* documentation: warn against setting the setuid or setgid bits on custom bytecode executables
2017-06-28 14:02:15 +02:00
Damien Doligez 15966dbeaa cherry-pick the fix for MPR#7557 from 4.04 2017-06-23 17:55:46 +02:00
Damien Doligez d4972ea1d3 cherry-pick the fix for MPR#7557 from 4.04 2017-06-23 17:50:53 +02:00
Mark Shinwell 9683393625 Call counts in Spacetime (#1180) 2017-06-16 13:51:12 +01:00
Mark Shinwell 0bf66ce0e1 Suppress trigraph warnings from macOS assembler (#1093)
Also check that trigraphs aren't interpreted
2017-05-16 20:58:23 +01:00
David Allsopp d526e7cce9 Move INT64_LITERAL from byterun/ints.c to m.h 2017-05-16 19:48:37 +01:00
Sébastien Hinderer 40fcbb5f0a Move configuration header files from the config to the byterun/caml directory
This commit moves:
  - config/m.h to byterun/caml/m.h
  - config/s.h to byterun/caml/s.h

Consequently, m.h and s.h now get installed alongside other
OCaml header files.

This commit also updates the .depend files, introducing updates in the
dependencies which are not consequences of this commit itself.
2017-04-26 19:28:17 +02:00
Mark Shinwell 3da1c33ffa Unrevert 2017-04-10 12:35:50 +01:00
Mark Shinwell 3efe66e043 Remove SPARC backend 2017-04-10 09:18:13 +01:00
Konstantin Romanov bd8674a041 Support for xlc and bytecode shared libs on AIX.
This patch adds support for xlc (IBM C compiler, used on
Linux and AIX) in cckind.cc and enables shared libraries
support in bytecode compiled programs on AIX.

It was tested on Linux/gcc and AIX7.1/xlc 12. By default
configure script uses gcc compiler, so there should be no
impact on Linux/xlc systems. To use xlc one should run
configure with -cc xlc.
2017-03-31 13:47:24 -04:00
Sébastien Hinderer dc3038ced6 Adjust C compiler invocation
This commit is a follow-up to PR#1114. It ensures that C compilers
other than msvc are called with a space between the -o option and
its object or executabe file argument.
2017-03-30 16:27:21 +02:00
Sébastien Hinderer eef958007e Build system: rename variables related to manual pages
Rename MANEXT (resp. LIB_MANEXT) to PROGRAMS_MAN_SECTION (resp.
LIBRARIES_MAN_SECTION).

Also get rid of a useless variable assignment in configure.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 5f161087ef Introduce the LIB_MANEXT build variable
It contains the section for library function manual pages (3).

This will be useful to properly install the manual pages generated
by ocamldoc for the standard library.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer f6386a8e7c configure: export the verbose variable earlier
Before this commit, auxiliary scripts were called before verbose
was exported, so they were not executed in verbose mode.

This commit fixes this and makes sure all the auxiliary scripts take
the verbose environment variable into acocunt.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 3564aade19 Introduce and use the OUTPUTEXE and OUTPUTOBJ build variables 2017-03-29 11:10:06 +02:00
Sébastien Hinderer f2d5d60376 Define new build variables for C compiler and preprocessor flags 2017-03-29 11:10:06 +02:00
Sébastien Hinderer 3262da1839 configure script enhancement
Let the with_sharedlibs variable take boolean values rather than yes
and no. This simplifies tests a bit.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer cc7ad5650a Get rid of BYTECC and NATIVECC
Use the same C compiler, CC, in all the build system.
2017-03-29 11:10:06 +02:00
Sébastien Hinderer 1effaeb058 Use only one variable for rpath
Before this commit there was BYTECCRPATH and NATIVECCRPATH, but they
were actually identical to each other.

This commit gets rid of them and uses the RPATH variable.
2017-03-29 11:10:05 +02:00
Sébastien Hinderer 64c8946828 configure: use cflags and ldflags when calling helper scripts 2017-03-29 11:10:05 +02:00
Sébastien Hinderer 8868a7c023 Rename the BYTECCLINKOPTS build variable to LDFLAGS 2017-03-29 11:10:05 +02:00
Sébastien Hinderer ec6b25b7a0 Get rid of the NATIVECCLINKOPTS build variable.
This variable is empty and actually never used in the build system.
2017-03-29 11:10:05 +02:00
Sébastien Hinderer dcbb7ed26d configure system fixup
For the verbose variable, use boolean values true and false rather
than yes and no.

Also fix indentation in scripts under config/auto-aux where appropriate.
2017-03-29 11:10:05 +02:00
David Allsopp 7fefb22da7 Move INT64_LITERAL from byterun/ints.c to m.h 2017-03-28 13:19:21 +00:00
David Allsopp 682da8ebc0 Test objinfo_helper 2017-03-23 22:00:18 +00:00
David Allsopp 28e8cb3b4a Increase the detail given when BFD not found 2017-03-22 10:01:43 +00:00
Sébastien Hinderer 07a6851bdc Remove support for the NeXTStep platform 2017-03-13 13:58:17 +01:00
Mark Shinwell 2ddcd4de9b Enable shared library support on more Linux platforms (was GPR#558) 2017-03-07 11:09:41 +00:00
whitequark 70f84eef2d Build dylibs, not bundles, on macOS. (#988)
Generally, OCaml creates dynamic libraries in three cases:
  * when building bytecode stubs (dllX.so);
  * when building a .cmxs plugin;
  * when building a .native.so or even .byte.so.

Right now, this results in DLLs on Windows and ELF shared objects on Linux,
all of which can be dynamically loaded (with dlopen() or equivalent) or
linked against (with the -l linker flag or equivalent). However, on macOS,
this is not the case.

macOS has two kinds of dynamic libraries: "bundles" and "dylibs". Prior to
the version 10.4, there have been significant differences between these,
which I will not describe in this commit because 10.4 has long became
irrelevant. After 10.4, there are only two differences:
  * rpath is handled slightly differently.
  * dylibs can be linked against, with the -l linker flag;

Before this commit, ocamlc/ocamlopt on macOS produce bundles, when using
the .so extension for the output file. After this commit, OCaml on macOS
will produce dylibs, when using the same extension. The rationale is as
follows:
  * For bytecode stubs and plugins, the exact structure of which is essentially
    an implementation detail of the OCaml runtime, nothing will change because
    they can still be dynamically loaded.
  * For .native.so and .byte.so objects, there are two changes:
      1. The objects can be linked against with the -l flag.
      2. The objects can be linked with the -cclib -shared flag, which is
         what ocamlbuild and perhaps other buildsystems pass when building
         a shared object through -output-obj/-output-complete-obj.
2017-02-24 15:41:42 +01:00
Sébastien Hinderer b43fa88e23 Remove unused definitions of the PARTIALLD make variable 2017-02-15 10:45:10 +01:00
Sébastien Hinderer e169dc4bfc Introduce the BYTECODE_C_COMPILER and NATIVE_C_COMPILER make variables
These variables represent the C compilers ocamlc and ocamlopt should use
to compile a third-party C source file when no -cc command-line option
has been specified.

Thanks to these variables, the substitutions performed in Makefile and
Makefile.nt to generate utils/config.ml from utils/config.ml become
similar.

(The NATIVE_C_COMPILER variable is not really necessary but it has still
been introduced to preserve symetry.)
2017-02-15 10:24:09 +01:00
Sébastien Hinderer 04aa870b9b Define BYTERUN as a real make variable
This variable is used to give a value to standard_runtime in
utils/config.ml.

Before this commit, its values were hard-coded in Makefile and
Makefile.nt, in the rules generating utils/config.ml from utils/config.mlp.

This commit gets rid of this hardcoding, to prepare the sharing of the
rules mentionned above.
2017-02-15 10:24:09 +01:00
Xavier Leroy ab4e3beab1 Unix library: better API for "close-on-exec" over file descriptors (#650) 2017-02-13 18:05:19 +01:00
Leo White 709f5c7661 Use -fno-builtin-memcmp with gcc 2017-01-10 10:12:17 +00:00
Prashanth Mundkur eb9cda6491 Fix redundant configure clause for openbsd shared lib options (#945) 2016-12-28 14:55:40 +00:00
Gabriel Scherer d4cd072d4c Merge pull request #935 from ygrek/termux-build
allow build in termux
2016-12-23 16:53:24 -05:00
Sébastien Hinderer 68ad1bb923 Merge Unix and Windows build systems in the asmrun directory (#941)
* Merge Unix and Windows build systems in the asmrun directory

Changes in make variables:

  - Removal of the SHARED make variable, which had the same
    semantics than SUPPORTS_SHARED_LIBRARIES, the later having values true
    and false while the former had values shared and noshared.
    (SHARED was not defined on Windows)
  - RUNTIMED now takes values true and false rather than runtimed and
    noruntimed

* Do not use -O0 in asmrun's Makefile

* Add /asmrun/win32.c to .gitignore

* Build PIC libraries only under Unix

This makes things closer to what they were before, since PIC objects
were not built for Windows.
2016-12-20 16:54:20 +01:00
Stephen Dolan a35c6117e6 Instrumentation for american fuzzy lop (afl-fuzz) (#504) 2016-12-06 17:18:04 +01:00
Sébastien Hinderer 757fc5e6da Fix the definition of NATIVECCCOMPOPTS by configure 2016-12-05 16:00:21 +01:00
Bernhard Schommer 6022802ebf Allow -with-frame-pointers for clang under linux. (#887)
GPR#897: allow -with-frame-pointers for clang under linux.
2016-12-04 15:52:49 -05:00
Bernhard Schommer 73b76f80bd Test for ccfamily for preprocessed as. (#919)
GPR#919: Test for ccfamily for preprocessed as.
2016-12-04 10:23:45 -05:00