Giter VIP home page Giter VIP logo

Comments (6)

bioinfornatics avatar bioinfornatics commented on June 15, 2024

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-ld -o localization.so -L/usr/lib64/ -llphobos2 -lm -ldl -lrt localization.o  -soname=localization.so

llvm-ar exist too never used

from ldc.

bitraft avatar bitraft commented on June 15, 2024

Does this need druntime & rc lib building with PIC ?

from ldc.

bioinfornatics avatar bioinfornatics commented on June 15, 2024

you can try it is the better thing :-) .
What you want to do?

from ldc.

bioinfornatics avatar bioinfornatics commented on June 15, 2024

if is a lib you need use flag: -link-as-library

from ldc.

bioinfornatics avatar bioinfornatics commented on June 15, 2024

just for update this topic, for generate a shared lib with llvm-ld they are several step:
In first generate llvm bytecode with --output-bc flag

$ 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

from ldc.

dnadlinger avatar dnadlinger commented on June 15, 2024

LDC now has a -shared flag.

from ldc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.