On Sun, Oct 21, 2012 at 08:38:21AM -0700, Tobias Grosser
wrote:> On 10/20/2012 05:38 PM, Jack Howarth wrote:
>> Duncan,
>> Is the documentation for using Polly support in dragonegg correct?
I built llvm/polly/dragonegg
>> using the documentation at
http://polly.llvm.org/example_load_Polly_into_dragonegg.html
>> with...
>>
>> GCC=/sw/lib/gcc4.7/bin/gcc-4
LLVM_CONFIG=/sw/opt/llvm-3.2/bin/llvm-config ENABLE_LLVM_PLUGINS=1 make
CPPFLAGS="-DENABLE_LTO -I/sw/include"
>>
>> The resulting dragonegg plugin works fine as...
>>
>> /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3
himenoBMTxpa.c
>>
>> but if I try to invoke polly with...
>>
>> /sw/lib/gcc4.7/bin/gcc-4 -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3
-fplugin-arg-dragonegg-llvm-option=load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib
himenoBMTxpa.c
> >
>>
>> I get the error...
>>
>> cc1: Unknown command line argument
'load=/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'. Try: 'cc1 -help'
>
> I think the website is wrong. You probably need to add a '-' before
the
> 'load'. See the following:
>
>
"-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib"
>
> Please let me know if this works, such that I can update the website.
Tobias,
This solves the previous problem but exposes another...
[MacBookPro:~] howarth% /sw/lib/gcc4.7/bin/gcc-4
-fplugin=/sw/lib/gcc4.7/lib/dragonegg.so -O3
-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib
himenoBMTxpa.c -v
Using built-in specs.
COLLECT_GCC=/sw/lib/gcc4.7/bin/gcc-4
COLLECT_LTO_WRAPPER=/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/lto-wrapper
Target: x86_64-apple-darwin11.4.2
Configured with: ../gcc-4.7.2/configure --prefix=/sw --prefix=/sw/lib/gcc4.7
--mandir=/sw/share/man --infodir=/sw/lib/gcc4.7/info
--enable-languages=c,c++,fortran,lto,objc,obj-c++,java --with-gmp=/sw
--with-libiconv-prefix=/sw --with-ppl=/sw --with-cloog=/sw --with-mpc=/sw
--with-system-zlib --x-includes=/usr/X11R6/include --x-libraries=/usr/X11R6/lib
--program-suffix=-fsf-4.7 --enable-cloog-backend=isl
Thread model: posix
gcc version 4.7.2 (GCC)
COLLECT_GCC_OPTIONS='-mmacosx-version-min=10.7.4'
'-fplugin=/sw/lib/gcc4.7/lib/dragonegg.so' '-O3'
'-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib'
'-v' '-mtune=core2'
/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1 -quiet -v
-iplugindir=/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/plugin
-D__DYNAMIC__ himenoBMTxpa.c
-iplugindir=/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/plugin -fPIC
-quiet -dumpbase himenoBMTxpa.c -mmacosx-version-min=10.7.4 -mtune=core2
-auxbase himenoBMTxpa -O3 -version -fplugin=/sw/lib/gcc4.7/lib/dragonegg.so
-fplugin-arg-dragonegg-llvm-option=-load:/sw/opt/llvm-3.2/lib/LLVMPolly.dylib -o
/var/folders/1l/n78sywl52lz6kkys6nv7mnph0000gp/T//ccfQ1CgD.s
GNU C (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2svn
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory
"/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/../../../../x86_64-apple-darwin11.4.2/include"
#include "..." search starts here:
#include <...> search starts here:
/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include
/sw/lib/gcc4.7/include
/sw/lib/gcc4.7/lib/gcc/x86_64-apple-darwin11.4.2/4.7.2/include-fixed
/usr/include
/System/Library/Frameworks
/Library/Frameworks
End of search list.
GNU C (GCC) version 4.7.2 (x86_64-apple-darwin11.4.2)
compiled by GNU C version 4.7.2, GMP version 5.0.5, MPFR version 3.1.1, MPC
version 1.0.1
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Versions of loaded plugins:
dragonegg: 3.2svn
Compiler executable checksum: d413f6ce20b86abf66faf4823487889a
himenoBMTxpa.c: In function ‘main’:
himenoBMTxpa.c:79:5: warning: incompatible implicit declaration of built-in
function ‘strcpy’ [enabled by default]
himenoBMTxpa.c: In function ‘set_param’:
himenoBMTxpa.c:226:5: warning: incompatible implicit declaration of built-in
function ‘exit’ [enabled by default]
himenoBMTxpa.c: In function ‘newMat’:
himenoBMTxpa.c:239:5: warning: incompatible implicit declaration of built-in
function ‘malloc’ [enabled by default]
himenoBMTxpa.c: In function ‘clearMat’:
himenoBMTxpa.c:248:5: warning: incompatible implicit declaration of built-in
function ‘free’ [enabled by default]
dyld: lazy symbol binding failed: fast lazy bind offset out of range (39257,
max=7640) in image
/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
dyld: fast lazy bind offset out of range (39257, max=7640) in image
/sw/lib/gcc4.7/libexec/gcc/x86_64-apple-darwin11.4.2/4.7.2/cc1
gcc-4: internal compiler error: Trace/BPT trap: 5 (program cc1)
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
I'll open a bugzilla for this one.
Jack
>
>>
>> Clang gets a little further with...
>>
>> clang -Xclang -load -Xclang /sw/opt/llvm-3.2/lib/LLVMPolly.dylib -O3
-mllvm -polly himenoBMTxpa.c
>> error: unable to load plugin
'/sw/opt/llvm-3.2/lib/LLVMPolly.dylib':
'dlopen(/sw/opt/llvm-3.2/lib/LLVMPolly.dylib, 9): Symbol not found:
>> __ZN4llvm10DataLayout2IDE
>> Referenced from: /sw/opt/llvm-3.2/lib/LLVMPolly.dylib
>> Expected in: flat namespace
>> in /sw/opt/llvm-3.2/lib/LLVMPolly.dylib'
>> clang (LLVM option parsing): Unknown command line argument
'-polly'. Try: 'clang (LLVM option parsing) -help'
>> clang (LLVM option parsing): Did you mean '-help'?
>>
>> This is with llvm/clang/compiler-rt/polly/dragonegg all from svn
166382.
>
> As you realized yourself, Polly and clang need to be in sync. Otherwise
> incompatible symbols cause problems.
>
> Tobi