I want to compile and link this function
__attribute__((dllexport)) int __cdecl myAdd ( const int a, const int b )
into a myAdd.dll ( yes, a dynamic library ).
For that, I'm using the following commands:
clang-cc.exe -v -emit-llvm-bc -o myAdd.bc myAdd.c
llvm-ld.exe -native -link-as-library -o myAdd.dll myAdd.bc
but when I open the myAdll.dll with the Win32 Dependency Walker ( depends.exe ) it says it's not a valid DOS/Windows PE file...
What I'm doing wrong, pls? How can I use cland and LLVM to compile a .c into a Win32 DLL in a way that could be called after by other program using GetProcAddress()/C function pointer?