Hi, I am using latest sources on GCC (gcc4.5_branch), LLVM and dragonegg. I am able to build all three bits though unsuccessfull in building. Already done obvious things - checked out the sources as per defined in "Getting the development version" on dragonegg.llvm.org - Modified the llvm-backend.cpp in dragonegg to make available the global plugin_is_GPL_compatible publically - exports.map do include the global symbol "plugin_is_GPL_compatible" and "plugin_init" My host system is CentOS-3.8 and I am building it for same operating system and intel machine. Can somebody please help me why GCC is not reconizing dragonegg.so as a legal plugin - as the requirement is symbol plugin_is_GPL_compatible should be able publically? Maybe I am missing something obvious. Please find below the different version & configuration and error which I am getting. Please let me know if I need to provide any further information. Thanks. Regards, Rehman GCC configuration & version --------------------------- $path_to/gcc-4.5.x/bin/gcc -v Using built-in specs. COLLECT_GCC=$path_to/gcc-4.5.x/bin/gcc COLLECT_LTO_WRAPPER=$path_to/gcc-4.5.x/bin/../libexec/gcc/x86_64-unknown-linux-gnu/4.5.2/lto-wrapper Target: x86_64-unknown-linux-gnu Configured with: ../gcc-4.5.x/configure --prefix=$path_to/gcc-4.5.x --enable-threads=posix --disable-checking --with-system-zlib --enable-__c xa_atexit --disable-libunwind-exceptions --enable-libgomp --enable-languages=c,c++ --with-mpc=$path_to_home/root/usr --with-mpfr=$path_to_home/root/usr - -with-gmp=$path_to_home/root/usr --enable-plugin --enable-lto --with-libelf=$path_to_home/root/usr Thread model: posix gcc version 4.5.2 20100819 (prerelease) (GCC) LLVM Config version ------------------- llvm-config --version 2.8svn CommandLine ------------ gcc hello.c -S -fplugin=./dragonegg.so -fplugin-arg-dragonegg-emit-ir Error cc1: fatal error: plugin ./dragonegg.so is not licensed under a GPL-compatible license ./dragonegg.so: undefined symbol: plugin_is_GPL_compatible compilation terminated. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100824/c570ed07/attachment.html>
Hi Rehman, does it work if you remove -fvisibility=hidden from these two lines in the Makefile: CFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cflags) -fvisibility=hidden CXXFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cxxflags) -fvisibility=hidden ?> - Modified the llvm-backend.cpp in dragonegg to make available the global > plugin_is_GPL_compatible publicallyWhat exactly did you change here? Ciao, Duncan.
>>Hi Rehman, does it work if you remove -fvisibility=hiddenfrom these two lines>>in the Makefile:>> CFLAGS+=-Wall$(shell $(LLVM_CONFIG) --cflags) -fvisibility=hidden>> CXXFLAGS+=-Wall$(shell $(LLVM_CONFIG) --cxxflags) -fvisibility=hidden>>?I tried it with clean build and yes it did work when I remove the -fvisibility=hidden option>> - Modified the llvm-backend.cpp in dragonegg to makeavailable the global>> plugin_is_GPL_compatible publically>>>>What exactly did you change here?GCC docs says that plugin_is_GPL_compatible need to be defined even if uninitialized so was trying to define this symbol by changing in llvm-backend.cpp: int plugin_is_GPL_compatible LLVM_GLOBAL_VISIBILITY; Cheers,Rehman -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100901/2f949c37/attachment.html>
Hi Rehman, if I understand right the plugin works fine if you compile it with -fvisibility=hidden, and replace LLVM_GLOBAL_VISIBILITY in llvm-backend.cpp with __attribute__ ((visibility("default"))). Since LLVM_GLOBAL_VISIBILITY is a macro that expands to __attribute__ ((visibility("default"))) if you are not on mingw32 or cygwin, and your gcc version is at least 4, that suggests that you are compiling the plugin with gcc 3.x. Is that right? Best wishes, Duncan.> > Hi Duncan, > > Thank you for further looking into it. > > Indeed I made changes as you described and I was able to build, run and compile > the my test program. > > Regards, > Rehman > > > Date: Wed, 1 Sep 2010 15:15:32 +0200 > > From: baldrick at free.fr > > To: rehman_saeed at live.com > > Subject: Re: [LLVMdev] dragonegg plugin invoking issue > > > > Hi Rehman, > > > > > >>Hi Rehman, does it work if you remove -fvisibility=hidden from these two > lines > > > > > > >>in the Makefile: > > > > > >> > CFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cflags) -fvisibility=hidden > > > > > >> > CXXFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cxxflags) -fvisibility=hidden > > > > > > >>? > > > > > > > > > I tried it with clean build and yes it did work when I remove the > > > -fvisibility=hidden option > > > > if you restore the -fvisibility=hidden option and replace LLVM_GLOBAL_VISIBILITY > > with __attribute__ ((visibility("default"))) everywhere in llvm-backend.cpp, > > does it work? > > > > Ciao, > > > > Duncan.
Hi Duncan, Thank you very much for looking into it. I used the command to build dragonegg GCC=4.5.x make and silently it was using system compiler which is yes 3.x.x I turned the command to explicitly use latest compiler GCC=4.5.x CC=4.5.x CXX=4.5.x make and the problem gone away. Regards, Rehman> Date: Thu, 9 Sep 2010 19:40:56 +0200 > From: baldrick at free.fr > To: rehman_saeed at live.com > CC: LLVMdev at cs.uiuc.edu > Subject: Re: [LLVMdev] dragonegg plugin invoking issue > > Hi Rehman, if I understand right the plugin works fine if you compile it with > -fvisibility=hidden, and replace LLVM_GLOBAL_VISIBILITY in llvm-backend.cpp > with __attribute__ ((visibility("default"))). Since LLVM_GLOBAL_VISIBILITY > is a macro that expands to __attribute__ ((visibility("default"))) if you > are not on mingw32 or cygwin, and your gcc version is at least 4, that > suggests that you are compiling the plugin with gcc 3.x. Is that right? > > Best wishes, > > Duncan. > > > > > Hi Duncan, > > > > Thank you for further looking into it. > > > > Indeed I made changes as you described and I was able to build, run and compile > > the my test program. > > > > Regards, > > Rehman > > > > > Date: Wed, 1 Sep 2010 15:15:32 +0200 > > > From: baldrick at free.fr > > > To: rehman_saeed at live.com > > > Subject: Re: [LLVMdev] dragonegg plugin invoking issue > > > > > > Hi Rehman, > > > > > > > >>Hi Rehman, does it work if you remove -fvisibility=hidden from these two > > lines > > > > > > > > >>in the Makefile: > > > > > > > >> > CFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cflags) -fvisibility=hidden > > > > > > > >> > CXXFLAGS+=-Wall $(shell $(LLVM_CONFIG) --cxxflags) -fvisibility=hidden > > > > > > > > >>? > > > > > > > > > > > > I tried it with clean build and yes it did work when I remove the > > > > -fvisibility=hidden option > > > > > > if you restore the -fvisibility=hidden option and replace LLVM_GLOBAL_VISIBILITY > > > with __attribute__ ((visibility("default"))) everywhere in llvm-backend.cpp, > > > does it work? > > > > > > Ciao, > > > > > > Duncan. >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20100914/9f31c1b7/attachment.html>