DynamoRIO / DynamoRIO/dynamorio

build fails on musl-libc based linux systems (for example alpine, void, sabotage)

Open
#1,973 6 comments 0 reactions 0 assignees View on GitHub
Component-Build help wanted OpSys-Linux
Dominant language
C
Stars
3.2k
Forks
629
Avg merge
2d 15h
Merged PRs (30d)
31

Description

```
dynamorio-release_6_1_1/core/unix/os.c: In function 'handle_close_pre':
dynamorio-release_6_1_1/core/unix/os.c:5620:30: error: dereferencing pointer to incomplete type
dynamorio-release_6_1_1/core/unix/os.c:5636:30: error: dereferencing pointer to incomplete type
dynamorio-release_6_1_1/core/unix/os.c:5652:29: error: dereferencing pointer to incomplete type
make[2]: *** [core/CMakeFiles/dynamorio.dir/unix/os.c.o] Error 1
```

the code in question is

``` c
/* update the privately loaded libc's stdout _fileno. */
(*privmod_stdout)->STDFILE_FILENO = our_stdout;

/* update the privately loaded libc's stderr _fileno. */
(*privmod_stderr)->STDFILE_FILENO = our_stderr;

/* update the privately loaded libc's stdout _fileno. */
(*privmod_stdin)->STDFILE_FILENO = our_stdin;
```

FILE is an opaque type and it's illegal to make assumptions about or access the underlying struct from non-libc code.
I'm currently talking with musl's author if there's a portable solution.
the code in question was introduced to fix #261

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.