jimporter / bfg9000

bfg9000 - build file generator
https://jimporter.github.io/bfg9000
BSD 3-Clause "New" or "Revised" License
76 stars 21 forks source link

Add support for DLL module definitions. #109

Closed jmgao closed 5 years ago

jmgao commented 5 years ago

This is needed to export functions by ordinal, which is required to maintain ABI compatibility with existing DLLs. When linking with MSVC, you pass /DEF <foo.def>, and with the binutils linker, it looks like you just pass it as another input file.

(This is supported under meson as vs_module_defs.)

jimporter commented 5 years ago

As a hack, you should be able to do this now for binutils like so:

def_file = object_file('<path-to-def-file>')
shared_library('blah', files=['src1.c', 'src2.c', def_file], ...)