Problem loading plugin dll into clang under Windows

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Problem loading plugin dll into clang under Windows

Sumner, Brian via cfe-dev
Hi,

I have developed a plugin for clang (latest version from svn). The
plugin (x64) loads and executes just fine with the clang I have build
from my svn tree. But when I try to load the plugin into the official
binary clang distribution (LLVM-4.0.1-win64) I'll get the error below.

I suspect that I have to link the dll with some special options. Is
there somewhere a description of the build environment for Visual Studio?

Btw: I am building the stuff with Visual Studio 2017 Enterprise.


"c:\Program Files\LLVM\bin\clang"  -fplugin=MyPlugin.dll  -c
d:\clang+llvm\tests\simple.c -o d:\clang+llvm\tests\simple.o

error: unable to load plugin 'MyPlugin.dll': 'MyPlugin.dll: Can't open:
Unknown error (0xC1)'

Thanks for your help

Marcel



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem loading plugin dll into clang under Windows

Sumner, Brian via cfe-dev
Error code 0xC1 appears to translate to: 

ERROR_BAD_EXE_FORMAT
193 (0xC1)

%1 is not a valid Win32 application

Maybe the clang binary is 32 bit after all? 

- Kim

Den 17 juli 2017 5:44 em skrev "Marcel Schaible via cfe-dev" <[hidden email]>:
Hi,

I have developed a plugin for clang (latest version from svn). The plugin (x64) loads and executes just fine with the clang I have build from my svn tree. But when I try to load the plugin into the official binary clang distribution (LLVM-4.0.1-win64) I'll get the error below.

I suspect that I have to link the dll with some special options. Is there somewhere a description of the build environment for Visual Studio?

Btw: I am building the stuff with Visual Studio 2017 Enterprise.


"c:\Program Files\LLVM\bin\clang"  -fplugin=MyPlugin.dll  -c d:\clang+llvm\tests\simple.c -o d:\clang+llvm\tests\simple.o

error: unable to load plugin 'MyPlugin.dll': 'MyPlugin.dll: Can't open: Unknown error (0xC1)'

Thanks for your help

Marcel



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev


_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Problem loading plugin dll into clang under Windows

Sumner, Brian via cfe-dev

Thanks Kim, for your help.

Unfortunately I have not found a solution. I have tried several combination (32/64bit) without success.

I suspect that the VS2017 build is not compatible with the latest greatest clang build.

If I find the culprit I'll post it here.

- Marcel


Am 26.07.2017 um 10:09 schrieb Kim Gräsman:
Error code 0xC1 appears to translate to: 

ERROR_BAD_EXE_FORMAT
193 (0xC1)

%1 is not a valid Win32 application

Maybe the clang binary is 32 bit after all? 

- Kim

Den 17 juli 2017 5:44 em skrev "Marcel Schaible via cfe-dev" <[hidden email]>:
Hi,

I have developed a plugin for clang (latest version from svn). The plugin (x64) loads and executes just fine with the clang I have build from my svn tree. But when I try to load the plugin into the official binary clang distribution (LLVM-4.0.1-win64) I'll get the error below.

I suspect that I have to link the dll with some special options. Is there somewhere a description of the build environment for Visual Studio?

Btw: I am building the stuff with Visual Studio 2017 Enterprise.


"c:\Program Files\LLVM\bin\clang"  -fplugin=MyPlugin.dll  -c d:\clang+llvm\tests\simple.c -o d:\clang+llvm\tests\simple.o

error: unable to load plugin 'MyPlugin.dll': 'MyPlugin.dll: Can't open: Unknown error (0xC1)'

Thanks for your help

Marcel



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev



_______________________________________________
cfe-dev mailing list
[hidden email]
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
Loading...