dragonegg build failure

The new dragonegg 2.9 sources fail to build against either FSF gcc 4.5.2 or 4.5.3svn
(with the i386_static.diff patch applied) on x86_64-apple-darwin10. In both cases, the
build fails as...

GCC=/sw/lib/gcc4.5/bin/gcc-4 LLVM_CONFIG=/sw/bin/llvm-config make CPPFLAGS="-DENABLE_LTO -I/sw/include"
Compiling utils/TargetInfo.cpp
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
Linking TargetInfo
Compiling cache.c
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
Compiling Backend.cpp
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config.h:6,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:55:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/auto-host.h:39:1: warning: "DEFAULT_USE_CXA_ATEXIT" redefined
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:13,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/defaults.h:921:1: warning: this is the location of the previous definition
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:310:2: error: #error LLVM_TARGET_NAME macro not specified
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:4,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/options.h:414: error: expected unqualified-id before ')' token
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/options.h:582: error: expected unqualified-id before ')' token
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:7,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/i386/i386.h:445: error: 'tree' does not name a type
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/i386/i386.h:2252: error: 'rtx' does not name a type
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/i386/i386.h:2253: error: 'rtx' does not name a type
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/i386/i386.h:2352: error: expected unqualified-id before ')' token
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/i386/i386.h:2358: error: expected unqualified-id before ')' token
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:8,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/darwin.h:123: error: expected unqualified-id before ')' token
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:8,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/config/darwin.h:756: error: expected unqualified-id before ')' token
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/tm.h:17,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/insn-flags.h:2011: error: 'rtx' does not name a type
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/insn-flags.h:2012: error: 'rtx' does not name a type
....
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.5.0/4.5.2/plugin/include/toplev.h:155: error: conflicts with new declaration with 'C' linkage
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp: In function 'void llvm_start_unit(void*, void*)':
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:1574: error: 'debug_hooks' was not declared in this scope
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:1574: error: 'do_nothing_debug_hooks' was not declared in this scope
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp: In function 'void emit_functions(cgraph_node_set_def*)':
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:1932: warning: suggest a space before ';' or explicit braces around empty body in 'for' statement
make: *** [Backend.o] Error 1

Hi Jack,

    The new dragonegg 2.9 sources fail to build against either FSF gcc 4.5.2 or 4.5.3svn
(with the i386_static.diff patch applied) on x86_64-apple-darwin10. In both cases, the
build fails as...

what does the command
   ./TargetInfo -p
return (the TargetInfo program is created during the dragonegg build).
Some of your errors are consistent with this program failing to run.

Ciao, Duncan.

Hi Jack,

> The new dragonegg 2.9 sources fail to build against either FSF gcc 4.5.2 or 4.5.3svn
> (with the i386_static.diff patch applied) on x86_64-apple-darwin10. In both cases, the
> build fails as...

what does the command
   ./TargetInfo -p
return (the TargetInfo program is created during the dragonegg build).
Some of your errors are consistent with this program failing to run.

Duncan,
   Yes, the result from "./TargetInfo -p" is incorrect under darwin10...

x86

In FSF config.guess, we had to add...

    *:Darwin:*:*)
        UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
        case $UNAME_PROCESSOR in
            i386)
                eval $set_cc_for_build
                if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
                  if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
                      (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
                      grep IS_64BIT_ARCH >/dev/null
                  then
                      UNAME_PROCESSOR="x86_64"
                  fi
                fi ;;
            unknown) UNAME_PROCESSOR=powerpc ;;
        esac
        echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
        exit ;;

to make sure that the architecture was set to the default code generation
of the system compiler and not the default code architecture of the running
kernel.
             Jack

Hi Jack,

     The new dragonegg 2.9 sources fail to build against either FSF gcc 4.5.2 or 4.5.3svn
(with the i386_static.diff patch applied) on x86_64-apple-darwin10. In both cases, the
build fails as...

what does the command
    ./TargetInfo -p
return (the TargetInfo program is created during the dragonegg build).
Some of your errors are consistent with this program failing to run.

Duncan,
    Yes, the result from "./TargetInfo -p" is incorrect under darwin10...

x86

x86 is correct for both 32 bit and 64 bit machines from the x86 family. So are
you sure it is wrong? Anyway, what I don't understand is why LLVM_TARGET_NAME
is then undefined (see the #error from your log output) since it is defined in
x86/Target.h.

Ciao, Duncan.

Duncan,
    Also note that under darwin10, on a EMT64-capable hardware, I get...

./TargetInfo -t
x86_64-apple-darwin10.5.0

./TargetInfo -a
x86_64

./TargetInfo -p
x86

So it appears that TargetInfo needs to be called with -a and not -p on darwin10.
How can I effect this change in the dragonegg 2.9 sources?
          Jack

Hi Jack,

     Also note that under darwin10, on a EMT64-capable hardware, I get...

./TargetInfo -t
x86_64-apple-darwin10.5.0

./TargetInfo -a
x86_64

./TargetInfo -p
x86

So it appears that TargetInfo needs to be called with -a and not -p on darwin10.

no, it is correct. The -p option is used to determine which subdirectory of the
dragonegg source should be used when building for the target processor. x86 is
thus correct as it handles both x86-32 and x86-64.

Ciao, Duncan.

Duncan,
   Is there anything I can do to make the build more verbose so I can debug this?
                  Jack

    Is there anything I can do to make the build more verbose so I can debug this?

make VERBOSE=1

Duncan,
   Oddly this shows...

GCC=/sw/lib/gcc4.5/bin/gcc-4 LLVM_CONFIG=/sw/bin/llvm-config make VERBOSE=1 CPPFLAGS="-DENABLE_LTO -I/sw/include"
Compiling utils/TargetInfo.cpp
g++ -c -DTARGET_TRIPLE=\"x86_64-apple-darwin10.7.0\" \
  -DENABLE_LTO -I/sw/include -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"exported\" -DGCC_MAJOR=4 -DGCC_MINOR=5 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/ADT -I/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include -Wall -Wextra -fvisibility=hidden -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/utils/TargetInfo.cpp
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
Linking TargetInfo
g++ -o TargetInfo TargetInfo.o -lLLVMSupport \
  -L/sw/lib -lpthread -lm -L/sw/lib
Compiling cache.c
cc -c -DENABLE_LTO -I/sw/include -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"exported\" -DGCC_MAJOR=4 -DGCC_MINOR=5 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/ADT -I/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include -DTARGET_NAME=\"x86_64-apple-darwin10.7.0\" -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/x86 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/darwin -Wall -Wextra -fvisibility=hidden -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-common /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/cache.c
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
Compiling Backend.cpp
g++ -c -DENABLE_LTO -I/sw/include -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"exported\" -DGCC_MAJOR=4 -DGCC_MINOR=5 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/ADT -I/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include -DTARGET_NAME=\"x86_64-apple-darwin10.7.0\" -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/x86 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/darwin -Wall -Wextra -fvisibility=hidden -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp
<command-line>: warning: "__STDC_LIMIT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
<command-line>: warning: "__STDC_CONSTANT_MACROS" redefined
<command-line>: warning: this is the location of the previous definition
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/config.h:6,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:55:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/auto-host.h:39:1: warning: "DEFAULT_USE_CXA_ATEXIT" redefined
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/tm.h:13,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/defaults.h:921:1: warning: this is the location of the previous definition
/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:310:2: error: #error LLVM_TARGET_NAME macro not specified

Why isn't the compiler set in the GCC environmental being used? It first uses cc and then g++.
           Jack

Duncan,
   Manually setting CC/CXX causes /sw/lib/gcc4.5/bin/gcc-4 and /sw/lib/gcc4.5/bin/g++-4
to be used but doesn't eliminate the failure. I'll open a bugzilla against dragonegg
and attach the preprocessed source for the failing compilation.
            Jack

Duncan,
   If I manually pass LLVM_TARGET_NAME, the failure changes to...

GCC=/sw/lib/gcc4.5/bin/gcc-4 LLVM_CONFIG=/sw/bin/llvm-config make VERBOSE=1 CPPFLAGS="-DENABLE_LTO -DLLVM_TARGET_NAME=X86 -I/sw/include"
...
/sw/lib/gcc4.5/bin/g++-4 -c -DENABLE_LTO -DLLVM_TARGET_NAME=X86 -I/sw/include -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -MD -MP -DIN_GCC -DREVISION=\"exported\" -DGCC_MAJOR=4 -DGCC_MINOR=5 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/ADT -I/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include -DTARGET_NAME=\"x86_64-apple-darwin10.7.0\" -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/x86 -I/sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/darwin -Wall -Wextra -fvisibility=hidden -I/sw/include -D_DEBUG -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O3 -fno-exceptions -fno-rtti -fno-common -Woverloaded-virtual -Wcast-qual /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/config.h:6:0,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:55:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/auto-host.h:39:0: warning: "DEFAULT_USE_CXA_ATEXIT" redefined
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/defaults.h:921:0: note: this is the location of the previous definition
In file included from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/tm.h:4:0,
                 from /sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/Target.h:52,
                 from /sw/src/fink.build/dragonegg-gcc45-2.9-1/dragonegg-2.9/Backend.cpp:31:
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/options.h:414:13: error: expected unqualified-id before ')' token
/sw/lib/gcc4.5/lib/gcc/x86_64-apple-darwin10.7.0/4.5.3/plugin/include/options.h:582:13: error: expected unqualified-id before ')' token

I'll upload that compilation as preprocessed source as well to Bug 9656.
         Jack

Hi Jack,

Why isn't the compiler set in the GCC environmental being used? It first uses cc and then g++.

there is a priori no connection between the compiler used to build dragonegg,
and the compiler the dragonegg plugin will be loaded into. For example, if
you built gcc-4.5 as a cross compiler running on (say) powerpc and targeting
x86, then it you can't use it to build dragonegg (which needs to be built as
powerpc code, since it will run on a powerpc machine the same as the gcc-4.5),
but you can load dragonegg into it for generating x86 code.

GCC specifies the compiler the plugin will be loaded into. Use CC and CXX to
specify the compilers used to build dragonegg.

Ciao, Duncan.

hi,

The new dragonegg 2.9 sources fail to build against either FSF gcc 4.5.2 or 4.5.3svn
(with the i386_static.diff patch applied) on x86_64-apple-darwin10. In both cases, the
build fails as...

Dragonegg revision 129116 also fail on x86_64 linux, with gcc-4.5
revision 172158, i got:

/home/ether/sources/llvm/include/llvm/Target/TargetLowering.h:1567:
warning: unused parameter ‘VT2’
/home/ether/sources/llvm/include/llvm/Target/TargetLowering.h:1574:
warning: unused parameter ‘VT1’
/home/ether/sources/llvm/include/llvm/Target/TargetLowering.h:1574:
warning: unused parameter ‘VT2’
/home/ether/sources/llvm/include/llvm/Target/TargetLowering.h:1582:
warning: unused parameter ‘Imm’
In file included from
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/rtl.h:28,
                 from /home/ether/sources/dragonegg/Convert.cpp:57:
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:29:
error: expected ‘,’ or ‘...’ before ‘(’ token
make: *** [Convert.o] Error 1

best regards
ether

ps: i am trying to build dragonegg on gcc16 of gcc farm.

Hi ether,

In file included from
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/rtl.h:28,
                  from /home/ether/sources/dragonegg/Convert.cpp:57:
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:29:
error: expected ‘,’ or ‘...’ before ‘(’ token
make: *** [Convert.o] Error 1

and what is in
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h
at line 29?

ps: i am trying to build dragonegg on gcc16 of gcc farm.

One of the dragonegg buildbots runs on that machine, and works fine. That said,
it is running in a simulated 32 bit environment.

Hi ether, how did you build it exactly? I logged into gcc16 and tried to
reproduce. But I get

/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:28:17: error: mpc.h: No such file or directory
In file included from /home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/rtl.h:28,
                  from /home/baldrick/dragonegg-2.9/Convert.cpp:58:
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:29: error: expected ‘,’ or ‘...’ before ‘(’ token

Notice the line about the missing mpc.h. If I pass the path to mpc.h like this:

CPPFLAGS="-I/home/ether/local/include/" GCC=/home/ether/local/gcc-4.5/bin/gcc LLVM_CONFIG=/home/ether/build/llvm/bin/llvm-config make

then the errors go away. That said, it still doesn't compile because you seem
to have LLVM from svn installed not llvm-2.9, and dragonegg-2.9 needs to be
built against llvm-2.9.

Ciao, Duncan.

hi Duncan,

i install mpc-0.8.2 in /home/ether/local/, and gcc-4.5 is configure with:
$HOME/sources/gcc-4.5/configure --enable-plugin --enable-lto
--prefix=$HOME/local/gcc-4.5/ --enable-languages=c,c++
--disable-bootstrap --disable-multilib --with-mpc=$HOME/local
--with-libelf=$HOME/local

Hi ether, how did you build it exactly? I logged into gcc16 and tried to
reproduce. But I get

/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:28:17:
error: mpc.h: No such file or directory
In file included from
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/rtl.h:28,
from /home/baldrick/dragonegg-2.9/Convert.cpp:58:
/home/ether/local/gcc-4.5/lib/gcc/x86_64-unknown-linux-gnu/4.5.3/plugin/include/real.h:29:
error: expected ‘,’ or ‘...’ before ‘(’ token

Notice the line about the missing mpc.h. If I pass the path to mpc.h like this:

CPPFLAGS="-I/home/ether/local/include/" GCC=/home/ether/local/gcc-4.5/bin/gcc
LLVM_CONFIG=/home/ether/build/llvm/bin/llvm-config make

then the errors go away.

oh, i just reading the header, and also found it is some mpc stuffs.

That said, it still doesn't compile because you seem
to have LLVM from svn installed not llvm-2.9, and dragonegg-2.9 needs to be

yep, the dragonegg is also from svn

built against llvm-2.9.

ok

thanks very much for you help.

best regards
ether

Hi ether,

i install mpc-0.8.2 in /home/ether/local/, and gcc-4.5 is configure with:
$HOME/sources/gcc-4.5/configure --enable-plugin --enable-lto
--prefix=$HOME/local/gcc-4.5/ --enable-languages=c,c++
--disable-bootstrap --disable-multilib --with-mpc=$HOME/local
--with-libelf=$HOME/local

because GCC headers include mpc.h, when dragonegg uses GCC headers then it needs
to be able to find mpc.h too. You can pass it that info using CFLAGS as I
showed. If you do that, does it build?

Ciao, Duncan.

hi Duncan,

Hi ether,

i install mpc-0.8.2 in /home/ether/local/, and gcc-4.5 is configure with:
$HOME/sources/gcc-4.5/configure --enable-plugin --enable-lto
--prefix=$HOME/local/gcc-4.5/ --enable-languages=c,c++
--disable-bootstrap --disable-multilib --with-mpc=$HOME/local
--with-libelf=$HOME/local

because GCC headers include mpc.h, when dragonegg uses GCC headers then it
needs
to be able to find mpc.h too. You can pass it that info using CFLAGS as I
showed. If you do that, does it build?

Yes, i got dragonegg.so now.

best regards
ether

hi Duncan,

That said, it still doesn't compile because you seem
to have LLVM from svn installed not llvm-2.9, and dragonegg-2.9 needs to
be

yep, the dragonegg is also from svn

when i try:
/home/ether/local/gcc-4.5/bin/gcc -S -O1 -o -
-fplugin=$HOME/sources/dragonegg/dragonegg.so
-fplugin-arg-dragonegg-emit-ir $HOME/sources/hello.c 2>&1 | c++filt
i get:
cc1: error: Cannot load plugin /home/ether/sources/dragonegg/dragonegg.so
/home/ether/sources/dragonegg/dragonegg.so: undefined symbol:
llvm::StructType::get(llvm::LLVMContext&, llvm::ArrayRef<llvm::Type
const*>, bool)

So this means dragonegg-svn do not work with llvm-svn?

best regards
ether

Hi ether,

So this means dragonegg-svn do not work with llvm-svn?

it does work, since otherwise the dragonegg buildbots would be
broken. What doesn't work is using dragonegg-2.9 with llvm-svn
or dragonegg-svn with llvm-2.9.

Ciao, Duncan.