Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 38308 - limits.h containing __INT_MAX__ not automatically included when building xemacs (was: dev-lang/ccc and dev-lang/gcc-3.3.2 do not play well together)
Summary: limits.h containing __INT_MAX__ not automatically included when building xema...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: Alpha Linux
: High major (vote)
Assignee: XEmacs team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-01-15 10:17 UTC by Paul Moore
Modified: 2004-09-23 19:03 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Moore 2004-01-15 10:17:48 UTC
The problem appears to be that gcc 3.3.2 seems to use a builtin define __INT_MAX__ which ccc does not understand.  This causes ccc to fail when compiling xemacs (the only way I have found to get a stable xemacs on gentoo alpha is to use ccc).

A quick google search revealed this link:

 * http://gcc.gnu.org/ml/gcc-patches/2002-06/msg01087.html

... which may be helpful.

Reproducible: Always
Steps to Reproduce:
1. CC=ccc emerge xemacs
2.
3.

Actual Results:  
make[1]: Entering directory
`/var/tmp/portage/xemacs-21.4.12/work/xemacs-21.4.12/lwlib'
ccc -c -arch ev67 -O3  -I. -DHAVE_CONFIG_H -std1 -I/usr/X11R6/include lwlib.c
ccc -c -arch ev67 -O3  -I. -DHAVE_CONFIG_H -std1 -I/usr/X11R6/include lwlib-utils.c
ccc -c -arch ev67 -O3  -I. -DHAVE_CONFIG_H -std1 -I/usr/X11R6/include lwlib-config.c
ccc -c -arch ev67 -O3  -I. -DHAVE_CONFIG_H -std1 -I/usr/X11R6/include lwlib-Xm.c
cc: Error: lwlib-Xm.c, line 781: In this statement, "__INT_MAX__" is not
declared. (undeclared)
      new_sliderSize = (int) ((double) (INT_MAX - 1) * percent);
----------------------------------------^
cc: Error: lwlib-Xm.c, line 1612: In this statement, "__INT_MAX__" is not
declared. (undeclared)
  XtSetArg (al[ac], XmNmaximum, INT_MAX); ac++;
--^
cc: Error: lwlib-Xm.c, line 2118: In this statement, "__INT_MAX__" is not
declared. (undeclared)
  percent = (double) (data->value - 1) / (double) (INT_MAX - 1);
---------------------------------------------------^
make[1]: *** [lwlib-Xm.o] Error 1
make[1]: Leaving directory
`/var/tmp/portage/xemacs-21.4.12/work/xemacs-21.4.12/lwlib'
make: *** [lwlib] Error 2

!!! ERROR: app-editors/xemacs-21.4.12 failed.
!!! Function src_compile, Line 170, Exitcode 2
!!! (no error message)

Expected Results:  
Compiled XEmacs.

Portage 2.0.50_pre16 (default-alpha-1.4, gcc-3.3.2,
glibc-2.3.2-r1,2.3.3_pre20031222-r0, 2.4.21-alpha-r2)
=================================================================
System uname: 2.4.21-alpha-r2 alpha EV67
Gentoo Base System version 1.4.3.12
ccache version 2.3 [enabled]
Autoconf: sys-devel/autoconf-2.59
Automake: sys-devel/automake-1.7.8
ACCEPT_KEYWORDS="alpha ~alpha"
AUTOCLEAN="yes"
CFLAGS="-arch ev67 -O3"
CHOST="alphaev67-unknown-linux-gnu"
COMPILER="gcc3"
CONFIG_PROTECT="/etc /usr/X11R6/lib/X11/xkb /usr/kde/2/share/config
/usr/kde/3/share/config /usr/share/config /var/qmail/control"
CONFIG_PROTECT_MASK="/etc/gconf /etc/env.d"
CXXFLAGS="-arch ev67 -O3"
DISTDIR="/usr/portage/distfiles"
FEATURES="ccache"
GENTOO_MIRRORS="http://gentoo.oregonstate.edu
http://www.ibiblio.org/pub/Linux/distributions/gentoo"
MAKEOPTS="-j1"
PKGDIR="/usr/portage/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/usr/local/my_gentoo"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="X alpha berkdb crypt cups encode esd ev6 foomaticdb gdbm gif gnome gpm gtk
gtk2 imlib ipv6 jpeg kde ldap libg++ libwww mikmod motif mozilla moznocompose
moznoirc ncurses oggvorbis opengl oss pam pdflib perl png python qt quicktime
readline ruby sdl slang spell ssl tcltk tcpd tiff truetype xinerama xml2 xmms xv
zlib"
Comment 1 Paul Moore 2004-01-15 11:46:23 UTC
I was able to compile xemacs by adding the following to my comp.config file: "-D__SCHAR_MAX__=127 -D__SHRT_MAX__=32767 -D__INT_MAX__=2147483647 -D__LONG_MAX__=9223372036854775807 -D__LONG_LONG_MAX=9223372036854775807 -D__CHAR_BIT__=8 -D__DBL_DIG__=15"
Comment 2 Jeremy Maitin-Shepard 2004-01-15 14:18:18 UTC
I am guessing that the problem is that xemacs does not include limits.h where it should.  When GCC is used, limits.h probably gets included inadvertantly, and so the problem is not noticed.  When I have more time, I will actually check the code.  Until then, you could check yourself to see if this is the case.
Comment 3 Alexander Gabert (RETIRED) gentoo-dev 2004-03-03 05:37:31 UTC
Did you have success adding the limits.h somewhere in the build definitions of the package?

If yes, can we get this out of sight for our gcc bug hunters ;-)

Alex
Comment 4 Paul Moore 2004-03-05 10:26:13 UTC
No, this does not fix the problem.  Explanation follows:

With the latest ccc ebuild installed (6.5.9.001-r3) I get the following error when building xemacs:

***
ccc -c -arch ev67 -O3  -Demacs -I. -DHAVE_CONFIG_H -std1 -I/usr/X11R6/include print.c
cc: Error: print.c, line 915: In this statement, "__DBL_DIG__" is not declared. (undeclared)
      if (width < (int) (*cp != 'e' && *cp != 'E') || width > DBL_DIG)
--------------------------------------------------------------^
make[1]: *** [print.o] Error 1
make[1]: Leaving directory `/var/tmp/portage/xemacs-21.4.12/work/xemacs-21.4.12/src'
make: *** [src] Error 2

!!! ERROR: app-editors/xemacs-21.4.12 failed.
!!! Function src_compile, Line 170, Exitcode 2
!!! (no error message)
***

As you can see from the error message, the problem is with "__DBL_DIG__" missing from the include files (it is not defined).  A quick google revealed that in the later versions of gcc the basic constants such as "INT_MAX" and "DBL_DIG" have been #defined to double underscore versions.  For example take a look at line 57 from the float.h file for gcc-3.3.3 which on my system is located here:

 * /usr/lib/gcc-lib/alphaev67-unknown-linux-gnu/3.3.3/include

The file has the followin on line 57:

 #define DBL_DIG         __DBL_DIG__

And if look at the link in my original problem report you can see that the later versions of gcc changed to the double underscore.  This is why my original workaround of modifing the comp.config file worked.

This is not a problem with xemacs but rather a problem with ccc and the latest versions of gcc as originally stated.
Comment 5 Alexander Gabert (RETIRED) gentoo-dev 2004-09-23 19:03:27 UTC
And you are right and this is therefore an upstream bug and i am closing it now.

see http://gcc.gnu.org/bugs.html for filing.

Alex