diff mbox

Analysis of build failures

Message ID 201311111426.34194.fatih.asici@gmail.com
State Not Applicable
Headers show

Commit Message

Fatih Aşıcı Nov. 11, 2013, 12:26 p.m. UTC
On Monday 11 November 2013 12:09:06 Thomas Petazzoni wrote:
> Dear Fatih Aşıcı,
> 
> On Mon, 11 Nov 2013 11:14:51 +0200, Fatih Aşıcı wrote:
> > >   http://autobuild.buildroot.net/results/555278227680e90737e6dbe0a6dcc0
> > >   35507150aa/build-end.log (sqlite problem)
> > 
> > Needs posix_fallocate() which is not available in the test toolchain.
> 
> Except that posix_fallocate() is not available in uClibc. It is indeed
> available in the internal toolchain backend, due to a patch that we
> have added, but we cannot assume it will be available in external
> uClibc toolchains that may not have the same of patches applied.
> 
> Moreover, the sqlite3.c code in Qt seems to have some code to handle
> the absence of posix_fallocate():
> 
> #if defined(HAVE_POSIX_FALLOCATE) && HAVE_POSIX_FALLOCATE
>   { "fallocate",    (sqlite3_syscall_ptr)posix_fallocate,  0 },
> #else
>   { "fallocate",    (sqlite3_syscall_ptr)0,                0 },
> #endif
> 
> It would be nice to have a look at why HAVE_POSIX_FALLOCATE is defined
> even though posix_fallocate() is not available.

Probably the following change will fix it:



sqlite3's own build system (which is not available in qt) checks if 
posix_fallocate() is available. I wonder if there is a special reason for 
providing an option to use the built-in sqlite.

Comments

Gustavo Zacarias Nov. 11, 2013, 9:30 a.m. UTC | #1
On 11/11/2013 09:26 AM, Fatih Aşıcı wrote:

> Probably the following change will fix it:
> 
> --- a/src/3rdparty/sqlite/sqlite3.c
> +++ b/src/3rdparty/sqlite/sqlite3.c
> @@ -22938,7 +22938,8 @@ SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
>  /* Use posix_fallocate() if it is available
>  */
>  #if !defined(HAVE_POSIX_FALLOCATE) \
> -      && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L)
> +      && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L) \
> +      && !defined(__UCLIBC__)
>  # define HAVE_POSIX_FALLOCATE 1
>  #endif
>  
> 
> 
> sqlite3's own build system (which is not available in qt) checks if 
> posix_fallocate() is available. I wonder if there is a special reason for 
> providing an option to use the built-in sqlite.

There was a bug in sqlite 3.7.17 with this, see
http://git.buildroot.net/buildroot/commit/package/sqlite?id=316f991729c423c9a49a955d3747ff31ad7a0068
It's fixed now, but a similar solution might be appropiate.
Newer uClibc versions might have posix_fallocate so excluding uClibc
might not be appropiate in the future.
Regards.
diff mbox

Patch

--- a/src/3rdparty/sqlite/sqlite3.c
+++ b/src/3rdparty/sqlite/sqlite3.c
@@ -22938,7 +22938,8 @@  SQLITE_PRIVATE const char *sqlite3OpcodeName(int i){
 /* Use posix_fallocate() if it is available
 */
 #if !defined(HAVE_POSIX_FALLOCATE) \
-      && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L)
+      && (_XOPEN_SOURCE >= 600 || _POSIX_C_SOURCE >= 200112L) \
+      && !defined(__UCLIBC__)
 # define HAVE_POSIX_FALLOCATE 1
 #endif