Archived
This forum has been archived. Please start a new discussion on GitHub.
Minor i386 fixes
Hi,
Here is a patch for some minor i386 fixes.
include/Ice/Config.h:
- removed check for i386.
- it is unnecessary because the header files protected in that block are present
on all architectures
include/IceUtil/Config.h:
- moved check for i386 around SIZEOF_WCHAR_T
- defining HAVE_READLINE should not be determined whether i386 is defined
or not
You are mixing up two things:
- definition of a platform such as Linux or FreeBSD
- definition of an architecture, such as i386, sparc, etc.
Both Linux and FreeBSD are capable of running on multiple architectures.
Thanks.
Here is a patch for some minor i386 fixes.
include/Ice/Config.h:
- removed check for i386.
- it is unnecessary because the header files protected in that block are present
on all architectures
include/IceUtil/Config.h:
- moved check for i386 around SIZEOF_WCHAR_T
- defining HAVE_READLINE should not be determined whether i386 is defined
or not
You are mixing up two things:
- definition of a platform such as Linux or FreeBSD
- definition of an architecture, such as i386, sparc, etc.
Both Linux and FreeBSD are capable of running on multiple architectures.
Thanks.
0
Comments
-
Also, in src/icecpp/
in the file src/icecpp/config.h at line 55, you should insert something like
#elif (defined(__sparc__) || defined(__sparc64__) || defined(__sparc_v9__))
# define WCHAR_TYPE_SIZE 4
at least, this is what you need for sparc+gcc, either linux/sparc or solaris/sparc.
I don't know about solaris/sparc+sun native compiler.0 -
Ferris,
If I do CC -v a.cc with the Sun compiler with this version of the compiler:
CC: Sun WorkShop 6 update 1 C++ 5.2 2000/09/11
This is what gets invoked:
===================================================================
/opt/SUNWspro6/bin/../WS6U1/bin/ccfe -y-o -ya.o -y-fbe -y/opt/SUNWspro6/bin/../WS6U1/bin/fbe -y-xarch=generic -y-verbose -O0 -ptf /tmp/01265%1.%2 -ptx /opt/SUNWspro6/bin/../WS6U1/bin/CC -ptk "-v -xs " -D__SunOS_5_6 -D__SUNPRO_CC=0x520 -Dunix -Dsun -Dsparc -D__sparc -D__unix -D__sun -D__BUILTIN_VA_ARG_INCR -D__SVR4 -D__SUNPRO_CC_COMPAT=5 -y-s -instlib=/opt/SUNWspro6/WS6U1/lib/libCstd.a -I/opt/SUNWspro6/WS6U1/include/CC/Cstd -I/opt/SUNWspro6/WS6U1/include/CC -I/opt/SUNWspro6/WS6U1/include/CC/rw7 -I/opt/SUNWspro6/WS6U1/include/cc -D__SUN_PREFETCH a.cc -s /tmp/ccfe.01265.0.s
rm /tmp/ccfe.01265.0.s
/opt/SUNWspro6/bin/../WS6U1/bin/CClink -ptk "-v -xs -xildoff " -ptx /opt/SUNWspro6/bin/../WS6U1/bin/CC a.o -o a.out
### CC: Note: LD_LIBRARY_PATH = /opt/ACE_wrappers/latest/ace:/usr/local/quo/home/gduzan/test/rh71/omni/lib/i586_linux_2.0_glibc2.1
### CC: Note: LD_RUN_PATH = (null)
### CC: Note: LD_OPTIONS = (null)
/usr/ccs/bin/ld -u __1cH__CimplKcplus_init6F_v_ -R/opt/SUNWspro6/lib/rw7:/opt/SUNWspro6/lib:/opt/SUNWspro/lib:/usr/ccs/lib:/usr/lib -o a.out /opt/SUNWspro6/WS6U1/lib/crti.o /opt/SUNWspro6/WS6U1/lib/crt1.o /opt/SUNWspro6/WS6U1/lib/values-xa.o -Y P,/opt/SUNWspro6/lib/rw7:/opt/SUNWspro6/lib:/opt/SUNWspro6/WS6U1/lib/rw7:/opt/SUNWspro6/WS6U1/lib:/usr/ccs/lib:/usr/lib /home/crodrigu/SunWS_cache/CC_obj_4/4DEFt4W9tB0o97_lSrDf.o a.o -lCstd -lCrun -lm -lw -lcx -lc /opt/SUNWspro6/WS6U1/lib/crtn.o >&/tmp/ld.01268.0.err
====================================================================
So I think checking for #if defined(__sparc) is what you want.0 -
Actually, you have to add that to the list, I guess, for the Sun compiler. Latest
gcc(=gcc3.2.1) on sparc/linux defines __sparc__ but not __sparc:
For the file c.c
#ifndef __sparc
#error no '__sparc'
#endif
you get:
ferris@lacewing:~/DOCS/LAW [247]% gcc -c -v c.c
Reading specs from /usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.1/specs
Configured with: /var/tmp/portage/gcc-3.2.1-r6/work/gcc-3.2.1/configure --prefix=/usr --bindir=/usr/sparc-unknown-linux-gnu/gcc-bin/3.2 --includedir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.1/include --datadir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2 --mandir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2/man --infodir=/usr/share/gcc-data/sparc-unknown-linux-gnu/3.2/info --enable-shared --host=sparc-unknown-linux-gnu --target=sparc-unknown-linux-gnu --with-system-zlib --enable-languages=c,c++,ada,f77,objc,java --enable-threads=posix --enable-long-long --disable-checking --enable-cstdio=stdio --enable-clocale=generic --enable-__cxa_atexit --enable-version-specific-runtime-libs --with-gxx-include-dir=/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.1/include/g++-v3 --with-local-prefix=/usr/local --enable-shared --disable-nls
Thread model: posix
gcc version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207)
/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.1/cc1 -lang-c -v -D__GNUC__=3 -D__GNUC_MINOR__=2 -D__GNUC_PATCHLEVEL__=1 -D__GXX_ABI_VERSION=102 -D__ELF__ -Dunix -D__sparc__ -D__gnu_linux__ -Dlinux -D__ELF__ -D__unix__ -D__sparc__ -D__gnu_linux__ -D__linux__ -D__unix -D__linux -Asystem=unix -Asystem=posix -D__NO_INLINE__ -D__STDC_HOSTED__=1 -D__GCC_NEW_VARARGS__ -Acpu=sparc -Amachine=sparc c.c -quiet -dumpbase c.c -version -o /tmp/cc6XYmZX.s
GNU CPP version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207) (cpplib) (sparc GNU/Linux with ELF)
GNU C version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207) (sparc-unknown-linux-gnu)
compiled by GNU C version 3.2.1 20021207 (Gentoo Linux 3.2.1-20021207).
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/lib/gcc-lib/sparc-unknown-linux-gnu/3.2.1/include
/usr/sparc-unknown-linux-gnu/include
/usr/include
End of search list.
c.c:2:2: #error no '__sparc'
So, no '__sparc'
Of course, for consistency, with gcc2.95.2 on Solaris, gcc gives you -D__sparc
I suppose
#if defined(sparc) || defined(__sparc) || defined(__sparc__)
would get everything...0