how to opt -load on cygwin

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

how to opt -load on cygwin

Sergey Yakoushkin-2
Hello everyone,

I'm trying to load and run a pass on Cygwin target:
opt -load=mypass.dll -mypass

There is an LLVM example - Hello, however lib/Transforms/Makefile says
# No support for plugins on windows targets
and then excludes Hello from build
ifeq ($(HOST_OS), $(filter $(HOST_OS), Cygwin MingW Minix))
  PARALLEL_DIRS := $(filter-out Hello, $(PARALLEL_DIRS))
endif

On the other hand, I found old suggestions to use

configure --enable-shared --disable-embed-stdcxx

and then link a pass to LLVM dynamic library, using the following Makefile for the pass:
...
LOADABLE_MODULE=1
include $(LEVEL)/Makefile.common
LIBS+=-Lpath-to-LLVM -lcygLLVM-3.4svn

I'm able to build the mypass.dll which is linked against cygLLVM-3.4svn.dll.

However, opt load still fails (has no effect).
Are opt plugins still supported for Cygwin target?

Kind Regards,
Sergey Yakushkin



_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to opt -load on cygwin

Duncan Sands
Hi Sergey,

 > However, opt load still fails (has no effect).

you also have to use -hello on the opt command line in order to actually
run the pass.

Ciao, Duncan.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Reply | Threaded
Open this post in threaded view
|

Re: how to opt -load on cygwin

Sergey Yakoushkin-2
Well, I was using command 'opt -load mypass.dll -mypass' with -mypass option enabling the pass.

The actual problem was in my system env, then configure script wasn't working and build used mix of Win/MinGW/Cygwin tools because of $PATH in wrong order in some cases.
I've fixed system PATHs and loading of shared libraries started working in opt.

BTW, I'm using poolalloc project on cygwin. Project Makefile disables shared library target on Cygwin and MinGW.
However, it seems to be working fine on Cygwin (maybe with a few minor fixes for certain gcc versions).

What was the reason to disable poolalloc for Cygwin?


On Wed, Jun 12, 2013 at 9:37 AM, Duncan Sands <[hidden email]> wrote:
Hi Sergey,


> However, opt load still fails (has no effect).

you also have to use -hello on the opt command line in order to actually
run the pass.

Ciao, Duncan.
_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev


_______________________________________________
LLVM Developers mailing list
[hidden email]         http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev