Bug 19827 - makedepend: warning: ../../../src/mesa/main/dispatch.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
Summary: makedepend: warning: ../../../src/mesa/main/dispatch.c (reading /usr/include...
Status: RESOLVED FIXED
Alias: None
Product: Mesa
Classification: Unclassified
Component: Mesa core (show other bugs)
Version: unspecified
Hardware: Other All
: medium normal
Assignee: mesa-dev
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-30 03:41 UTC by Martin Mokrejs
Modified: 2009-02-13 17:21 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Use GCC include-fixed directory with makedepend (1.13 KB, patch)
2009-01-30 10:59 UTC, Dan Nicholson
Details | Splinter Review

Description Martin Mokrejs 2009-01-30 03:41:29 UTC
Hi,
  is there a problem with my linux-headers or with Mesa?


$ make
make[1]: Entering directory `/var/tmp/Mesa-7.3/src'
Making sources for autoconf
gmake[2]: Entering directory `/var/tmp/Mesa-7.3/src/glx/x11'
touch depend
/usr/bin/makedepend -fdepend -I/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include -I. -I../../../include -I../../../include/GL/internal -I../../../src/mesa -I../../../src/mesa/glapi -I/usr/include/drm     glcontextmodes.c clientattrib.c compsize.c eval.c glxcmds.c glxcurrent.c glxext.c glxextensions.c indirect.c indirect_init.c indirect_size.c indirect_window_pos.c indirect_texture_compression.c indirect_transpose_matrix.c indirect_vertex_array.c indirect_vertex_program.c pixel.c pixelstore.c render2.c renderpix.c single2.c singlepix.c vertarr.c xfont.c glx_pbuffer.c glx_query.c drisw_glx.c dri_common.c dri_glx.c XF86dri.c glxhash.c dri2_glx.c dri2.c \
                ../../../src/mesa/main/dispatch.c ../../../src/mesa/glapi/glapi.c ../../../src/mesa/glapi/glapi_getproc.c ../../../src/mesa/glapi/glthread.c ../../../src/mesa/x86/glapi_x86.S 
/usr/bin/makedepend: warning:  ../../../src/mesa/main/dispatch.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
gmake[2]: Leaving directory `/var/tmp/Mesa-7.3/src/glx/x11'

[cut]

gmake[5]: Entering directory `/var/tmp/Mesa-7.3/src/mesa/drivers/dri/swrast'
touch depend
/usr/bin/makedepend -fdepend -I/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include  -I. -I../../../../../src/mesa/drivers/dri/common -Iserver -I../../../../../include -I../../../../../src/mesa -I../../../../../src/egl/main -I../../../../../src/egl/drivers/dri -I/usr/include/drm    ../../common/driverfuncs.c ../common/utils.c swrast.c swrast_span.c \

/usr/bin/makedepend: warning:  ../../common/driverfuncs.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
gmake[5]: Leaving directory `/var/tmp/Mesa-7.3/src/mesa/drivers/dri/swrast'

[cut]

gmake[5]: Entering directory `/var/tmp/Mesa-7.3/src/mesa/drivers/dri/radeon'
touch depend
/usr/bin/makedepend -fdepend -I/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include -DRADEON_COMMON=0 -I. -I../../../../../src/mesa/drivers/dri/common -Iserver -I../../../../../include -I../../../../../src/mesa -I../../../../../src/egl/main -I../../../../../src/egl/drivers/dri -I/usr/include/drm    ../common/utils.c ../common/texmem.c ../common/vblank.c ../common/dri_util.c ../common/xmlconfig.c ../common/drirenderbuffer.c  radeon_context.c radeon_ioctl.c radeon_lock.c radeon_screen.c radeon_state.c radeon_state_init.c radeon_tex.c radeon_texmem.c radeon_texstate.c radeon_tcl.c radeon_swtcl.c radeon_span.c radeon_maos.c radeon_sanity.c   \

/usr/bin/makedepend: warning:  ../common/utils.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
gmake[5]: Leaving directory `/var/tmp/Mesa-7.3/src/mesa/drivers/dri/radeon'

[cut]




Please see also bug http://bugs.gentoo.org/show_bug.cgi?id=256580 and http://www.gentooforum.de/index.php?page=Thread&postID=70961&s=ed27896e9cd021351d6d71ce88fbb81f5db5fefd#post70961
It is not a new issue.
Comment 1 Dan Nicholson 2009-01-30 06:47:05 UTC
It's not a big deal if makedepend can't find it. If gcc can't find it during the build, then that's a real problem.

Anyway, the issue is that /usr/include/limits.h goes to pull in gcc's limits.h. It should be in the directory `gcc -print-file-name=include`. Pretty easy to test it out if you're concerned.

echo '#include <limits.h>' > dummy.c
touch dummy.dep
makedepend -f dummy.dep dummy.c
makedepend -f dummy.dep -I `gcc -print-file-name=include` dummy.c
Comment 2 Martin Mokrejs 2009-01-30 09:38:05 UTC
$ echo '#include <limits.h>' > dummy.c
$ touch dummy.dep
$ makedepend -f dummy.dep dummy.c
makedepend: warning:  dummy.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
$ makedepend -f dummy.dep -I `gcc -print-file-name=include` dummy.c
makedepend: warning:  dummy.c (reading /usr/include/limits.h, line 125): cannot find include file "limits.h"
$ 

$ gcc -print-file-name=include
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include
$ gcc -v
Using built-in specs.
Target: i686-pc-linux-gnu
Configured with: /var/tmp/portage/sys-devel/gcc-4.3.2-r2/work/gcc-4.3.2/configure --prefix=/usr --bindir=/usr/i686-pc-linux-gnu/gcc-bin/4.3.2 --includedir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include --datadir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2 --mandir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/man --infodir=/usr/share/gcc-data/i686-pc-linux-gnu/4.3.2/info --with-gxx-include-dir=/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include/g++-v4 --host=i686-pc-linux-gnu --build=i686-pc-linux-gnu --disable-altivec --disable-fixed-point --enable-nls --without-included-gettext --with-system-zlib --disable-checking --disable-werror --enable-secureplt --disable-multilib --enable-libmudflap --disable-libssp --enable-libgomp --enable-cld --enable-java-awt=gtk --with-arch=i686 --enable-languages=c,c++,java,treelang,fortran --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --with-bugurl=http://bugs.gentoo.org/ --with-pkgversion='Gentoo 4.3.2-r2 p1.5, pie-10.1.5'
Thread model: posix
gcc version 4.3.2 (Gentoo 4.3.2-r2 p1.5, pie-10.1.5) 
$

So what is wrong with my setup? ;-)
Comment 3 Dan Nicholson 2009-01-30 09:47:28 UTC
I'm not in the business of debugging your toolchain, but is there a limits.h in `gcc -print-file-name=include`? If not, that's the problem.
Comment 4 Martin Mokrejs 2009-01-30 09:49:59 UTC
c$ ls -la /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include
total 480
drwxr-xr-x  4 root root  4096 Jan 23 06:08 .
drwxr-xr-x  6 root root  4096 Jan 23 06:08 ..
-rw-r--r--  1 root root  3227 Jan 23 03:58 ammintrin.h
-rw-r--r--  1 root root 43531 Jan 23 03:58 bmmintrin.h
-rw-r--r--  1 root root  5139 Jan 23 03:58 cpuid.h
-rw-r--r--  1 root root 16724 Jan 23 05:59 cxxabi.h
-rw-r--r--  1 root root 50071 Jan 23 03:58 emmintrin.h
-rw-r--r--  1 root root 10746 Jan 23 05:59 ffi.h
-rw-r--r--  1 root root  2798 Jan 23 05:59 ffitarget.h
-rw-r--r--  1 root root  7916 Jan 23 03:58 float.h
drwxr-xr-x 16 root root  4096 Jan 23 06:08 g++-v4
drwxr-xr-x  2 root root  4096 Jan 23 06:08 gcj
-rw-r--r--  1 root root  1432 Jan 23 03:58 iso646.h
-rw-r--r--  1 root root  3516 Jan 23 05:59 jawt.h
-rw-r--r--  1 root root  2349 Jan 23 05:59 jawt_md.h
-rw-r--r--  1 root root 64272 Jan 23 05:59 jni.h
-rw-r--r--  1 root root  4584 Jan 23 05:59 jni_md.h
-rw-r--r--  1 root root  6870 Jan 23 05:59 jvmpi.h
-rw-r--r--  1 root root 10439 Jan 23 05:59 mf-runtime.h
-rw-r--r--  1 root root  6891 Jan 23 03:58 mm3dnow.h
-rw-r--r--  1 root root  1907 Jan 23 03:58 mm_malloc.h
-rw-r--r--  1 root root  5532 Jan 23 03:58 mmintrin-common.h
-rw-r--r--  1 root root 30701 Jan 23 03:58 mmintrin.h
-rw-r--r--  1 root root  1523 Jan 23 03:58 nmmintrin.h
-rw-r--r--  1 root root  3219 Jan 23 06:07 omp.h
-rw-r--r--  1 root root  4407 Jan 23 03:58 pmmintrin.h
-rw-r--r--  1 root root 24173 Jan 23 03:58 smmintrin.h
-rw-r--r--  1 root root  4317 Jan 23 03:58 stdarg.h
-rw-r--r--  1 root root  1604 Jan 23 03:58 stdbool.h
-rw-r--r--  1 root root 12695 Jan 23 03:58 stddef.h
-rw-r--r--  1 root root  6154 Jan 23 03:58 stdfix.h
-rw-r--r--  1 root root  8366 Jan 23 03:58 tmmintrin.h
-rw-r--r--  1 root root 10384 Jan 23 03:58 unwind.h
-rw-r--r--  1 root root   139 Jan 23 03:58 varargs.h
-rw-r--r--  1 root root 41838 Jan 23 03:58 xmmintrin.h
$

Thanks, is a Gentoo issue then. Thanks!
Comment 5 Julien Cristau 2009-01-30 09:55:20 UTC
> --- Comment #3 from Dan Nicholson <dbn.lists@gmail.com>  2009-01-30 09:47:28 PST ---
> I'm not in the business of debugging your toolchain, but is there a limits.h in
> `gcc -print-file-name=include`? If not, that's the problem.
> 
fwiw here `gcc -print-file-name=include`
is /usr/lib/gcc/x86_64-linux-gnu/4.3.3/include, and limits.h is
in  /usr/lib/gcc/x86_64-linux-gnu/4.3.3/include-fixed
Comment 6 Martin Mokrejs 2009-01-30 10:03:21 UTC
$ ls -la /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/
total 28
drwxr-xr-x 4 root root 4096 Jan 23 06:08 .
drwxr-xr-x 6 root root 4096 Jan 23 06:08 ..
-rw-r--r-- 1 root root  750 Jan 23 03:58 README
drwxr-xr-x 2 root root 4096 Jan 23 06:08 freetype2
-rw-r--r-- 1 root root 3470 Jan 23 03:58 limits.h
drwxr-xr-x 2 root root 4096 Jan 23 06:08 schily
-rw-r--r-- 1 root root  330 Jan 23 02:24 syslimits.h
$ equery belongs /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/limits.h
[ Searching for file(s) /usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/limits.h in *... ]
sys-devel/gcc-4.3.2-r2 (/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed/limits.h)
$

Here as well! Is filed as http://bugs.gentoo.org/show_bug.cgi?id=256580
Comment 7 Dan Nicholson 2009-01-30 10:28:28 UTC
Right, I forgot about include-fixed on newer gcc. Julien, does "gcc -print-file-name=include-fixed" give you a full path? If so, I'll add that to the makedepend munging.
Comment 8 Martin Mokrejs 2009-01-30 10:42:13 UTC
On my Gentoo it gives:

$ gcc -print-file-name=include-fixed
/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed
$
Comment 9 Julien Cristau 2009-01-30 10:50:32 UTC
> --- Comment #7 from Dan Nicholson <dbn.lists@gmail.com>  2009-01-30 10:28:28 PST ---
> Right, I forgot about include-fixed on newer gcc. Julien, does "gcc
> -print-file-name=include-fixed" give you a full path? If so, I'll add that to
> the makedepend munging.
> 
yes, it does (whereas on etch's gcc 4.1, it just says 'include-fixed').  Thanks Dan.
Comment 10 Dan Nicholson 2009-01-30 10:59:22 UTC
Created attachment 22388 [details] [review]
Use GCC include-fixed directory with makedepend

Can you guys see if this works? No need to build, just "./autogen.sh && grep MKDEP_OPTIONS configs/autoconf".
Comment 11 Dan Nicholson 2009-01-30 11:00:31 UTC
Reopening since we should deal with GCC's headers.
Comment 12 Julien Cristau 2009-01-30 11:47:55 UTC
> --- Comment #10 from Dan Nicholson <dbn.lists@gmail.com>  2009-01-30
> 10:59:22 PST ---
> Can you guys see if this works? No need to build, just "./autogen.sh && grep
> MKDEP_OPTIONS configs/autoconf".
> 
MKDEP_OPTIONS = -fdepend -I/usr/lib/gcc/x86_64-linux-gnu/4.3.3/include
-I/usr/lib/gcc/x86_64-linux-gnu/4.3.3/include-fixed

I'd maybe add a test "$GCC_INCLUDES" != $dir, since earlier gcc versions
seem to output that, but otherwise
Signed-off-by: Julien Cristau <jcristau@debian.org>
Comment 13 Martin Mokrejs 2009-01-30 11:59:18 UTC
Works here as well:

# grep MKDEP_OPTIONS configs/autoconf
MKDEP_OPTIONS = -fdepend -I/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include -I/usr/lib/gcc/i686-pc-linux-gnu/4.3.2/include-fixed
#
Comment 14 Dan Nicholson 2009-01-30 12:01:24 UTC
(In reply to comment #12)
> 
> I'd maybe add a test "$GCC_INCLUDES" != $dir, since earlier gcc versions
> seem to output that, but otherwise
> Signed-off-by: Julien Cristau <jcristau@debian.org>

Yeah, that's what I was trying to accomplish by adding the test -d
"$GCC_INCLUDES", but I guess that could match an include or include-fixed in
cwd. I'll change it up. Thanks for testing, guys.
Comment 15 Dan Nicholson 2009-01-30 12:07:01 UTC
Pushed as a3d223f0d204670696338d61fe4870ff2a41f210.
Comment 16 Rémi Cardona 2009-02-12 23:55:01 UTC
Could this patch be pushed/nominated for mesa 7.4?

Thanks
Comment 17 Brian Paul 2009-02-13 08:10:52 UTC
I just cherry-picked the patch to the 7.4 branch.
Comment 18 Rémi Cardona 2009-02-13 17:21:38 UTC
Thanks :)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.