Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ cat libtest.c
- #include <stdio.h>
- int test(void)
- {
- printf("hello from libtest!\n");
- return 0;
- }
- $ cat test.c
- #include <stdio.h>
- extern int test(void);
- int main(void)
- {
- test();
- return 0;
- }
- Build with
- ----------
- or1k-linux-clang -O2 -fPIC -c -S libtest.c -o libtest-or1k.s
- or1k-linux-as libtest-or1k.s -o libtest-or1k.o
- or1k-linux-ld -shared -soname libtest-or1k.so.1 -o libtest-or1k.so.1.0 libtest-or1k.o
- ln -sf libtest-or1k.so.1.0 libtest-or1k.so
- ln -sf libtest-or1k.so.1.0 libtest-or1k.so.1
- or1k-linux-clang -O2 -c test.c -o test-or1k.o
- or1k-linux-clang -L./ --sysroot=/opt/or1k-toolchain-linux/or1k-linux/sys-root test-or1k.o -lpthread -ltest-or1k -o test-or1k
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement