delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/25/11:15:29

From: neil AT robots DOT ox DOT ac DOT uk (Neil Townsend)
Newsgroups: comp.os.msdos.djgpp
Subject: Building a cross compiler
Date: Thu, 25 May 2000 12:13:07 GMT
Organization: Robotics Research Group, Engineering Science Dept, Oxford, UK.
Lines: 63
Message-ID: <2000May25.121307.17959@arragonrobots.ox.ac.uk>
References: <8dukn6$e96$1 AT nnrp1 DOT deja DOT com>
NNTP-Posting-Host: arragon.robots.ox.ac.uk
X-Trace: news.ox.ac.uk 959256790 27557 163.1.6.216 (25 May 2000 12:13:10 GMT)
X-Complaints-To: newsmaster AT ox DOT ac DOT uk
NNTP-Posting-Date: 25 May 2000 12:13:10 GMT
Originator: neil AT arragon
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

I am trying to build cross compiler to build djgpp to run on sunos (ie
to compile dos executables on a sun machine). I have sorted out the
changes in binutils and gcc since the cross makefile was written and
seem to have built binutils fine.

However, the gcc build fails as follows (including the command that fails):

[Begin quoted failure message]

for name in _muldi3 _divdi3 _moddi3 _udivdi3 _umoddi3 _negdi2 _lshrdi3_ashldi3 _ashrdi3 _ffsdi2 _udiv_w_sdiv _udivmoddi4 _cmpdi2 _ucmpdi2 _floatdidf _floatdisf _fixunsdfsi _fixunssfsi _fixunsdfdi _fixdfdi _fixunssfdi _fixsfdi _fixxfdi _fixunsxfdi _floatdixf _fixunsxfsi _fixtfdi _fixunstfdi _floatditf __gcc_bcmp _varargs __dummy _eprintf _bb _shtab _clear_cache _trampoline __main _exit _ctors _pure; \
do \
  echo ${name}; \
  /tmp/djgpp/cross/build-gcc/gcc/xgcc -B/tmp/djgpp/cross/build-gcc/gcc/ -B/users/neil/bli/sun4-sunos/i386-pc-msdosdjgpp/bin/ -I/users/neil/bli/sun4-sunos/i386-pc-msdosdjgpp/include -O2  -DCROSS_COMPILE -DIN_GCC   -DSVR4  -g -O2 -I./include   -g1  -DIN_LIBGCC2 -D__GCC_FLOAT_NOT_NEEDED   -I. -I../../gcc-2.95.2/gcc -I../.
./gcc-2.95.2/gcc/config -I../../gcc-2.95.2/gcc/../include -c -DL${name} \
       ../../gcc-2.95.2/gcc/libgcc2.c -o ${name}.o; \
  if [ $? -eq 0 ] ; then true; else exit 1; fi; \
  i386-pc-msdosdjgpp-ar rc tmplibgcc2.a ${name}.o; \
  rm -f ${name}.o; \
done
_muldi3
In file included from ../../gcc-2.95.2/gcc/libgcc2.c:48:
include/stddef.h:170: warning: redefinition of `size_t'
/users/neil/bli/sun4-sunos/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/stdlib.h:36: warning: `size_t' previously declared here
include/stddef.h:255: conflicting types for `wchar_t'
/users/neil/bli/sun4-sunos/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/stdlib.h:39: previous declaration of `wchar_t'
make[2]: *** [libgcc2.a] Error 1
make[2]: Leaving directory `/tmp/djgpp/cross/build-gcc/gcc'
make[1]: *** [all-gcc] Error 2
make[1]: Leaving directory `/tmp/djgpp/cross/build-gcc'

[End quoted failure message]

ie. There appears to be a conflict between the djgpp headers and the
stddef.h file generated by the gcc build process. It would be possible
to resolve this and complete the compilation by adding #define _SIZE_T
and #define _WCHAR_T at appropriate places in djgpp's stdlib.h. However,
if one does this one can compile 'hello world' with the resulting
compiler just fine. However, problems like this:

/users/neil/bli/sun4/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/../../../../i386-pc-msdosdjgpp/sys-include/go32.h:19: warning: redefinition of `size_t'
/users/neil/bli/sun4/lib/gcc-lib/i386-pc-msdosdjgpp/2.95.2/include/stddef.h:170: warning: `size_t' previously declared here

arise when using multiple system header files and repeated clashes
occur between DJGPP files and stddef.h

Any suggestions?

The configure command used (from the build directory) was:

../gcc-2.95.2/configure --prefix=${PREFIX} ${EXTRA} \
			--target=${TARGET} \
			--enable-languages=${LANGUAGES} \
			--with-headers=${DJGPP_HEADERS_IN_DIST} \
			--with-libs=${DJGPP_LIBS_IN_DIST} -v ; \
where the two DJGPP markers point to the place in the distribution
that the precompiled libraries and headers files are. The code finds
them (and copies them to their install places) just fine.

Thanks,

Neil
-- 
Neil Townsend   +44 (1865) 273121   neil AT robots DOT ox DOT ac DOT uk

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019