Failed to compile with docker - Makefile recipe '"target/x86_64-unknown-redox"/release/libc.so' in relibc failed
-
I agree that I have searched opened and closed issues to prevent duplicates.
Description
Hi. It may be better that this issue is posted to relibc repository. However, this problem is caused by the way described this repository, so I posted this to here.
I thought docker's way commissions docker to build redox process and there is no way to issue errors.
However, it issue link error like undefined reference to 'main'
.
I don't know well about creating and liking libraries mechanisms, but this may be weird.
Environment info
- Operating system: macOS HighSierra 10.13.6
-
uname -a
:Darwin <machine-node-name> 17.7.0 Darwin Kernel Version 17.7.0: Wed Feb 27 00:43:23 PST 2019; root:xnu-4570.71.35~1/RELEASE_X86_64 x86_64
-
rustc -V
: dependent on docker -
git rev-parse HEAD
: dependent on docker
Steps to reproduce
I just followed the way of using docker.
git clone https://gitlab.redox-os.org/redox-os/redox.git
cd redox
git pull --rebase --recurse-submodules && git submodule sync \
&& git submodule update --recursive --init
docker run --privileged --cap-add MKNOD --cap-add SYS_ADMIN --device /dev/fuse \
-e LOCAL_UID="$(id -u)" -e LOCAL_GID="$(id -g)" \
-v redox-"$(id -u)-$(id -g)"-cargo:/usr/local/cargo \
-v redox-"$(id -u)-$(id -g)"-rustup:/usr/local/rustup \
-v "$(pwd):$(pwd)" -w "$(pwd)" --rm redoxos/redox make fetch all
Behavior
- Expected behavior:
No error issued and enter the next command(in Run the container interactively)
- Actual behavior:
output of command with docker is too long to paste all here. That is why I paste only crutial stdout I thought.
make
using Makefile in relibc issued following errors.
echo "create "target/x86_64-unknown-redox"/release/libc.a" > ""target/x86_64-unknown-redox"/release/libc.a.mri"
x86_64-unknown-redox-gcc -nostdlib -shared -Wl,--whole-archive "target/x86_64-unknown-redox"/release/librelibc.patched.a "target/x86_64-unknown-redox"/pthreads-emb/libpthread.a "target/x86_64-unknown-redox"/openlibm/libopenlibm.a -Wl,--no-whole-archive -o "target/x86_64-unknown-redox"/release/libc.so
for lib in "target/x86_64-unknown-redox"/release/librelibc.a "target/x86_64-unknown-redox"/pthreads-emb/libpthread.a "target/x86_64-unknown-redox"/openlibm/libopenlibm.a; do\
echo "addlib $lib" >> ""target/x86_64-unknown-redox"/release/libc.a.mri"; \
done
echo "save" >> ""target/x86_64-unknown-redox"/release/libc.a.mri"
echo "end" >> ""target/x86_64-unknown-redox"/release/libc.a.mri"
ar -M < ""target/x86_64-unknown-redox"/release/libc.a.mri"
ld --gc-sections "target/x86_64-unknown-redox"/release/ld_so.o "target/x86_64-unknown-redox"/release/crti.o "target/x86_64-unknown-redox"/release/libc.a "target/x86_64-unknown-redox"/release/crtn.o -o "target/x86_64-unknown-redox"/release/ld_so
/Users/onishi/Documents/M1/src/rust/redox/prefix/x86_64-unknown-redox/relibc-install.partial/bin/../lib/gcc/x86_64-unknown-redox/8.2.0/../../../../x86_64-unknown-redox/bin/ld: warning: cannot find entry symbol _start; defaulting to 0000000000400120
/Users/onishi/Documents/M1/src/rust/redox/prefix/x86_64-unknown-redox/relibc-install.partial/bin/../lib/gcc/x86_64-unknown-redox/8.2.0/../../../../x86_64-unknown-redox/bin/ld: target/x86_64-unknown-redox/release/librelibc.patched.a(relibc-803279224145098d.relibc.854uhtwu-cgu.15.rcgu.o): in function `exit':
relibc.854uhtwu-cgu.15:(.text.exit+0x1ed): undefined reference to `_fini'
/Users/onishi/Documents/M1/src/rust/redox/prefix/x86_64-unknown-redox/relibc-install.partial/bin/../lib/gcc/x86_64-unknown-redox/8.2.0/../../../../x86_64-unknown-redox/bin/ld: target/x86_64-unknown-redox/release/librelibc.patched.a(relibc-803279224145098d.relibc.854uhtwu-cgu.5.rcgu.o): in function `relibc_start':
relibc.854uhtwu-cgu.5:(.text.relibc_start+0x18c): undefined reference to `_init'
/Users/onishi/Documents/M1/src/rust/redox/prefix/x86_64-unknown-redox/relibc-install.partial/bin/../lib/gcc/x86_64-unknown-redox/8.2.0/../../../../x86_64-unknown-redox/bin/ld: relibc.854uhtwu-cgu.5:(.text.relibc_start+0x1bd): undefined reference to `main'
collect2: error: ld returned 1 exit status
Makefile:137: recipe for target '"target/x86_64-unknown-redox"/release/libc.so' failed
make[1]: Leaving directory '/Users/onishi/Documents/M1/src/rust/redox/relibc'
make[1]: *** ["target/x86_64-unknown-redox"/release/libc.so] Error 1
mk/prefix.mk:30: recipe for target 'prefix/x86_64-unknown-redox/relibc-install' failed
make: *** [prefix/x86_64-unknown-redox/relibc-install] Error 2
The ld command issued some errors like undefined reference to 'main'
, undefined reference to '_fini'
, etc...
I also realized that git log says that something that is relevant to ld_so
is edited. Personally, I thought this edit may cause this problem.
Thanks.