473,753 Members | 7,291 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Is this code in gcc 4.3.1 valid C or is Sun compiler wrong ??

I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU
compilers. I then decided to try to use Sun's compiler. The Sun Studio
12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
I'm inclined to agree, as it is like no C I have ever met.
what is "C_COMMON_FIXED _TYPES (, fract);" supposed to mean? Could it be
written in a different way so the Sun compiler could understand it? Or
are Sun at fault?
I'd certainly never write C code like this, but perhaps it is legal.

#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);


So is this really C, or is it just a GNU ism, which prevents the GNU C
compiler compiling with a compiler able to compiler C ?? I thought one
was supposed to need a C compiler to compile gcc, but perhaps I was
mistaken.

cc -c -g -DIN_GCC -DHAVE_CONFIG_H -I. -I. -I../../gcc-4.3.1/gcc
-I../../gcc-4.3.1/gcc/. -I../../gcc-4.3.1/gcc/../include -I./../intl
-I../../gcc-4.3.1/gcc/../libcpp/include -I/usr/local/include
-I/usr/local/include -I/usr/local/include
-I../../gcc-4.3.1/gcc/../libdecnumber
-I../../gcc-4.3.1/gcc/../libdecnumber/dpd -I../libdecnumber
.../../gcc-4.3.1/gcc/c-common.c -o c-common.o
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_no...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: syntax error before or at: ||
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ frac...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
unsigned_short_ frac...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token:
short_fract_typ e_no...
"../../gcc-4.3.1/gcc/c-common.c", line 2254: invalid token: fract_type_node

Jun 27 '08
27 3072
Dave wrote:
Thad Smith wrote:
>Dave wrote:
>>I'm having a hard time tying to build gcc 4.3.1 on Solaris using the
GNU compilers. I then decided to try to use Sun's compiler. The Sun
Studio 12 compiler reports the following code, which is in the source
(gcc-4.3.1/gcc/c-common.c) of gcc 4.3.1, is a syntax error.
>>#define C_COMMON_FIXED_ MODE_TYPES(SAT, NAME) \
if (type1 == SAT ## NAME ## _type_node \
|| type1 == SAT ## u ## NAME ## _type_node) \
return unsignedp ? SAT ## u ## NAME ## _type_node \
: SAT ## NAME ## _type_node;

C_COMMON_FIXED_ TYPES (, fract); /* line 2254 */
C_COMMON_FIXED_ TYPES (sat_, fract);
C_COMMON_FIXED_ TYPES (, accum);
C_COMMON_FIXED_ TYPES (sat_, accum);

The code invokes the macro with a missing first argument. That is
valid C99, but undefined in C90 (see the recent CLC thread on "empty
macro arguments").

It seems amazing that GCC would require C99 features to compile.


Thank you for clearing that up. You would think they have more sence
than to do

IMHO, the gcc developers could do a lot worst than to stop adding
features and sort out why it builds so badly on many platforms - Solaris
is not the only one to have issues with gcc.
Sun cc is a C99 compiler (you can try using it in C99 mode by using the
c99 rather than cc driver).

--
Ian Collins.
Jun 27 '08 #11
In gnu.gcc.help Andrew Haley <an******@littl epinkcloud.inva lidwrote:
In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:
>The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments").

Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.
I have fixed it, and I have added a warning to gcc so that
if anyone ever uses empty macro arguments in the gcc source
the build will abort, even when building with gcc.

Andrew.
Jul 9 '08 #12
Andrew Haley wrote:
In gnu.gcc.help Andrew Haley <an******@littl epinkcloud.inva lidwrote:
>In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:
>>The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments") .
Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.

I have fixed it, and I have added a warning to gcc so that
if anyone ever uses empty macro arguments in the gcc source
the build will abort, even when building with gcc.

Andrew.

It's good to hear it is fixed, but there seems to be an overall problem
with gcc in that features are added, but it is difficult to build on
non-Linux systems. Building on SPARC is no easy task, with one having to
go to great lengths to find the right version of gcc to build it with
(Sun's compilers are incapable of building gcc).

Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware) don't regularly update gcc like they do other programs. It
must seems too difficult/problematic to build, so people don't bother.

Just me 2p worth
Jul 9 '08 #13
In gnu.gcc.help Dave <fo*@coo.comwro te:
Andrew Haley wrote:
>In gnu.gcc.help Andrew Haley <an******@littl epinkcloud.inva lidwrote:
>>In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:

The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments" ).
Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.

I have fixed it, and I have added a warning to gcc so that
if anyone ever uses empty macro arguments in the gcc source
the build will abort, even when building with gcc.

It's good to hear it is fixed, but there seems to be an overall
problem with gcc in that features are added, but it is difficult to
build on non-Linux systems. Building on SPARC is no easy task, with
one having to go to great lengths to find the right version of gcc
to build it with (Sun's compilers are incapable of building gcc).
Well, that's bad. Our official position is that gcc needs an ISO-C89
compiler to build, and any use of language extensions to C89 in gcc
sources is a bug.

For any problem bootstrapping gcc with Sun's compilers the question is
whether Sun's tools are deficient in some way or gcc is incorrect. In
this particular case there wasn't any question, so I fixed gcc.
Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware) don't regularly update gcc like they do other
programs. It must seems too difficult/problematic to build, so
people don't bother.
We want people to be able to build gcc on their systems. However some
ports are unmaintained simply because no gcc maintainer uses them.
The only way we can fix that is to ask people who do use these systems
to help us.

Andrew.
Jul 10 '08 #14
Andrew Haley wrote:
In gnu.gcc.help Dave <fo*@coo.comwro te:
>Andrew Haley wrote:
>>In gnu.gcc.help Andrew Haley <an******@littl epinkcloud.inva lidwrote:
In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:

The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments") .
Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.
I have fixed it, and I have added a warning to gcc so that
if anyone ever uses empty macro arguments in the gcc source
the build will abort, even when building with gcc.
It's good to hear it is fixed, but there seems to be an overall
problem with gcc in that features are added, but it is difficult to
build on non-Linux systems. Building on SPARC is no easy task, with
one having to go to great lengths to find the right version of gcc
to build it with (Sun's compilers are incapable of building gcc).

Well, that's bad. Our official position is that gcc needs an ISO-C89
compiler to build, and any use of language extensions to C89 in gcc
sources is a bug.

For any problem bootstrapping gcc with Sun's compilers the question is
whether Sun's tools are deficient in some way or gcc is incorrect. In
this particular case there wasn't any question, so I fixed gcc.
>Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware) don't regularly update gcc like they do other
programs. It must seems too difficult/problematic to build, so
people don't bother.

We want people to be able to build gcc on their systems. However some
ports are unmaintained simply because no gcc maintainer uses them.
The only way we can fix that is to ask people who do use these systems
to help us.

If 4.2 isn't too old to your taste there's a pretty descent one here:
http://cooltools.sunsource.net/gcc/
Jul 10 '08 #15
Andrew Haley wrote:
Well, that's bad. Our official position is that gcc needs an ISO-C89
compiler to build, and any use of language extensions to C89 in gcc
sources is a bug.

For any problem bootstrapping gcc with Sun's compilers the question is
whether Sun's tools are deficient in some way or gcc is incorrect. In
this particular case there wasn't any question, so I fixed gcc.
>Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware) don't regularly update gcc like they do other
programs. It must seems too difficult/problematic to build, so
people don't bother.

We want people to be able to build gcc on their systems. However some
ports are unmaintained simply because no gcc maintainer uses them.
The only way we can fix that is to ask people who do use these systems
to help us.

Andrew.

I've reported bugs before, but nothing seems to happen. As it gets more
and more difficult to build, which it seems to do with every version,
you are less and less likely to find anyone willing to help maintain it.

If you have someone willing, I don't mind giving someone access to a Sun
Ultra 60 via SSH.

It's a real pain to try to find a compiler and set of options for gcc's
configure script which work.

For example, lets try 4.3.1 with no options to configure and see how far
it gets:

gcc used to pick up header files in /usr/local/include, so I would
expect it to find /usr/local/include/mpfr.h, which does exist, is the
only one around, and a late enough version.
$ grep VERSION_STRING /usr/local/include/mpfr.h
#define MPFR_VERSION_ST RING "2.3.1"

But how wrong that assumption is....

$ ../gcc-4.3.1/configure
checking build system type... sparc-sun-solaris2.10
checking host system type... sparc-sun-solaris2.10
checking target system type... sparc-sun-solaris2.10
checking for a BSD-compatible install... ../gcc-4.3.1/install-sh -c
checking whether ln works... yes
checking whether ln -s works... yes
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for gnatbind... no
checking for gnatmake... no
checking whether compiler driver understands Ada... no
checking how to compare bootstrapped objects... cmp $$f1 $$f2 16 16
checking for correct version of gmp.h... yes
checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
As you can see, it does not get too far. Messing around with almost
endless options to configure, and endless versions of gcc, one might get
it to build. But its far from straightforward .
The latest gcc I've managed to build is 4.2.0 and that did not work too
well.
I've stuck config.log below from my attempt at 4.3.1, just for your
interest.
Dave

-----------
$ more config.log
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by configure, which was
generated by GNU Autoconf 2.59. Invocation command line was

$ ../gcc-4.3.1/configure

## --------- ##
## Platform. ##
## --------- ##

hostname = kestrel
uname -m = sun4u
uname -r = 5.10
uname -s = SunOS
uname -v = Generic_137111-01

/usr/bin/uname -p = sparc
/bin/uname -X = System = SunOS
Node = kestrel
Release = 5.10
KernelID = Generic_137111-01
Machine = sun4u
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 2

/bin/arch = sun4
/usr/bin/arch -k = sun4u
/usr/convex/getsysinfo = unknown
hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown

PATH: /usr/bin
PATH: /usr/openwin/bin
PATH: /usr/ucb
PATH: /opt/csw/bin
PATH: /opt/csw/gcc3/bin
PATH: /usr/local/bin
PATH: /usr/ccs/bin
PATH: /usr/sbin
PATH: .
PATH: /opt/csw/bin
PATH: /opt/csw/gcc4/bin
PATH: /usr/local/bin
PATH: /usr/ccs/bin
PATH: /opt/SUNWspci3/bin
PATH: .
## ----------- ##
## Core tests. ##
## ----------- ##

configure:1505: checking build system type
configure:1523: result: sparc-sun-solaris2.10
configure:1558: checking host system type
configure:1572: result: sparc-sun-solaris2.10
configure:1580: checking target system type
configure:1594: result: sparc-sun-solaris2.10
configure:1637: checking for a BSD-compatible install
configure:1692: result: ../gcc-4.3.1/install-sh -c
configure:1703: checking whether ln works
configure:1725: result: yes
configure:1729: checking whether ln -s works
configure:1733: result: yes
configure:2885: checking for gcc
configure:2901: found /opt/csw/gcc3/bin/gcc
configure:2911: result: gcc
configure:3155: checking for C compiler version
configure:3158: gcc --version </dev/null >&5
gcc (GCC) 3.4.5
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3161: $? = 0
configure:3163: gcc -v </dev/null >&5
Reading specs from /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.5/specs
Configured with: ../sources/gcc-3.4.5/configure --prefix=/opt/csw/gcc3
--with-local-prefix=/opt/csw --without-gnu-as --with-as=/usr/ccs/bin/as
--without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix
--enable-shared --enable-multilib --enable-nls --with-included-gettext
--with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib
--enable-languages=all
Thread model: posix
gcc version 3.4.5
configure:3166: $? = 0
configure:3168: gcc -V </dev/null >&5
gcc: `-V' option must have argument
configure:3171: $? = 1
configure:3194: checking for C compiler default output file name
configure:3197: gcc conftest.c >&5
configure:3200: $? = 0
configure:3246: result: a.out
configure:3251: checking whether the C compiler works
configure:3257: ./a.out
configure:3260: $? = 0
configure:3277: result: yes
configure:3284: checking whether we are cross compiling
configure:3286: result: no
configure:3289: checking for suffix of executables
configure:3291: gcc -o conftest conftest.c >&5
configure:3294: $? = 0
configure:3319: result:
configure:3325: checking for suffix of object files
configure:3346: gcc -c conftest.c >&5
configure:3349: $? = 0
configure:3371: result: o
configure:3375: checking whether we are using the GNU C compiler
configure:3399: gcc -c conftest.c >&5
configure:3405: $? = 0
configure:3409: test -z
|| test ! -s conftest.err
configure:3412: $? = 0
configure:3415: test -s conftest.o
configure:3418: $? = 0
configure:3431: result: yes
configure:3437: checking whether gcc accepts -g
configure:3458: gcc -c -g conftest.c >&5
configure:3464: $? = 0
configure:3468: test -z
|| test ! -s conftest.err
configure:3471: $? = 0
configure:3474: test -s conftest.o
configure:3477: $? = 0
configure:3488: result: yes
configure:3505: checking for gcc option to accept ANSI C
configure:3575: gcc -c -g -O2 conftest.c >&5
configure:3581: $? = 0
configure:3585: test -z
|| test ! -s conftest.err
configure:3588: $? = 0
configure:3591: test -s conftest.o
configure:3594: $? = 0
configure:3612: result: none needed
configure:3630: gcc -c -g -O2 conftest.c >&5
conftest.c:2: error: syntax error before "me"
configure:3636: $? = 1
configure: failed program was:
| #ifndef __cplusplus
| choke me
| #endif
configure:3821: checking for g++
configure:3837: found /opt/csw/gcc3/bin/g++
configure:3847: result: g++
configure:3863: checking for C++ compiler version
configure:3866: g++ --version </dev/null >&5
g++ (GCC) 3.4.5
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

configure:3869: $? = 0
configure:3871: g++ -v </dev/null >&5
Reading specs from /opt/csw/gcc3/lib/gcc/sparc-sun-solaris2.8/3.4.5/specs
Configured with: ../sources/gcc-3.4.5/configure --prefix=/opt/csw/gcc3
--with-local-prefix=/opt/csw --without-gnu-as --with-as=/usr/ccs/bin/as
--without-gnu-ld --with-ld=/usr/ccs/bin/ld --enable-threads=posix
--enable-shared --enable-multilib --enable-nls --with-included-gettext
--with-libiconv-prefix=/opt/csw --with-x --enable-java-awt=xlib
--enable-languages=all
Thread model: posix
gcc version 3.4.5
configure:3874: $? = 0
configure:3876: g++ -V </dev/null >&5
g++: `-V' option must have argument
configure:3879: $? = 1
configure:3882: checking whether we are using the GNU C++ compiler
configure:3906: g++ -c conftest.cc >&5
configure:3912: $? = 0
configure:3916: test -z
|| test ! -s conftest.err
configure:3919: $? = 0
configure:3922: test -s conftest.o
configure:3925: $? = 0
configure:3938: result: yes
configure:3944: checking whether g++ accepts -g
configure:3965: g++ -c -g conftest.cc >&5
configure:3971: $? = 0
configure:3975: test -z
|| test ! -s conftest.err
configure:3978: $? = 0
configure:3981: test -s conftest.o
configure:3984: $? = 0
configure:3995: result: yes
configure:4037: g++ -c -g -O2 conftest.cc >&5
configure:4043: $? = 0
configure:4047: test -z
|| test ! -s conftest.err
configure:4050: $? = 0
configure:4053: test -s conftest.o
configure:4056: $? = 0
configure:4082: g++ -c -g -O2 conftest.cc >&5
conftest.cc: In function `int main()':
conftest.cc:13: error: `exit' was not declared in this scope
configure:4088: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPO RT ""
| /* end confdefs.h. */
|
| int
| main ()
| {
| exit (42);
| ;
| return 0;
| }
configure:4037: g++ -c -g -O2 conftest.cc >&5
configure:4043: $? = 0
configure:4047: test -z
|| test ! -s conftest.err
configure:4050: $? = 0
configure:4053: test -s conftest.o
configure:4056: $? = 0
configure:4082: g++ -c -g -O2 conftest.cc >&5
configure:4088: $? = 0
configure:4092: test -z
|| test ! -s conftest.err
configure:4095: $? = 0
configure:4098: test -s conftest.o
configure:4101: $? = 0
configure:4188: checking for gnatbind
configure:4215: result: no
configure:4268: checking for gnatmake
configure:4295: result: no
configure:4307: checking whether compiler driver understands Ada
configure:4330: result: no
configure:4339: checking how to compare bootstrapped objects
configure:4364: result: cmp $$f1 $$f2 16 16
configure:4484: checking for correct version of gmp.h
configure:4507: gcc -c -g -O2 conftest.c >&5
configure:4513: $? = 0
configure:4517: test -z
|| test ! -s conftest.err
configure:4520: $? = 0
configure:4523: test -s conftest.o
configure:4526: $? = 0
configure:4528: result: yes
configure:4542: checking for correct version of mpfr.h
configure:4573: gcc -o conftest -g -O2 conftest.c -lmpfr -lgmp >&5
conftest.c:13:2 2: mpfr.h: No such file or directory
conftest.c:18:4 0: missing binary operator before token "("
conftest.c: In function `main':
conftest.c:21: error: `mpfr_t' undeclared (first use in this function)
conftest.c:21: error: (Each undeclared identifier is reported only once
conftest.c:21: error: for each function it appears in.)
conftest.c:21: error: syntax error before "n"
conftest.c:24: error: `n' undeclared (first use in this function)
conftest.c:25: error: `x' undeclared (first use in this function)
conftest.c:26: error: `GMP_RNDN' undeclared (first use in this function)
configure:4579: $? = 1
configure: failed program was:
| /* confdefs.h. */
|
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPO RT ""
| #ifdef __cplusplus
| extern "C" void std::exit (int) throw (); using std::exit;
| #endif
| /* end confdefs.h. */
| #include <gmp.h>
| #include <mpfr.h>
| int
| main ()
| {
|
| #if MPFR_VERSION < MPFR_VERSION_NU M(2,2,1)
| choke me
| #endif
| mpfr_t n;
| mpfr_t x;
| int t;
| mpfr_init (n);
| mpfr_init (x);
| mpfr_atan2 (n, n, x, GMP_RNDN);
| mpfr_erfc (n, x, GMP_RNDN);
| mpfr_subnormali ze (x, t, GMP_RNDN);
|
| ;
| return 0;
| }
configure:4652: result: no
configure:4669: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.

## ---------------- ##
## Cache variables. ##
## ---------------- ##

ac_cv_build=spa rc-sun-solaris2.10
ac_cv_build_ali as=sparc-sun-solaris2.10
ac_cv_c_compile r_gnu=yes
ac_cv_cxx_compi ler_gnu=yes
ac_cv_env_AR_FO R_TARGET_set=
ac_cv_env_AR_FO R_TARGET_value=
ac_cv_env_AR_se t=
ac_cv_env_AR_va lue=
ac_cv_env_AS_FO R_TARGET_set=
ac_cv_env_AS_FO R_TARGET_value=
ac_cv_env_AS_se t=
ac_cv_env_AS_va lue=
ac_cv_env_CC_FO R_TARGET_set=
ac_cv_env_CC_FO R_TARGET_value=
ac_cv_env_CC_se t=
ac_cv_env_CC_va lue=
ac_cv_env_CFLAG S_set=
ac_cv_env_CFLAG S_value=
ac_cv_env_CPPFL AGS_set=
ac_cv_env_CPPFL AGS_value=
ac_cv_env_CXXFL AGS_set=
ac_cv_env_CXXFL AGS_value=
ac_cv_env_CXX_F OR_TARGET_set=
ac_cv_env_CXX_F OR_TARGET_value =
ac_cv_env_CXX_s et=
ac_cv_env_CXX_v alue=
ac_cv_env_DLLTO OL_FOR_TARGET_s et=
ac_cv_env_DLLTO OL_FOR_TARGET_v alue=
ac_cv_env_DLLTO OL_set=
ac_cv_env_DLLTO OL_value=
ac_cv_env_GCC_F OR_TARGET_set=
ac_cv_env_GCC_F OR_TARGET_value =
ac_cv_env_GCJ_F OR_TARGET_set=
ac_cv_env_GCJ_F OR_TARGET_value =
ac_cv_env_GFORT RAN_FOR_TARGET_ set=
ac_cv_env_GFORT RAN_FOR_TARGET_ value=
ac_cv_env_LDFLA GS_set=
ac_cv_env_LDFLA GS_value=
ac_cv_env_LD_FO R_TARGET_set=
ac_cv_env_LD_FO R_TARGET_value=
ac_cv_env_LD_se t=
ac_cv_env_LD_va lue=
ac_cv_env_LIPO_ FOR_TARGET_set=
ac_cv_env_LIPO_ FOR_TARGET_valu e=
ac_cv_env_LIPO_ set=
ac_cv_env_LIPO_ value=
ac_cv_env_NM_FO R_TARGET_set=
ac_cv_env_NM_FO R_TARGET_value=
ac_cv_env_NM_se t=
ac_cv_env_NM_va lue=
ac_cv_env_OBJCO PY_set=
ac_cv_env_OBJCO PY_value=
ac_cv_env_OBJDU MP_FOR_TARGET_s et=
ac_cv_env_OBJDU MP_FOR_TARGET_v alue=
ac_cv_env_OBJDU MP_set=
ac_cv_env_OBJDU MP_value=
ac_cv_env_RANLI B_FOR_TARGET_se t=
ac_cv_env_RANLI B_FOR_TARGET_va lue=
ac_cv_env_RANLI B_set=
ac_cv_env_RANLI B_value=
ac_cv_env_STRIP _FOR_TARGET_set =
ac_cv_env_STRIP _FOR_TARGET_val ue=
ac_cv_env_STRIP _set=
ac_cv_env_STRIP _value=
ac_cv_env_WINDM C_FOR_TARGET_se t=
ac_cv_env_WINDM C_FOR_TARGET_va lue=
ac_cv_env_WINDM C_set=
ac_cv_env_WINDM C_value=
ac_cv_env_WINDR ES_FOR_TARGET_s et=
ac_cv_env_WINDR ES_FOR_TARGET_v alue=
ac_cv_env_WINDR ES_set=
ac_cv_env_WINDR ES_value=
ac_cv_env_build _alias_set=
ac_cv_env_build _alias_value=
ac_cv_env_host_ alias_set=
ac_cv_env_host_ alias_value=
ac_cv_env_targe t_alias_set=
ac_cv_env_targe t_alias_value=
ac_cv_exeext=
ac_cv_host=spar c-sun-solaris2.10
ac_cv_host_alia s=sparc-sun-solaris2.10
ac_cv_objext=o
ac_cv_prog_ac_c t_CC=gcc
ac_cv_prog_ac_c t_CXX=g++
ac_cv_prog_ac_c t_GNATBIND=no
ac_cv_prog_ac_c t_GNATMAKE=no
ac_cv_prog_cc_g =yes
ac_cv_prog_cc_s tdc=
ac_cv_prog_cxx_ g=yes
ac_cv_target=sp arc-sun-solaris2.10
ac_cv_target_al ias=sparc-sun-solaris2.10
acx_cv_cc_gcc_s upports_ada=no
acx_cv_prog_LN= ln
gcc_cv_prog_cmp _skip='cmp $$f1 $$f2 16 16'

## ----------------- ##
## Output variables. ##
## ----------------- ##

AR=''
AR_FOR_BUILD='$ (AR)'
AR_FOR_TARGET=' '
AS=''
AS_FOR_BUILD='$ (AS)'
AS_FOR_TARGET=' '
BISON=''
CC='gcc'
CC_FOR_BUILD='$ (CC)'
CC_FOR_TARGET=' '
CFLAGS='-g -O2'
CFLAGS_FOR_BUIL D=''
COMPILER_AS_FOR _TARGET=''
COMPILER_LD_FOR _TARGET=''
COMPILER_NM_FOR _TARGET=''
CONFIGURE_GDB_T K=''
CPPFLAGS=''
CXX='g++'
CXXFLAGS='-g -O2'
CXXFLAGS_FOR_BU ILD=''
CXX_FOR_BUILD=' $(CXX)'
CXX_FOR_TARGET= ''
DEBUG_PREFIX_CF LAGS_FOR_TARGET =''
DEFS=''
DLLTOOL=''
DLLTOOL_FOR_BUI LD='$(DLLTOOL)'
DLLTOOL_FOR_TAR GET=''
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EXEEXT=''
EXPECT=''
FLAGS_FOR_TARGE T=''
FLEX=''
GCC_FOR_TARGET= ''
GCJ_FOR_BUILD=' $(GCJ)'
GCJ_FOR_TARGET= ''
GDB_TK=''
GFORTRAN_FOR_BU ILD='$(GFORTRAN )'
GFORTRAN_FOR_TA RGET=''
GNATBIND='no'
GNATMAKE='no'
INSTALL_DATA='$ {INSTALL} -m 644'
INSTALL_GDB_TK= ''
INSTALL_PROGRAM ='${INSTALL}'
INSTALL_SCRIPT= '${INSTALL}'
LD='/usr/ccs/bin/ld'
LDFLAGS=''
LDFLAGS_FOR_BUI LD=''
LD_FOR_BUILD='$ (LD)'
LD_FOR_TARGET=' '
LEX=''
LIBOBJS=''
LIBS=''
LIPO=''
LIPO_FOR_TARGET =''
LN='ln'
LN_S='ln -s'
LTLIBOBJS=''
M4=''
MAINT=''
MAINTAINER_MODE _FALSE=''
MAINTAINER_MODE _TRUE=''
MAKEINFO=''
NM=''
NM_FOR_BUILD='$ (NM)'
NM_FOR_TARGET=' '
OBJCOPY=''
OBJDUMP=''
OBJDUMP_FOR_TAR GET=''
OBJEXT='o'
PACKAGE_BUGREPO RT=''
PACKAGE_NAME=''
PACKAGE_STRING= ''
PACKAGE_TARNAME =''
PACKAGE_VERSION =''
PATH_SEPARATOR= ':'
RANLIB=''
RANLIB_FOR_BUIL D='$(RANLIB)'
RANLIB_FOR_TARG ET=''
RAW_CXX_FOR_TAR GET=''
RPATH_ENVVAR=''
RUNTEST=''
SHELL='/bin/bash'
STRIP=''
STRIP_FOR_TARGE T=''
SYSROOT_CFLAGS_ FOR_TARGET=''
TOPLEVEL_CONFIG URE_ARGUMENTS=' ../gcc-4.3.1/configure'
WINDMC=''
WINDMC_FOR_BUIL D='$(WINDMC)'
WINDMC_FOR_TARG ET=''
WINDRES=''
WINDRES_FOR_BUI LD='$(WINDRES)'
WINDRES_FOR_TAR GET=''
YACC=''
ac_ct_CC='gcc'
ac_ct_CXX='g++'
ac_ct_GNATBIND= 'no'
ac_ct_GNATMAKE= 'no'
bindir='${exec_ prefix}/bin'
build='sparc-sun-solaris2.10'
build_alias=''
build_configarg s=''
build_configdir s='build-libiberty build-texinfo build-byacc build-flex
build-bison build-m4 build-fixincludes'
build_cpu='spar c'
build_libsubdir ='build-sparc-sun-solaris2.10'
build_noncanoni cal='sparc-sun-solaris2.10'
build_os='solar is2.10'
build_subdir='b uild-sparc-sun-solaris2.10'
build_tooldir=' '
build_vendor='s un'
config_shell='/bin/bash'
configdirs='int l mmalloc libiberty opcodes bfd readline tcl tk itcl
libgui zlib libcpp libdecnumber gmp mpfr texinfo byacc flex bison
binutils gas ld fixincludes gcc sid sim gdb make patch prms
send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake
libtool diff rcs fileutils shellutils time textutils wdiff find uudecode
hello tar gzip indent recode release sed utils guile perl gawk findutils
gettext zip fastjar gnattools'
datadir='${pref ix}/share'
datarootdir=''
do_compare='cmp $$f1 $$f2 16 16'
docdir=''
exec_prefix='NO NE'
gmpinc=''
gmplibs='-lmpfr -lgmp'
host='sparc-sun-solaris2.10'
host_alias=''
host_configargs =''
host_cpu='sparc '
host_noncanonic al='sparc-sun-solaris2.10'
host_os='solari s2.10'
host_subdir='.'
host_vendor='su n'
htmldir=''
includedir='${p refix}/include'
infodir='${pref ix}/info'
libdir='${exec_ prefix}/lib'
libexecdir='${e xec_prefix}/libexec'
localstatedir=' ${prefix}/var'
mandir='${prefi x}/man'
oldincludedir='/usr/include'
pdfdir=''
prefix='NONE'
program_transfo rm_name='s,y,y, '
sbindir='${exec _prefix}/sbin'
sharedstatedir= '${prefix}/com'
stage1_cflags=' '
stage1_checking =''
stage1_language s=''
stage2_werror_f lag=''
sysconfdir='${p refix}/etc'
target='sparc-sun-solaris2.10'
target_alias=''
target_configar gs=''
target_cpu='spa rc'
target_noncanon ical='sparc-sun-solaris2.10'
target_os='sola ris2.10'
target_subdir=' sparc-sun-solaris2.10'
target_vendor=' sun'
tooldir=''

## ------------- ##
## Output files. ##
## ------------- ##

alphaieee_frag= ''
host_makefile_f rag='config/mh-solaris'
ospace_frag=''
serialization_d ependencies=''
target_makefile _frag=''

## ----------- ##
## confdefs.h. ##
## ----------- ##

#define PACKAGE_BUGREPO RT ""
#define PACKAGE_NAME ""
#define PACKAGE_STRING ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#endif
#ifdef __cplusplus
extern "C" void std::exit (int) throw (); using std::exit;

configure: exit 1

Jul 10 '08 #16
In gnu.gcc.help Dave <fo*@coo.comwro te:
Andrew Haley wrote:
>Well, that's bad. Our official position is that gcc needs an ISO-C89
compiler to build, and any use of language extensions to C89 in gcc
sources is a bug.

For any problem bootstrapping gcc with Sun's compilers the question is
whether Sun's tools are deficient in some way or gcc is incorrect. In
this particular case there wasn't any question, so I fixed gcc.
>>Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware ) don't regularly update gcc like they do other
programs. It must seems too difficult/problematic to build, so
people don't bother.

We want people to be able to build gcc on their systems. However some
ports are unmaintained simply because no gcc maintainer uses them.
The only way we can fix that is to ask people who do use these systems
to help us.
I've reported bugs before, but nothing seems to happen. As it gets
more and more difficult to build, which it seems to do with every
version, you are less and less likely to find anyone willing to help
maintain it.
Sure, I'm not denying that's a problem. The only way to make sure
that gcc gets fixed on these systems is to find someone who has one
and wants to keep gcc running on it.
If you have someone willing, I don't mind giving someone access to a
Sun Ultra 60 via SSH.

It's a real pain to try to find a compiler and set of options for
gcc's configure script which work.

For example, lets try 4.3.1 with no options to configure and see how
far it gets:

checking for correct version of mpfr.h... no
configure: error: Building GCC requires GMP 4.1+ and MPFR 2.3.0+.
Try the --with-gmp and/or --with-mpfr options to specify their locations.
Copies of these libraries' source code can be found at their respective
hosting sites as well as at ftp://gcc.gnu.org/pub/gcc/infrastructure/.
See also http://gcc.gnu.org/install/prerequisites.html for additional info.
If you obtained GMP and/or MPFR from a vendor distribution package, make
sure that you have installed both the libraries and the header files.
They may be located in separate packages.
I'm not sure why you think there's a problem here: gcc requires gmp
and mpfr, and if they aren't in the default include path for the
system, configure won't find them.

configure is telling you how to solve the problem. How could this be
done better?

Andrew.
Jul 10 '08 #17
Andrew Haley wrote:
I'm not sure why you think there's a problem here: gcc requires gmp
and mpfr, and if they aren't in the default include path for the
system, configure won't find them.

configure is telling you how to solve the problem. How could this be
done better?

Andrew.

I was under the impression it would look in /usr/local/include for
header files, but looking closer I see that it is not in the compiler
search path.
Jul 10 '08 #18
Dave wrote:
Andrew Haley wrote:
>I'm not sure why you think there's a problem here: gcc requires gmp
and mpfr, and if they aren't in the default include path for the
system, configure won't find them.

configure is telling you how to solve the problem. How could this be
done better?

Andrew.


I was under the impression it would look in /usr/local/include for
header files, but looking closer I see that it is not in the compiler
search path.
Since /usr/local is not part of Solaris (it's a BSD thing) is there any
reason why gcc should look for it?
Jul 10 '08 #19
On 2008-07-10 07:02:07 -0700, Andrew Haley
<ap*@dhcp-10-15-16-109.yyz.redhat. comsaid:
In gnu.gcc.help Dave <fo*@coo.comwro te:
>Andrew Haley wrote:
>>In gnu.gcc.help Andrew Haley <an******@littl epinkcloud.inva lidwrote:
In gnu.gcc.help Thad Smith <Th*******@acm. orgwrote:

The code invokes the macro with a missing first argument. That is valid
C99, but undefined in C90 (see the recent CLC thread on "empty macro
arguments") .
Yes, you're right. This is a bug: empty macro arguments were
undefined in C89, but it was a common extension even then. I'll fix
this.

I have fixed it, and I have added a warning to gcc so that
if anyone ever uses empty macro arguments in the gcc source
the build will abort, even when building with gcc.

It's good to hear it is fixed, but there seems to be an overall
problem with gcc in that features are added, but it is difficult to
build on non-Linux systems. Building on SPARC is no easy task, with
one having to go to great lengths to find the right version of gcc
to build it with (Sun's compilers are incapable of building gcc).

Well, that's bad. Our official position is that gcc needs an ISO-C89
compiler to build, and any use of language extensions to C89 in gcc
sources is a bug.

For any problem bootstrapping gcc with Sun's compilers the question is
whether Sun's tools are deficient in some way or gcc is incorrect. In
this particular case there wasn't any question, so I fixed gcc.
>Is it any wonder that places that keep Solaris binaries (Blastwave,
Sunfreeware) don't regularly update gcc like they do other
programs. It must seems too difficult/problematic to build, so
people don't bother.

We want people to be able to build gcc on their systems. However some
ports are unmaintained simply because no gcc maintainer uses them.
The only way we can fix that is to ask people who do use these systems
to help us.
How ironic, building GCC on SunOS/Solaris used to be one of the
canonical GCC ports. Now a release can come out and no one even
bothers to test bootstrapping it with Sun Studio 12 anymore?

I am trying to build 4.3.1 on Solaris 9 SPARC and am running into this
exact same problem (using Sun Studio 12 to do the initial bootstrap
phase).

One thing I hadn't seen mentioned in this thread is the "-xc99"
switch to Sun Studio 12's "cc", but trying this (CC="cc -xc99" before
"configure" ) still fails, in one of two ways:

(1) If you try using "-xc99" Sun's compilers treat it as "-xc99=all",
and they don't support "-xc99=libs" (part of "all") on Solaris 9.

(2) If you try using "-xc99=all,no_lib " it "compiles" but again returns
the same error as the O.P. got, i.e. it looks like this directive was
essentially a NOP instruction. Same thing for "-xc99=none" as well.

It looks like there is no way to trick the Sun Studio 12 C compiler to
compile that one "gcc/c-common.c" file due to this macro. Not on
Solaris 9 for SPARC, at least.

When can we see this "fix" you speak of, Andrew? Do we have to wait
for GCC 4.3.2? (I don't speak CVS)

Jul 23 '08 #20

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

45
3616
by: Steven T. Hatton | last post by:
This is a purely *hypothetical* question. That means, it's /pretend/, CP. ;-) If you were forced at gunpoint to put all your code in classes, rather than in namespace scope (obviously classes themselves are an exception to this), and 'bootstrap' your program by instantiating a single application object in main(), would that place any limitations on what you could accomplish with your program? Are there any benefits to doing things that...
67
4276
by: Steven T. Hatton | last post by:
Some people have suggested the desire for code completion and refined edit-time error detection are an indication of incompetence on the part of the programmer who wants such features. Unfortunately these ad hominem rhetorts are frequently introduced into purely technical discussions on the feasibility of supporting such functionality in C++. That usually serves to divert the discussion from the technical subject to a discussion of the...
6
2651
by: Niklaus | last post by:
Hi, Can someone point out what is wrong with this code ? How can i make it better optimize it. When run it gives me seg fault in linux. But windows it works fine(runs for a long time). Do we have something like stack size growing enormously and then saying you can't access ,so a segfault ? It would be helpful if someone can run the code and give me the output. It takes a long time on my PC.
31
2627
by: DeltaOne | last post by:
#include<stdio.h> typedef struct test{ int i; int j; }test; main(){ test var; var.i=10; var.j=20;
40
3054
by: Neo The One | last post by:
I think C# is forcing us to write more code by enforcing a rule that can be summarized as 'A local variable must be assgined *explicitly* before reading its value.' If you are interested in what I mean, please look at this feedback my me: http://lab.msdn.microsoft.com/productfeedback/viewfeedback.aspx?feedbackid=3074c204-04e4-4383-9dd2-d266472a84ac If you think I am right, please vote for this feedback.
6
2006
by: TC | last post by:
Hi. I write a program in c language that read a text file and extrapolate the word. for all word the program calculate the number of the times that word is present in the text. The problem is the REALLOC that on my pc at times it produces error. Someone can help me for this error? Thank you /*Inclusione librerie*/
1
1481
by: birgir.sigurjonsson | last post by:
Hei, I am getting compile error on the following code snip: template <typename Sclass Undef; template <typename Sclass A { public: A() {} private: Undef<Sm_s;
232
13323
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first set of examples, after decoding the HTML FORM contents, merely verifies the text within a field to make sure it is a valid representation of an integer, without any junk thrown in, i.e. it must satisfy the regular expression: ^ *?+ *$ If the...
19
1782
by: Charles Sullivan | last post by:
A C program with code typified by the following pared-down example has been running after compilation on numerous compilers for several years. However with a fairly recent GCC compiler it results in a segmentation fault at the indicated instruction. Briefly, the problem occurs when writing to an array element when the array pointer is allocated by a function in the array index. My question: Is this bad C code, "unwise" C code, or a...
0
9072
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8896
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9653
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9451
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9333
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6869
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4771
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4942
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3395
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.