Version: (using Devel) Compiler: gcc-4.4.2 OS: Linux Installed from: Compiled sources Hi, today I tried to compile kdelibs-4.3.3 from branch and from stable and get this error (using the new glibc-2.11 on a LFS-based System): Building C object kdecore/CMakeFiles/kdefakes.dir/fakes.o /tmp/kdelibs-4.3.3/kdecore/fakes.c: In Funktion »strlcpy«: /tmp/kdelibs-4.3.3/kdecore/fakes.c:318: Fehler: Implizite Deklaration der Funktion »strlen« /tmp/kdelibs-4.3.3/kdecore/fakes.c:318: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »strlen« /tmp/kdelibs-4.3.3/kdecore/fakes.c:323: Fehler: Implizite Deklaration der Funktion »memcpy« /tmp/kdelibs-4.3.3/kdecore/fakes.c:323: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »memcpy« /tmp/kdelibs-4.3.3/kdecore/fakes.c:327: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »memcpy« /tmp/kdelibs-4.3.3/kdecore/fakes.c: In Funktion »strlcat«: /tmp/kdelibs-4.3.3/kdecore/fakes.c:337: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »strlen« /tmp/kdelibs-4.3.3/kdecore/fakes.c:339: Fehler: Implizite Deklaration der Funktion »memchr« /tmp/kdelibs-4.3.3/kdecore/fakes.c:339: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »memchr« /tmp/kdelibs-4.3.3/kdecore/fakes.c:346: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »memcpy« /tmp/kdelibs-4.3.3/kdecore/fakes.c:349: Warnung: Unverträgliche implizite Deklaration der eingebauten Funktion »memcpy« make[2]: *** [kdecore/CMakeFiles/kdefakes.dir/fakes.o] Fehler 1 make[1]: *** [kdecore/CMakeFiles/kdefakes.dir/all] Fehler 2 make[1]: *** Warte auf noch nicht beendete Prozesse... Think that`s a glibc-based error. My OS: gcc-4.4.2 glibc-2.11 If you need more Information please let me know. Greetings Thomas
(In reply to comment #0) > glibc-2.11 Presumably using . . . "glibc-2.11.tar.bz2 03-Nov-2009 15:33 15M" from . . . http://ftp.gnu.org/gnu/glibc/ ? Can you tell if this happens with . . . "The current stable version is 2.10.1." . . . ( http://www.gnu.org/software/libc/libc.html#CurrentStatus ) on your box too ?
Hi, with glibc-2.10.1 everything is compiling (and working) well, stable and branch. The error here occurs after upgrading the glibc yesterday (yes, sources from http://ftp.gnu.org/gnu/glibc/).
(In reply to comment #2) > with glibc-2.10.1 everything is compiling (and working) well, stable and > branch. In that case, it might be a regression in the (unstable) glibc 2.11. Have you checked that?
No need to blame glibc, it's our bug. We don't include the appropriate headers for strlen, memcpy, or memchr. For some reason, each fake function tries very hard to only include needed headers (instead of just including string.h and stdlib.h once), but our fake strlcpy and strlcat do not include the required headers. What probably happened is that glibc cleaned up some unnecessary includes their header was making so our code was working by accident.
Michael, sounds very reasonable - I should have thought twice before posting a useless comment here ;-) Anyway, it looks like it's easy to fix then.
Created attachment 38128 [details] Add missing includes for strlcpy, strlcat This seems to me to be the minimal patch to fix the issue. However looking in fakes.c it looks like we could run across this elsewhere (for instance, random() and srandom() use lrand48 and srand48 without any includes) so I wonder if it isn't best just to fix this once and for all.
*** Bug 213442 has been marked as a duplicate of this bug. ***
r1045794 seems to fix this. Can anyone look at if this needs to be backported?
Thx for the patch, kdelibs-4.3.3 (an the rest of kde stable & branch) now are compiling & working perfectly on my system. Greetings
SVN commit 1046199 by mpyne: Backport compilation fix for glibc 2.11 (we weren't including enough headers) to KDE 4.3.4. Originally committed in r1045794. BUG:213223 M +44 -12 fakes.c WebSVN link: http://websvn.kde.org/?view=rev&revision=1046199