Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really need a comprehensive guide on building #736

Open
Kiwifuit opened this issue Aug 29, 2024 · 1 comment
Open

Really need a comprehensive guide on building #736

Kiwifuit opened this issue Aug 29, 2024 · 1 comment
Assignees

Comments

@Kiwifuit
Copy link

Just started making my own linux from scratch and I cant seem to build a static binary for it

I have set the following options:

  User defined options
    backend        : ninja
    buildtype      : release
    default_library: static
    strip          : True
    branding       : openlinux
    pam            : false
    rootprefix     : /tmp/final/initramfs/

but when i do file initramfs/sbin/openrc i get a dynamically compiled binary:

initramfs/sbin/openrc: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=e252c588c31d05a1e85f359253fb26e9d5eada81, for GNU/Linux 3.2.0, stripped

Is it possible to create a comprehensive guide on how to build openrc statically?

@sertonix
Copy link

To build statically linked with meson I recommend to always use all of these options: -Dc_link_args=-static -Ddefault_library=static -Dprefer_static=true.

Also meson will silently use dynamically linked libraries when it can't find statically linked ones. So check that all the *.a files are there.

@navi-desu navi-desu self-assigned this Sep 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants