I want to compile my C program with an another C library like dietlibc or musl.
What gcc option should I use for this purpose?
What gcc option should I use for this purpose?
You should read dietlibc or musl documentation. Example for dietlibc from here:
diet gcc -pipe -g -o t t.c
That is: dietlibc provides a wrapper command called diet which takes care of this for you.
Example for musl from here:
musl-gcc -static -Os hello.c
That is, musl provides a wrapper command called musl-gcc which takes care of this for you.
You can examine musl-gcc and diet to see exactly what options they pass the to the linker. Note however that the exact options may change from version to version, and you are better off always using the wrappers even if you know exactly which flags they pass.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With