slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.93k stars 568 forks source link

Error cross-compiling to embedded Linux: undefined reference to memfd_create #3403

Closed kevin406972552 closed 11 months ago

kevin406972552 commented 1 year ago

slint:1.1 Can cross compile successfully

slint:1.2 Cross compilation error Q~2E0R679GLV23QE4R2)96P

ogoffart commented 1 year ago

Thanks for the bug report.

I think the actual error is before in the log. Could you please copy-paste more of the log?

Also what exactly are you trying to compile? On what platform to what platform?

tronical commented 1 year ago

The missing function memfd_create() is in libc. I suspect that your libc is missing this symbol.

Are you using musl by chance?

tronical commented 1 year ago

On second look, the nix crate where this seems to originate from handles musl and issues a direct syscall instead of calling into libc. However you're not using aarch64-unknown-linux-musl but aarch64-unknown-linux-gnu as target, so I'm assuming you're not using musl but glibc. What version of libc are you linking against?

ogoffart commented 1 year ago

memfd_create was only added in glibc 2.27. Your glibc version must be older than that.

(See also comment in https://github.com/slint-ui/slint/issues/3443#issuecomment-1713560164 )

We are not calling this simbol directly, but one of our dependency probably does. Maybe it is possible with cargo update --precise to downgrade that dependency.

We do not support such old systems, but if you manage to get it work, please let us know. We would also accept PR to make it work if this turns out to be fixable in Slint.

ogoffart commented 11 months ago

Closing this issue as we suspect this is on a very old platform which we don't support out of the box.