Gentoo Archives: gentoo-dev

From: Mike Frysinger <vapier@g.o>
To: gentoo-dev@l.g.o
Subject: [gentoo-dev] heads up on funky build errors with -O0/nls
Date: Wed, 08 Feb 2006 00:55:52
Message-Id: 200602071953.24486.vapier@gentoo.org
1 in case anyone else comes across this (ive seen a few packages lately) ...
2
3 * symptom: build fails with -O0 but not with -O1 when nls support is enabled
4 * error: LC_MESSAGES/LC_CTYPE/LC_ALL/LC_<something> is undefined and/or
5 functions like setlocale()/textdomain()/etc... are implicitly defined
6 * short answer: broken build system doesnt properly include locale.h
7
8 * long answer:
9 the reason -O1 and better "works" is because glibc will include locale.h
10 automagically via some headers (like libintl.h) whenever optimization is
11 enabled so as to get inline/optimized versions of some functions. when
12 optimization is disabled, glibc will not include locale.h for you and the
13 build fails. so make sure the configure script checks for locale.h and has a
14 bit of code like:
15 #ifdef HAVE_LOCALE_H
16 # include <locale.h>
17 #endif
18
19 for example:
20 http://bugs.gentoo.org/121920
21 -mike
22 --
23 gentoo-dev@g.o mailing list