Notes on shared objects
This commit is contained in:
parent
14009e4198
commit
f9999eb490
15
docs/notes.md
Normal file
15
docs/notes.md
Normal file
@ -0,0 +1,15 @@
|
||||
# Shared Object C library
|
||||
|
||||
This worked to build a libc.so:
|
||||
|
||||
1. Remove `init.o` and `fini.o` from `libc.a`
|
||||
2. `i686-pc-toaru-gcc -shared -o libc.so -Wl,--whole-archive libc.a -Wl,--no-whole-archive`
|
||||
3. Remember to not attempt to build userspace like this!
|
||||
|
||||
To build a shared object:
|
||||
|
||||
i686-pc-toaru-gcc -shared -o libfoo.so foo.c
|
||||
|
||||
To build against a shared object in the local directory:
|
||||
|
||||
i686-pc-toaru-gcc -L`pwd` -o test test.c -lfoo
|
Loading…
Reference in New Issue
Block a user