conflicting declarations in output of C back end

I stumbled upon the following error:

psp-gcc -I. -I/home/kevin/Documents/School/Thesis/work/install/psptoolchain/psp/sdk/include
-Wall -O1 -G0 -ILIB_zlib -ILIB_libpng -D_PSP_FW_VERSION=150 -c -o
llvmoutput.o llvmoutput.c
llvmoutput.c:619: error: conflicting types for '_impure_ptr'
error: previous declaration of '_impure_ptr' was here

The declaration in sys/reent.h:

  extern struct _reent *_impure_ptr __ATTRIBUTE_IMPURE_PTR__;

And the one generated by the C back end:

  /* External Global Variable Declarations */
  extern struct l_struct_2E__reent *_impure_ptr;

So I guess somewhere in the compilation process the struct "_reent" is
renamed by LLVM but then conflicts with the original declaration?
The file "reent.h" got included indirectly by "alloca.h" and this is
probably not expected. How can I solve this problem?

Kevin André

The best way is to fix the CBE output to not #include alloca.h. There are #ifdefs that control how alloca is referenced.