-
-
Notifications
You must be signed in to change notification settings - Fork 267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how create a shared library? #4
Comments
with gcc it works: $ gcc -Dlphobos2_EXPORTS -DDMDV2 -DIN_LLVM -D_DH -DOPAQUE_VTBLS -DPOSIX -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -fPIC -shared *.o -o liblocalization.so with llvm-ld
llvm-ar exist too never used |
Does this need druntime & rc lib building with PIC ? |
you can try it is the better thing :-) . |
if is a lib you need use flag: -link-as-library |
just for update this topic, for generate a shared lib with llvm-ld they are several step: $ ldc2 --output-bc --output-o -op -release -c -relocation-model=pic -od=../build *.d llvm bytecode finish with .bc and are in ../build directory $ cd ../build Merge llvm bytecode together in one $ lvm-ld -link-as-library -o libDparser.bc -L/usr/local/lib64/ -L/usr/lib64 -ldruntime-ldc -llphobos2 -lm -ldl -lrt -soname=Dparser *.bc run llc $ llc -relocation-model=pic libDparser.bc End the process by build shared lib $ gcc -shared libDparser.s -o libDparser.so |
LDC now has a |
The test checks the stack frame of `_Dmain` is in the backtrace, however if unused locals are optimised out and`test` is inlined into `main` ```d void test() { int innerLocal = 20; throw new Exception("foo"); } void main(string[] args) { string myLocal = "bar"; test(); } ``` then the point at which the untapped exception is thrown is at the start of D main - not somewhere in the middle of it - and so GDB prints ``` ... #4 D main (args=...) ``` rather than ``` ... #4 0xSOMEADDRESS in D main (args=...) ```
1/ build project with pic
They are some warning but no error (i do not know whet is the problem with)
2/ create a shared library
In which lib are define these thing?
2/ create a static lib is easy
thanks
The text was updated successfully, but these errors were encountered: