Created
January 28, 2018 23:11
-
-
Save Leandros/b646f11dd6150f5d0055f52c65c6b224 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ROOT=output | |
CC=x86_64-linux-musl-g++ | |
CFLAGS=" | |
-nostdinc | |
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0 | |
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/x86_64-linux-musl | |
-isystem $ROOT/x86_64-linux-musl/include/c++/7.2.0/backward | |
-isystem $ROOT/x86_64-linux-musl/include/ | |
-isystem $ROOT/lib/gcc/x86_64-linux-musl/7.2.0/include" | |
LDFLAGS=" | |
-nostdlib | |
-nodefaultlibs | |
-nostartfiles | |
-static | |
-L$ROOT/x86_64-linux-musl/lib | |
-L$ROOT/lib" | |
LIBS="-Wl,--start-group -lstdc++ -lc -lgcc -Wl,--end-group" | |
STARTFILES=" | |
$ROOT/x86_64-linux-musl/lib/crt1.o | |
$ROOT/x86_64-linux-musl/lib/crti.o | |
$ROOT/lib/gcc/x86_64-linux-musl/7.2.0/crtbegin.o" | |
ENDFILES=" | |
$ROOT/lib/gcc/x86_64-linux-musl/7.2.0/crtend.o | |
$ROOT/x86_64-linux-musl/lib/crtn.o" | |
$CC $CFLAGS -o foo.o -c foo.cpp | |
$CC $LDFLAGS -o foo $STARTFILES foo.o $ENDFILES $LIBS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment