Advertisement
Guest User

Untitled

a guest
Sep 6th, 2012
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. $ cat libtest.c
  2. #include <stdio.h>
  3.  
  4. int test(void)
  5. {
  6. printf("hello from libtest!\n");
  7. return 0;
  8. }
  9.  
  10. $ cat test.c
  11. #include <stdio.h>
  12.  
  13. extern int test(void);
  14.  
  15. int main(void)
  16. {
  17. test();
  18. return 0;
  19. }
  20.  
  21. Build with
  22. ----------
  23. or1k-linux-clang -O2 -fPIC -c -S libtest.c -o libtest-or1k.s
  24. or1k-linux-as libtest-or1k.s -o libtest-or1k.o
  25. or1k-linux-ld -shared -soname libtest-or1k.so.1 -o libtest-or1k.so.1.0 libtest-or1k.o
  26. ln -sf libtest-or1k.so.1.0 libtest-or1k.so
  27. ln -sf libtest-or1k.so.1.0 libtest-or1k.so.1
  28. or1k-linux-clang -O2 -c test.c -o test-or1k.o
  29. 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