You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are running into trouble with centos 7 based builds of snmalloc. ( Dockerimage )
We do have to support such an old system for the time being (don't ask), you might not want to support it, which i totally understand.
The system is based on gcc 9, kernel 3.10.0 and libraries, which is all horribly outdated.
Our build system gives the following error:
...
/cargo/registry/src/github.com-1ecc6299db9ec823/snmalloc-sys-0.3.1/snmalloc/src/snmalloc/override/../global/../backend/../backend_helpers/../mem/../ds/../pal/pal_linux.h: In static member function 'static void snmalloc::PALLinux::notify_not_using(void*, size_t)':
/cargo/registry/src/github.com-1ecc6299db9ec823/snmalloc-sys-0.3.1/snmalloc/src/snmalloc/override/../global/../backend/../backend_helpers/../mem/../ds/../pal/pal_linux.h:111:24: error: 'MADV_FREE' was not declared in this scope; did you mean 'MADV_REMOVE'?
111 | madvise(p, size, MADV_FREE);
| ^~~~~~~~~
| MADV_REMOVE
/cargo/registry/src/github.com-1ecc6299db9ec823/snmalloc-sys-0.3.1/snmalloc/src/snmalloc/override/../global/../backend/../backend_helpers/../mem/../ds/../pal/pal_linux.h: In static member function 'static uint64_t snmalloc::PALLinux::get_entropy64()':
/cargo/registry/src/github.com-1ecc6299db9ec823/snmalloc-sys-0.3.1/snmalloc/src/snmalloc/override/../global/../backend/../backend_helpers/../mem/../ds/../pal/pal_linux.h:180:57: error: 'GRND_NONBLOCK' was not declared in this scope; did you mean 'O_NONBLOCK'?
180 | ret = syscall(SYS_getrandom, current, length, GRND_NONBLOCK);
| ^~~~~~~~~~~~~
| O_NONBLOCK
gmake[3]: *** [CMakeFiles/snmallocshim-rust.dir/src/snmalloc/override/rust.cc.o] Error 1
Possible Solutions
On those old systems we do have GRND_NONBLOCK etc. defined in /usr/include/linux/random.h, i do think this include is missing (maybe guarded by a check if GRND_NONBLOCK is defined).
MADV_FREE is only available since linux 4.5. Should we fallback to MADV_REMOVE for systems where MADV_FREE is not defined?
I will happily provide those fixes if you deem them good enough or maybe you have another idea?
The text was updated successfully, but these errors were encountered:
mfelsche
changed the title
Missing defines on kernel < 4.X
Missing defines on systems with kernel < 4.X
Jun 15, 2022
I am happy for a small amount of ifdef magic to handle this. Overall, I can't promise I won't break things in the future, as this won't be tested in CI. But the PAL tends not to change much, so I think it shouldn't be too bad.
Description
We are running into trouble with centos 7 based builds of snmalloc. ( Dockerimage )
We do have to support such an old system for the time being (don't ask), you might not want to support it, which i totally understand.
The system is based on gcc 9, kernel 3.10.0 and libraries, which is all horribly outdated.
Our build system gives the following error:
Possible Solutions
On those old systems we do have
GRND_NONBLOCK
etc. defined in/usr/include/linux/random.h
, i do think this include is missing (maybe guarded by a check ifGRND_NONBLOCK
is defined).MADV_FREE
is only available since linux 4.5. Should we fallback toMADV_REMOVE
for systems whereMADV_FREE
is not defined?I will happily provide those fixes if you deem them good enough or maybe you have another idea?
The text was updated successfully, but these errors were encountered: