Bug 33903 - FTBFS on GNU/kFreeBSD caused by missing strnstr() on glibc systems
Summary: FTBFS on GNU/kFreeBSD caused by missing strnstr() on glibc systems
Status: UNCONFIRMED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-01-20 07:29 PST by Fathi Boudra
Modified: 2010-10-21 12:57 PDT (History)
3 users (show)

See Also:


Attachments
fix kfreebsd ftbfs (298 bytes, patch)
2010-01-20 07:29 PST, Fathi Boudra
darin: review-
Details | Formatted Diff | Diff
Patch to use HAVE_STRNSTRN (1.96 KB, patch)
2010-10-21 12:54 PDT, Anton Faern
darin: review-
darin: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Fathi Boudra 2010-01-20 07:29:28 PST
Created attachment 47028 [details]
fix kfreebsd ftbfs

While building Qt 4.6.1 on GNU/kFreeBSD, it fails to build from scratch:
websockets/WebSocketHandshake.cpp: In member function ‘int WebCore::WebSocketHandshake::readServerHandshake(const char*, size_t)’:
websockets/WebSocketHandshake.cpp:255: error: ‘strnstr’ was not declared in this scope

it's caused by the missing strnstr() function on glibc systems.

webkit trunk should be also affected as the source code found on Qt 4.6.1 is similar.

Please, find attached an initial patch to fix the issue.
Comment 1 Darin Adler 2010-01-20 08:32:59 PST
Comment on attachment 47028 [details]
fix kfreebsd ftbfs

Platforms that happen to have glibc are not OS(LINUX) and just because that's handy at one particular call site does not mean this is the correct way to do it.

The right way to do this is to change the check at the strnstr definition, perhaps as described in the FIXME in StringExtras.h.

Maciej Stachowiak is working on rationalizing Platform.h and might have a suggestion on the correct way to handle this.
Comment 2 Darin Adler 2010-01-20 08:33:08 PST
Also, patches need a change log entry.
Comment 3 Fathi Boudra 2010-01-20 08:43:27 PST
that's what I mean by "initial" patch :)
I'm just waiting someone points me the way to go for a proper fix.
Comment 4 Anton Faern 2010-10-21 12:54:59 PDT
Created attachment 71477 [details]
Patch to use HAVE_STRNSTRN
Comment 5 Anton Faern 2010-10-21 12:56:14 PDT
Proposed patch addresses the above and will help other affected platforms (like NetBSD) whose libc implementations lack strnstr.
Comment 6 Darin Adler 2010-10-21 12:57:14 PDT
Comment on attachment 71477 [details]
Patch to use HAVE_STRNSTRN

This patch will break non-configure-based platforms that have strnstr, which is the majority of platforms we support. Platform.h needs to set HAVE_STRNSTR for those platforms.