Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 173 additions & 0 deletions .depend
Original file line number Diff line number Diff line change
Expand Up @@ -10497,6 +10497,14 @@ testsuite/lib/testing.cmo : \
testsuite/lib/testing.cmx : \
testsuite/lib/testing.cmi
testsuite/lib/testing.cmi :
testsuite/tools/cmdline.cmo : \
testsuite/tools/harness.cmi \
testsuite/tools/cmdline.cmi
testsuite/tools/cmdline.cmx : \
testsuite/tools/harness.cmx \
testsuite/tools/cmdline.cmi
testsuite/tools/cmdline.cmi : \
testsuite/tools/harness.cmi
testsuite/tools/codegen_main.cmo : \
utils/profile.cmi \
testsuite/tools/parsecmmaux.cmi \
Expand All @@ -10520,6 +10528,28 @@ testsuite/tools/codegen_main.cmx : \
asmcomp/asmgen.cmx \
testsuite/tools/codegen_main.cmi
testsuite/tools/codegen_main.cmi :
testsuite/tools/environment.cmo : \
otherlibs/unix/unix.cmi \
utils/misc.cmi \
testsuite/tools/harness.cmi \
utils/config.cmi \
utils/compression.cmi \
file_formats/cmt_format.cmi \
file_formats/cmo_format.cmi \
bytecomp/bytesections.cmi \
testsuite/tools/environment.cmi
testsuite/tools/environment.cmx : \
otherlibs/unix/unix.cmx \
utils/misc.cmx \
testsuite/tools/harness.cmx \
utils/config.cmx \
utils/compression.cmx \
file_formats/cmt_format.cmx \
file_formats/cmo_format.cmi \
bytecomp/bytesections.cmx \
testsuite/tools/environment.cmi
testsuite/tools/environment.cmi : \
testsuite/tools/harness.cmi
testsuite/tools/expect.cmo : \
utils/warnings.cmi \
toplevel/toploop.cmi \
Expand Down Expand Up @@ -10558,6 +10588,15 @@ testsuite/tools/expect.cmx : \
testsuite/tools/expect.cmi
testsuite/tools/expect.cmi : \
parsing/location.cmi
testsuite/tools/harness.cmo : \
otherlibs/unix/unix.cmi \
utils/config.cmi \
testsuite/tools/harness.cmi
testsuite/tools/harness.cmx : \
otherlibs/unix/unix.cmx \
utils/config.cmx \
testsuite/tools/harness.cmi
testsuite/tools/harness.cmi :
testsuite/tools/lexcmm.cmo : \
testsuite/tools/parsecmm.cmi \
utils/misc.cmi \
Expand Down Expand Up @@ -10617,6 +10656,140 @@ testsuite/tools/parsecmmaux.cmi : \
lambda/debuginfo.cmi \
asmcomp/cmm.cmi \
middle_end/backend_var.cmi
testsuite/tools/testBytecodeBinaries.cmo : \
otherlibs/unix/unix.cmi \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
testsuite/tools/testBytecodeBinaries.cmi
testsuite/tools/testBytecodeBinaries.cmx : \
otherlibs/unix/unix.cmx \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
testsuite/tools/testBytecodeBinaries.cmi
testsuite/tools/testBytecodeBinaries.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/testDynlink.cmo : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
testsuite/tools/testDynlink.cmi
testsuite/tools/testDynlink.cmx : \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
testsuite/tools/testDynlink.cmi
testsuite/tools/testDynlink.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/testLinkModes.cmo : \
testsuite/tools/toolchain.cmi \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
utils/ccomp.cmi \
testsuite/tools/testLinkModes.cmi
testsuite/tools/testLinkModes.cmx : \
testsuite/tools/toolchain.cmx \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
utils/ccomp.cmx \
testsuite/tools/testLinkModes.cmi
testsuite/tools/testLinkModes.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/testRelocation.cmo : \
otherlibs/unix/unix.cmi \
testsuite/tools/toolchain.cmi \
utils/misc.cmi \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
testsuite/tools/testRelocation.cmi
testsuite/tools/testRelocation.cmx : \
otherlibs/unix/unix.cmx \
testsuite/tools/toolchain.cmx \
utils/misc.cmx \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
testsuite/tools/testRelocation.cmi
testsuite/tools/testRelocation.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/testToplevel.cmo : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
testsuite/tools/testToplevel.cmi
testsuite/tools/testToplevel.cmx : \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
testsuite/tools/testToplevel.cmi
testsuite/tools/testToplevel.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/test_in_prefix.cmo : \
otherlibs/unix/unix.cmi \
testsuite/tools/toolchain.cmi \
testsuite/tools/test_ld_conf.cmi \
testsuite/tools/testToplevel.cmi \
testsuite/tools/testRelocation.cmi \
testsuite/tools/testLinkModes.cmi \
testsuite/tools/testDynlink.cmi \
testsuite/tools/testBytecodeBinaries.cmi \
utils/misc.cmi \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
driver/compmisc.cmi \
testsuite/tools/cmdline.cmi \
utils/clflags.cmi \
bytecomp/bytelink.cmi \
testsuite/tools/test_in_prefix.cmi
testsuite/tools/test_in_prefix.cmx : \
otherlibs/unix/unix.cmx \
testsuite/tools/toolchain.cmx \
testsuite/tools/test_ld_conf.cmx \
testsuite/tools/testToplevel.cmx \
testsuite/tools/testRelocation.cmx \
testsuite/tools/testLinkModes.cmx \
testsuite/tools/testDynlink.cmx \
testsuite/tools/testBytecodeBinaries.cmx \
utils/misc.cmx \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
driver/compmisc.cmx \
testsuite/tools/cmdline.cmx \
utils/clflags.cmx \
bytecomp/bytelink.cmx \
testsuite/tools/test_in_prefix.cmi
testsuite/tools/test_in_prefix.cmi :
testsuite/tools/test_ld_conf.cmo : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi \
utils/config.cmi \
testsuite/tools/test_ld_conf.cmi
testsuite/tools/test_ld_conf.cmx : \
testsuite/tools/harness.cmx \
testsuite/tools/environment.cmx \
utils/config.cmx \
testsuite/tools/test_ld_conf.cmi
testsuite/tools/test_ld_conf.cmi : \
testsuite/tools/harness.cmi \
testsuite/tools/environment.cmi
testsuite/tools/toolchain.cmo : \
utils/config.cmi \
testsuite/tools/toolchain.cmi
testsuite/tools/toolchain.cmx : \
utils/config.cmx \
testsuite/tools/toolchain.cmi
testsuite/tools/toolchain.cmi :
otherlibs/dynlink/byte/dynlink.cmo : \
otherlibs/dynlink/dynlink_types.cmi \
otherlibs/dynlink/byte/dynlink_symtable.cmi \
Expand Down
9 changes: 8 additions & 1 deletion .github/workflows/build-msvc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
// # Test Cygwin as well
compilers.push('gcc');
// # Test bytecode-only Cygwin
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-compiler'});
include.push({cc: 'gcc', arch: 'x86_64', config_arg: '--disable-native-toplevel --disable-native-compiler'});
}
}
return {config_arg: [''], arch: ['x86_64'], cc: compilers, include: include};
Expand Down Expand Up @@ -138,6 +138,8 @@ jobs:
--prefix "${{ matrix.cc != 'gcc' && '$PROGRAMFILES/Бактріан🐫' || '$(cygpath "$PROGRAMFILES/Бактріан🐫")'}}"
${{ matrix.cc != 'gcc' && format('--host={0}-pc-windows', matrix.arch) || '' }}
${{ matrix.cc != 'gcc' && format('CC={0}', matrix.cc) || '' }}
--enable-ocamltest
${{ endsWith(matrix.arch, '64') && '--enable-native-toplevel' || '--disable-native-toplevel' }}
${{ matrix.config_arg }}
run: |
eval $(tools/msvs-promote-path)
Expand Down Expand Up @@ -191,3 +193,8 @@ jobs:

- name: Install the compiler
run: make install

- name: Test in prefix
run: |
eval $(tools/msvs-promote-path)
make -f Makefile.test -C testsuite/in_prefix test-in-prefix
34 changes: 28 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,10 @@ jobs:
if: matrix.id == 'normal'
run: |
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
- name: Test in prefix
if: matrix.id == 'normal'
run: |
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix
- name: Build the manual
if: matrix.id == 'normal' && needs.build.outputs.manual_changed == 'true'
run: |
Expand All @@ -159,9 +163,12 @@ jobs:
let jobs = [
{name: 'linux-O0', os: 'ubuntu-latest',
config_arg: "CFLAGS='-O0'"},
{name: 'linux-arm64', os: 'ubuntu-24.04-arm'},
{name: 'macos-x86_64', os: 'macos-13'},
{name: 'macos-arm64', os: 'macos-15'}];
{name: 'linux-arm64', os: 'ubuntu-24.04-arm',
'test-in-prefix': true},
{name: 'macos-x86_64', os: 'macos-13',
'test-in-prefix': true},
{name: 'macos-arm64', os: 'macos-15',
'test-in-prefix': true}];
// # If this is a pull request, see if the PR has the
// # 'CI: Full matrix' label. This is done using an API request,
// # rather than from context.payload.pull_request.labels, since we
Expand All @@ -177,9 +184,10 @@ jobs:
// # Add "static" and "minimal" jobs
jobs = jobs.concat([
{name: 'static', os: 'ubuntu-latest',
config_arg: '--disable-shared'},
config_arg: '--disable-native-toplevel --disable-shared',
'test-in-prefix': true},
{name: 'minimal', os: 'ubuntu-latest',
config_arg: '--disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
config_arg: '--disable-native-toplevel --disable-native-compiler --disable-shared --disable-debug-runtime --disable-instrumented-runtime --disable-systhreads --disable-str-lib --disable-unix-lib --disable-ocamldoc'}]);
}
}
return jobs;
Expand Down Expand Up @@ -240,6 +248,14 @@ jobs:
for dir in $PARALLEL_TESTS; do \
bash -cxe "SHOW_TIMINGS=1 tools/ci/actions/runner.sh test_prefix $dir"; \
done
- name: Install
if: ${{ matrix.test-in-prefix }}
run: |
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh install
- name: Test in prefix
if: ${{ matrix.test-in-prefix }}
run: |
MAKE_ARG=-j OCAMLRUNPARAM=b,v=0 bash -xe tools/ci/actions/runner.sh test-in-prefix

i386:
runs-on: ubuntu-latest
Expand All @@ -259,11 +275,17 @@ jobs:
- name: configure tree
run: |
chown -R ocaml:ocaml .
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
MAKE_ARG=-j CONFIG_ARG='--disable-native-toplevel' su ocaml -c "bash -xe tools/ci/actions/runner.sh configure"
- name: Build
run: |
MAKE_ARG=-j su ocaml -c "bash -xe tools/ci/actions/runner.sh build"
- name: Run the testsuite
if: ${{ needs.config.outputs.skip-testsuite != 'true' }}
run: |
su ocaml -c "bash -xe tools/ci/actions/runner.sh test"
- name: Install
run: |
su ocaml -c "bash -xe tools/ci/actions/runner.sh install"
- name: Test in prefix
run: |
su ocaml -c "bash -xe tools/ci/actions/runner.sh test-in-prefix"
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ META
/testsuite/tools/parsecmm.ml
/testsuite/tools/parsecmm.mli
/testsuite/tools/parsecmm.output
/testsuite/tools/test_in_prefix
/testsuite/tools/test_in_prefix.opt

/tools/ocamldep
/tools/ocamldep.opt
Expand Down
25 changes: 25 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -1984,6 +1984,28 @@ $(asmgen_OBJECT): $(asmgen_SOURCE)
$(V_ASM)$(ASPP) $(OC_ASPPFLAGS) -o $@ $< || $(ASPP_ERROR)
endif

test_in_prefix_SOURCES = $(addprefix testsuite/tools/,\
toolchain.mli toolchain.ml \
harness.mli harness.ml \
environment.mli environment.ml \
cmdline.mli cmdline.ml \
testBytecodeBinaries.mli testBytecodeBinaries.ml \
testDynlink.mli testDynlink.ml \
testLinkModes.mli testLinkModes.ml \
testRelocation.mli testRelocation.ml \
testToplevel.mli testToplevel.ml \
test_ld_conf.mli test_ld_conf.ml \
test_in_prefix.mli test_in_prefix.ml)
test_in_prefix_LIBRARIES = \
otherlibs/unix/unix compilerlibs/ocamlcommon compilerlibs/ocamlbytecomp

# test_in_prefix% would only match test_in_prefix.opt, hence the missing 'x'!
testsuite/tools/test_in_prefi%: CAMLC = $(BEST_OCAMLC) $(STDLIBFLAGS)

testsuite/tools/test_in_prefix$(EXE): OC_BYTECODE_LINKFLAGS += -custom

testsuite/tools/test_in_prefi%: CAMLOPT = $(BEST_OCAMLOPT) $(STDLIBFLAGS)

ocamltest/ocamltest$(EXE): OC_BYTECODE_LINKFLAGS += -custom -g

ocamltest.opt: ocamltest/ocamltest.opt$(EXE) \
Expand Down Expand Up @@ -2028,6 +2050,9 @@ partialclean::
rm -f $(addprefix testsuite/tools/*.,cm* o obj a lib)
rm -f testsuite/tools/codegen testsuite/tools/codegen.exe
rm -f testsuite/tools/expect testsuite/tools/expect.exe
rm -f testsuite/tools/test_in_prefix testsuite/tools/test_in_prefix.exe
rm -f testsuite/tools/test_in_prefix.opt \
testsuite/tools/test_in_prefix.opt.exe
rm -f testsuite/tools/lexcmm.ml
rm -f $(addprefix testsuite/tools/parsecmm., ml mli output)

Expand Down
2 changes: 2 additions & 0 deletions Makefile.build_config.in
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ INSTALL ?= @INSTALL@ -p
INSTALL_DATA ?= @INSTALL_DATA@
INSTALL_PROG ?= @INSTALL_PROGRAM@

SRCDIR_ABS = @ocamlsrcdir@

# Whether to build certain libraries and tools

build_ocamldebug = @build_ocamldebug@
Expand Down
2 changes: 2 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ AC_DEFUN([OCAML_CC_VENDOR], [
AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_CPP])
AC_MSG_CHECKING([C compiler vendor])
dnl The outputs here must be kept in sync with the comment in utils/config.mli
dnl for c_compiler_vendor
AC_PREPROC_IFELSE(
[AC_LANG_SOURCE([
#if defined(_MSC_VER)
Expand Down
21 changes: 21 additions & 0 deletions bytecomp/bytelink.mli
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,27 @@ val linkdeps_unit :

val extract_crc_interfaces: unit -> crcs

(** Ways of starting a bytecode executable *)
type launch_method =
| Shebang_bin_sh of string (** Use a shell script *)
| Shebang_runtime (** Invoke the runtime directly *)
| Executable (** Use the executable stub *)

(** runtime-launch-info files *)
type runtime_launch_info = {
buffer : string; (** Content of the file *)
bindir : string; (** Directory containing runtime executables *)
launcher : launch_method; (** Default launch method (this is never
{!Shebang_runtime}) *)
executable_offset : int (** Offset in the buffer field at which the
executable stub data begins *)
}

val read_runtime_launch_info : string -> runtime_launch_info
(** [read_runtime_launch_info file] loads the {!runtime_launch_info} from [file]

@raise Error if the file cannot be parsed *)

type error =
| File_not_found of filepath
| Not_an_object_file of filepath
Expand Down
Loading
Loading