Bug 213223 - kdelibs-4.3.3 (branch & stable) glibc-2.11
Summary: kdelibs-4.3.3 (branch & stable) glibc-2.11
Status: RESOLVED FIXED
Alias: None
Product: kdelibs
Classification: Unmaintained
Component: general (show other bugs)
Version: 4.3
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdelibs bugs
URL:
Keywords:
: 213442 (view as bug list)
Depends on:
Blocks:
 
Reported: 2009-11-05 10:50 UTC by Thomas Sauer
Modified: 2009-11-29 17:58 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Add missing includes for strlcpy, strlcat (567 bytes, patch)
2009-11-06 00:40 UTC, Michael Pyne
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Sauer 2009-11-05 10:50:15 UTC
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
Comment 1 Manfred Knick 2009-11-05 12:05:11 UTC
(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 ?
Comment 2 Thomas Sauer 2009-11-05 12:10:29 UTC
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/).
Comment 3 Frank Reininghaus 2009-11-05 23:44:26 UTC
(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?
Comment 4 Michael Pyne 2009-11-06 00:02:17 UTC
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.
Comment 5 Frank Reininghaus 2009-11-06 00:12:01 UTC
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.
Comment 6 Michael Pyne 2009-11-06 00:40:28 UTC
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.
Comment 7 Christoph Feck 2009-11-07 14:11:26 UTC
*** Bug 213442 has been marked as a duplicate of this bug. ***
Comment 8 Christoph Feck 2009-11-07 14:12:49 UTC
r1045794 seems to fix this. Can anyone look at if this needs to be backported?
Comment 9 Thomas Sauer 2009-11-07 14:23:46 UTC
Thx for the patch, kdelibs-4.3.3 (an the rest of kde stable & branch) now are compiling & working perfectly on my system.
Greetings
Comment 10 Michael Pyne 2009-11-07 21:17:22 UTC
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