[oe-issues] [Bug 1547] New: limits.h is not picked up properly by prebuilt toolchain (PATH_MAX undeclared)
bugzilla-daemon at tinman.treke.net
bugzilla-daemon at tinman.treke.net
Wed Nov 1 14:55:00 UTC 2006
http://bugs.openembedded.org/show_bug.cgi?id=1547
Summary: limits.h is not picked up properly by prebuilt toolchain
(PATH_MAX undeclared)
Product: Openembedded
Version: unspecified
Platform: All
OS/Version: Linux
Status: NEW
Severity: normal
Priority: P2
Component: Distributions
AssignedTo: openembedded-issues at lists.openembedded.org
ReportedBy: dev at settopsolutions.com
QAContact: tinderbox-oe at gmx.net
When trying to use an external toolchain (built with meta-toolchain.bb) to
compile xserver-xorg, I get an error about PATH_MAX being undeclared (see
below)...for some reason, the limits.h with this define in it is not being
picked up... as you can see, my cross-toolchain include directory has been
included with -I/usr/local/i586/oe/i586-stv-linux/include. The limits.h file
exists at /usr/local/i586/oe/i586-stv-linux/include/limits.h and also at
/usr/local/i586/oe/i586-stv-linux/include/linux/limits.h. It is this second
file which has PATH_MAX defined, and this is not being included by gcc. If I
alter PsFonts.c like so
--- xorg-server-X11R7.1-1.1.0/Xprint/ps/PsFonts.c 2005-07-07
03:47:06.000000000 +0100
+++ xorg-server-X11R7.1-1.1.0-PATCHED/Xprint/ps/PsFonts.c
2006-11-01 00:12:23.000000000 +0000
@@ -89,7 +89,7 @@
#include "Ps.h"
#include <ctype.h>
-#include <limits.h>
+#include <linux/limits.h>
#include <sys/stat.h>
then it compiles OK but I'm not sure if this is actually a problem with
xserver-xorg, or if it's a problem with the toolchain, and therefore with the
*-cross-sdk/meta-toolchain stuff in general. I have read that directly
includeing linux/limits.h is a bad thing to do and a better idea is to do:
-#include <limits.h>
+#include <sys/param.h>
This also fixes the problem. Since finding this problem with xserver-xorg, I
have come accross the same problem with the following packages:
* libxml2-2.6.26
* xserver-xorg_X11R7.1-1.1.0
* util-linux-2.12r
* modutils-2.4.27
* alsa-utils-1.0.11
Altering the offending .c files in each case fixes the problem, but I'm still
not convinced this is the right thing to do.
| ccache i586-stv-linux-gcc-3.4.4 -march=c3 -mtune=c3 -
DHAVE_CONFIG_H -I. -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/Xprint/ps -I../../include -I../../include -I../../
include -I../../include -I../../include -I../../include -I../../
include -I../../include -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/
work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/Xprint -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/cfb -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/mfb -isystem/home/tom/stv/oe-stv/build/tmp-stv-via-c3/
staging/i586-stv-linux/include -I/usr/local/i586/oe/i586-stv-linux/
include -DXFree86Server -DHAVE_DIX_CONFIG_H -I/home/tom/stv/oe-stv/
build/tmp-stv-via-c3/staging/i586-stv-linux/include -
D_XP_PRINT_SERVER_ -DPSZ=8 -DXP_PSTEXT -Wall -Wpointer-arith -Wstrict-
prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-
externs -fno-strict-aliasing -D_BSD_SOURCE -DHAS_FCHOWN -
DHAS_STICKY_DIR_BIT -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/
staging/i586-stv-linux/include -I/home/tom/stv/oe-stv/build/tmp-stv-
via-c3/staging/i586-stv-linux/include/X11/Xtrans -I/home/tom/stv/oe-
stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-
X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/include -I../../include -I/
home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-
xorg-X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/Xext -I/home/tom/stv/
oe-stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-
X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/composite -I/home/tom/stv/
oe-stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-
X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/damageext -I/home/tom/stv/
oe-stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-
X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/xfixes -I/home/tom/stv/oe-
stv/build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-
X11R7.1-1.1.0-r0/xorg-server-X11R7.1-1.1.0/Xi -I/home/tom/stv/oe-stv/
build/tmp-stv-via-c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-
r0/xorg-server-X11R7.1-1.1.0/mi -I/home/tom/stv/oe-stv/build/tmp-stv-
via-c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/miext/shadow -I/home/tom/stv/oe-stv/build/tmp-stv-via-
c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/miext/damage -I/home/tom/stv/oe-stv/build/tmp-stv-via-
c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/render -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/randr -I/home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/fb -isystem/home/tom/stv/oe-stv/build/tmp-stv-via-c3/
staging/i586-stv-linux/include -I/usr/local/i586/oe/i586-stv-linux/
include -O -g -MT PsFonts.lo -MD -MP -MF .deps/PsFonts.Tpo -c
PsFonts.c -fPIC -DPIC -o .libs/PsFonts.o
| PsFonts.c: In function `getFontFilename':
| PsFonts.c:292: error: `PATH_MAX' undeclared (first use in this
function)
| PsFonts.c:292: error: (Each undeclared identifier is reported only
once
| PsFonts.c:292: error: for each function it appears in.)
| PsFonts.c:343: warning: unused variable `full_font_file_path'
| PsFonts.c:289: warning: unused variable `count'
| PsFonts.c:289: warning: unused variable `i'
| PsFonts.c:289: warning: unused variable `status'
| PsFonts.c:291: warning: unused variable `end'
| PsFonts.c:292: warning: unused variable `font_dir_fname'
| PsFonts.c:293: warning: unused variable `font_file_fname'
| PsFonts.c: In function `PsCreateFontTypeInfoRec':
| PsFonts.c:595: warning: unused variable `psname'
| make[2]: *** [PsFonts.lo] Error 1
| make[2]: Leaving directory `/home/tom/stv/oe-stv/build/tmp-stv-via-
c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/Xprint/ps'
| make[1]: *** [all-recursive] Error 1
| make[1]: Leaving directory `/home/tom/stv/oe-stv/build/tmp-stv-via-
c3/work/i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/xorg-server-
X11R7.1-1.1.0/Xprint'
| make: *** [all-recursive] Error 1
| FATAL: oe_runmake failed
NOTE: Task failed: /home/tom/stv/oe-stv/build/tmp-stv-via-c3/work/
i586-stv-linux/xserver-xorg-X11R7.1-1.1.0-r0/temp/log.do_compile.9219
NOTE: package xserver-xorg-X11R7.1-1.1.0-r0: task do_compile: failed
--
Configure bugmail: http://bugs.openembedded.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the Openembedded-issues
mailing list