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

Busybox build fails on Arch #8

Closed
DataThinkMonkey opened this issue Apr 22, 2022 · 3 comments
Closed

Busybox build fails on Arch #8

DataThinkMonkey opened this issue Apr 22, 2022 · 3 comments

Comments

@DataThinkMonkey
Copy link

DataThinkMonkey commented Apr 22, 2022

Attempting to build on Arch but make build fails.

`Static linking against glibc, can't use --gc-sections
Trying libraries: crypt m resolv rt
Failed: -Wl,--start-group -lcrypt -lm -lresolv -lrt -Wl,--end-group
Output of:
gcc -malign-data=abi -Wall -Wshadow -Wwrite-strings -Wundef -Wstrict-prototypes -Wunused -Wunused-parameter -Wunused-function -Wunused-value -Wmissing-prototypes -Wmissing-declarations -Wno-format-security -Wdeclaration-after-statement -Wold-style-definition -finline-limit=0 -fno-builtin-strlen -fomit-frame-pointer -ffunction-sections -fdata-sections -fno-guess-branch-probability -funsigned-char -static-libgcc -falign-functions=1 -falign-jumps=1 -falign-labels=1 -falign-loops=1 -fno-unwind-tables -fno-asynchronous-unwind-tables -fno-builtin-printf -Os -static -o busybox_unstripped -Wl,--sort-common -Wl,--sort-section,alignment -Wl,--start-group applets/built-in.o archival/lib.a archival/libarchive/lib.a console-tools/lib.a coreutils/lib.a coreutils/libcoreutils/lib.a debianutils/lib.a klibc-utils/lib.a e2fsprogs/lib.a editors/lib.a findutils/lib.a init/lib.a libbb/lib.a libpwdgrp/lib.a loginutils/lib.a mailutils/lib.a miscutils/lib.a modutils/lib.a networking/lib.a networking/libiproute/lib.a networking/udhcp/lib.a printutils/lib.a procps/lib.a runit/lib.a selinux/lib.a shell/lib.a sysklogd/lib.a util-linux/lib.a util-linux/volume_id/lib.a archival/built-in.o archival/libarchive/built-in.o console-tools/built-in.o coreutils/built-in.o coreutils/libcoreutils/built-in.o debianutils/built-in.o klibc-utils/built-in.o e2fsprogs/built-in.o editors/built-in.o findutils/built-in.o init/built-in.o libbb/built-in.o libpwdgrp/built-in.o loginutils/built-in.o mailutils/built-in.o miscutils/built-in.o modutils/built-in.o networking/built-in.o networking/libiproute/built-in.o networking/udhcp/built-in.o printutils/built-in.o procps/built-in.o runit/built-in.o selinux/built-in.o shell/built-in.o sysklogd/built-in.o util-linux/built-in.o util-linux/volume_id/built-in.o -Wl,--end-group -Wl,--start-group -lcrypt -lm -lresolv -lrt -Wl,--end-group
==========

/usr/bin/ld: cannot find -lcrypt: No such file or directory
collect2: error: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"
make[1]: *** [Makefile:719: busybox_unstripped] Error 1
make[1]: Leaving directory '/home/jared/nice/NiceOS/storage/build/busybox/busybox-1.34.1'
make: *** [Makefile:37: build] Error 2
`

@solcloud
Copy link
Owner

solcloud commented Apr 22, 2022

Thank you for trying NiceOS and sorry for not smooth first build. This is unfortunately because of Arch team remove static libcrypt for size and/or for better future proof security with forcing dynamic linking.

In next comment I provide some solutions.

@solcloud solcloud changed the title make build fails on Arch Busybox build fails on Arch Apr 22, 2022
@solcloud
Copy link
Owner

Example how to obtain libcrypt.a from debian sid repository:

package source: https://packages.debian.org/sid/libcrypt-dev
choose mirror from: https://www.debian.org/mirror/list
download deb package and extract libcrypt.a, eg:

wget 'http://ftp.cz.debian.org/debian/pool/main/libx/libxcrypt/libcrypt-dev_4.4.27-1.1_amd64.deb'
# verify deb package signature or download from multiple sources and use diff
ar x libcrypt-dev_4.4.27-1.1_amd64.deb
tar xf data.tar.xz
sudo cp usr/lib/x86_64-linux-gnu/libcrypt.a /lib/
sudo chmod o+r /lib/libcrypt.a

or if you have access to debian system copy from there or use my libcrypt.a in ghost preset

@solcloud
Copy link
Owner

Thank you for raising issue. I remove my specific hack and now build_busybox.sh is much more cleaner. I also add note to readme that links to this issue.

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

2 participants