Baloo employs the function malloc_trim(), which is not available non non-Linux systems, such as Mac OS X. It is used at least in ./src/xapian/xapiandatabase.cpp, where conditional code should be used for other platforms. Reproducible: Always Steps to Reproduce: 1. Try to compile baloo package Actual Results: Compilation breaks ./baloo-4.13.0/src/xapian/xapiandatabase.cpp:27:10: fatal error: 'malloc.h' file not found #include <malloc.h> or, by replacing <malloc.h> with <sys/malloc.h> :5: error: use of undeclared identifier 'malloc_trim' malloc_trim(0); Expected Results: Compilation finishing fine.
Provide a patch?
I am not in a position to provide a patch which is functionally equivalent, as the malloc_trim() function does not have direct analogs on other platforms. The attached patch ensures compilation by suppressing the function on other platforms.
Created attachment 86288 [details] Suppresses use of malloc_trim on non-GNU/Linux platforms
Git commit a1d2889e3128709eac833ad1660a595c773f4552 by Vishesh Handa. Committed on 12/05/2014 at 11:25. Pushed by vhanda into branch 'KDE/4.13'. XapianDB: We only need the headers for malloc_trim M +2 -0 src/xapian/xapiandatabase.cpp http://commits.kde.org/baloo/a1d2889e3128709eac833ad1660a595c773f4552
This conflicts with a similar change in the master branch to get around the same problem in FreeBSD. Refer to https://git.reviewboard.kde.org/r/117187/ and commit ad0c5818 of 15 May. Vishesh, please could you reconcile these changes?
In commit a1d2889e3128709eac833ad1660a595c773f4552, #include <unistd.h> needs to be kept outside the #ifdef. Otherwise the build fails on OS X 10.9 with use of undeclared identifier 'usleep'.