Skip to content

Instantly share code, notes, and snippets.

@menangen
Created September 8, 2020 16:26
Show Gist options
  • Select an option

  • Save menangen/e19a72b0fd090c551c2ac1c829a71de7 to your computer and use it in GitHub Desktop.

Select an option

Save menangen/e19a72b0fd090c551c2ac1c829a71de7 to your computer and use it in GitHub Desktop.
Musl static Hello-World
SYS=/root/src/musl/musl-1.2.1/build/root
MAIN=main.c
OBJ=hello.c.o
clang -std=c11 -nostdinc -nodefaultlibs --sysroot $SYS -isystem $SYS/include -c $MAIN -o $OBJ
# Musl configure for Slackware Linux:
# CC=/usr/bin/clang ../configure --prefix=root --disable-shared
#include <stdio.h>
int main() {
printf("Hello, musl!! ");
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment