[LLVMdev] problem compiling the cfrontend on Linux/PPC
John Criswell
criswell at cs.uiuc.edu
Wed Jun 15 14:48:34 PDT 2005
Cyrille Mescam wrote:
>>Okay, I took a closer look at your output.
Please see below.
[snip]
> Now, it stoppes there:
>
> gmake[1]: Entering directory
> `/usr/local/home/cyrille/project/llvm/cfrontend/build/powerpc-unknown-linux-gnu/libiberty'
> if [ x"" != x ] && [ ! -d pic ]; then \
> mkdir pic; \
> else true; fi
> touch stamp-picdir
> CONFIG_FILES= CONFIG_HEADERS=config.h:config.in /bin/sh
> ./config.status
> config.status: creating config.h
> config.status: config.h is unchanged
> config.status: executing default commands
>
> --------------------------------
> .... (xgcc compilation with no error), then
> --------------------------------
>
> /usr/local/home/cyrille/project/llvm/cfrontend/build/gcc/xgcc
> -B/usr/local/home/cyrille/project/llvm/cfrontend/build/gcc/
> -B/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/bin/
> -B/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/lib/
> -isystem
> /usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/include
> -isystem
> /usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/sys-include
> -c -DHAVE_CONFIG_H -O2 -O2 -I. -I../../../src/libiberty/../include -W
> -Wall -Wtraditional -pedantic ../../../src/libiberty/cp-demangle.c -o
> cp-demangle.o
> Call parameter type does not match function signature!
> ubyte* getelementptr ([27 x ubyte]* %.str_247, int 0, int 0)
> sbyte* %tmp.51 = tail call uint %fwrite( ubyte* getelementptr ([27 x
> ubyte]* %.str_247, int 0, int 0), uint 26, uint 1, %struct._IO_FILE*
> %tmp.52 ) ; <uint> [#uses=0]
For some reason, this call to fwrite() is using a first parameter that
is a ubyte *. In the function declaration in the file that you sent me,
fwrite's first parameter is an sbyte *:
declare uint %fwrite(sbyte*,uint,uint,sbyte*) ;; __builtin_fwrite
Such a mismatch would cause the assertion that you've seen. The
assertion is correct; either the fwrite() declaration is wrong or the
instruction above should cast the ubyte * to an sbyte *.
I'd like to see what llvm-gcc is doing on your system with a smaller
program. Can you generate and send to the list the LLVM assembly for
the program below by doing the following:
/usr/local/home/cyrille/project/llvm/cfrontend/build/gcc/xgcc
-B/usr/local/home/cyrille/project/llvm/cfrontend/build/gcc/
-B/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/bin/
-B/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/lib/
-isystem
/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/include
-isystem
/usr/local/home/cyrille/project/llvm/cfrontend/install/powerpc-unknown-linux-gnu/sys-include
-S -DHAVE_CONFIG_H -O2 -O2 -I. -I../../../src/libiberty/../include -W
-Wall -Wtraditional -pedantic test.c -o
test.ll
... where test.c is:
#include <stdio.h>
void
function ()
{
char buffer[4];
FILE * f;
fwrite (buffer, 1, 1, f);
}
-- John T.
--
John T. Criswell
Research Programmer
University of Illinois at Urbana-Champaign
"It's today!" said Piglet. "My favorite day," said Pooh.
More information about the llvm-dev
mailing list