pspdev/psptoolchain — Issue #12: Error report of build pspdev/toolchain under Mac OSX
Author: wuxin
Created: 2011-10-28 00:52:26+00:00
State: open

Hi.

When I build pspdev toolchain under Mac OSX, got an error in step 7 with script 007-gdb-6.8.sh.

Script error is:
...
gcc -c -DHAVE_CONFIG_H -DPROFILE=1 -DWITH_PROFILE=-1 -DWITH_ALIGNMENT=NONSTRICT_ALIGNMENT -DWITH_TARGET_WORD_BITSIZE=32 -DWITH_TARGET_WORD_MSB=31 -DWITH_DEFAULT_TARGET_BYTE_ORDER=BIG_ENDIAN -DWITH_FLOATING_POINT=HARD_FLOATING_POINT -DWITH_TARGET_FLOATING_POINT_BITSIZE=32 -DWITH_HW=0 -DWITH_HOST_BYTE_ORDER=LITTLE_ENDIAN -DWITH_RESERVED_BITS=1 -DWITH_SMP=0 -Wimplicit -Wreturn-type -Wcomment -Wtrigraphs -Wformat -Wparentheses -Wpointer-arith -Wuninitialized -DMIPS_MACH_DEFAULT=bfd_mach_mips8000 -I. -I../../../sim/mips -I../common -I../../../sim/mips/../common -I../../include -I../../../sim/mips/../..//include -I../../bfd -I../../../sim/mips/../..//bfd -I../../opcodes -I../../../sim/mips/../..//opcodes -g -O2 ../../../sim/mips/interp.c
In file included from ../../../sim/mips/interp.c:67:
../../../sim/mips/../..//bfd/sysdep.h:135: error: expected declaration specifiers or ‘...’ before numeric constant
../../../sim/mips/../..//bfd/sysdep.h:135: error: expected ‘)’ before ‘!=’ token
../../../sim/mips/../..//bfd/sysdep.h:135: error: expected ‘)’ before ‘?’ token
gmake[3]: *** [interp.o] Error 1
gmake[3]: *** Waiting for unfinished jobs....
gmake[2]: *** [all] Error 1
gmake[1]: *** [all-sim] Error 2
make: *** [all] Error 2
../scripts/007-gdb-6.8.sh: Failed.

It look like redefine 'stpcpy()':
In file included from gdb-6.8/sim/mips/interp.c:67:
'stpcpy()' defined in ../../bfd/sysdep.h:135:
extern char *stpcpy (char *__dest, const char *__src);

In file included from ../../../sim/mips/interp.c:33:
In file included from ../../../sim/mips/sim-main.h:38:
In file included from ../../../sim/mips/../common/sim-basics.h:146:
In file included from ../../../sim/mips/../common/sim-arange.h:76:
In file included from ../../../sim/mips/../common/sim-arange.c:32:
In file included from /usr/include/string.h:148:
'stpcpy()' already defined in /usr/include/secure/_string.h:96:
#if !defined(_POSIX_C_SOURCE) || defined(_DARWIN_C_SOURCE)
#define stpcpy(dest, src) \
((__darwin_obsz0 (dest) != (size_t) -1) \
? __builtin___stpcpy_chk (dest, src, __darwin_obsz (dest)) \
: __inline_stpcpy_chk (dest, src))

When I define HAVE_DECL_STPCPY, build successes:
CFLAGS="-DHAVE_DECL_STPCPY"
export CFLAGS
./toolchain.sh 7

I suggest that need a patch to check 'stpcpy()', because OSX already defined it.