gcc misses dependencies
There is a website on how to work around this bug: https://wiki.alpinelinux.org/wiki/GCC
It seems to me that this is a known issue, but no one bothered to fix it.
If there are use-cases to use gcc without any additional dependency, then maybe split gcc in gcc-minimal and gcc, which dependes on gcc-minimal. The current user experience is very bad. If I install gcc without errors, I shouldn't have to google on how to actually get gcc to work. Sorry for the rant, but this is really annoying.
What I did was, start from the docker image:
apk add gcc
echo "int main(){return 0;}
" > test.c
gcc test.c
which failed with:
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find Scrt1.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find crti.o: No such file or directory
/usr/lib/gcc/x86_64-alpine-linux-musl/9.2.0/../../../../x86_64-alpine-linux-musl/bin/ld: cannot find -lssp_nonshared
collect2: error: ld returned 1 exit status