Antonin Décimo

Results 287 comments of Antonin Décimo

A bit early for a review I suppose, but the right spelling would be _immediately_, and you might want to use [`__FUNCTION__`](https://ocaml.org/manual/5.3/api/Stdlib.html#VAL__FUNCTION__) to retrieve the function's name!

> Looking good, although if there is a risk of many `` strings happening, then it would be best to declare it as a `static char[]` in this file and...

> Why `const char *` instead of `const char[]`? > > When you declare `const char *foo = "bar";`, you declare a `"bar"` string literal, **and** a `char *` pointer...

> You propose to free them *earlier* than `caml_shutdown`, and only in this sense is a leak avoided. [...] The only debug information that gets removed comes from toplevel phrases...

A minor leak for a complicated fix. Not worth wasting more brain quota, I suppose ;)

You could also add to the top of `misc.h`: ```c #ifndef __has_feature #define __has_feature(x) 0 #endif ```

You're missing the `binutils` package. See this line in the `configure` output: ``` - checking for ar... no ``` then `AR` is defined to `false`, which makes the `MKLIB` invocation...

OCaml internally calls [`system()`](https://pubs.opengroup.org/onlinepubs/9799919799/functions/system.html) ([bionic source](https://android.googlesource.com/platform/bionic.git/+/refs/heads/main/libc/bionic/system.cpp)) in [`runtime/sys.c`](https://github.com/ocaml/ocaml/blob/55ee0e0eaf83e6f4276754ac16883855f800f968/runtime/sys.c#L509-L530) via [`Ccomp.command`](https://github.com/ocaml/ocaml/blob/55ee0e0eaf83e6f4276754ac16883855f800f968/utils/ccomp.ml#L18-L26) and [`Pparse.call_external_preprocessor`](https://github.com/ocaml/ocaml/blob/55ee0e0eaf83e6f4276754ac16883855f800f968/driver/pparse.ml#L26-L35). A simple test shows that (maybe for security reasons) the `system` function has been disabled. ```console $ cat

This suggests that we should re-implement `caml_sys_system_command` in terms of a lower-level primitive that is not blocked, maybe `posix_spawn` or `fork`/`exec`, perhaps only on Android, and possibly test whether a...

Not sure what changed since then, but compiling OCaml 5.5+trunk in Termux worked for me. ```sh pkg install clang binutils make TARGET=aarch64-unknown-linux-android API=28 ./configure CC="clang --target=$TARGET$API" make -j$(nproc) ```