Edit Tools/build/src/tools/gcc.jam
Rule setup-threading (Targets *: sources *: Properties *)
{
Local threading = [feature.get-values Threading: $ (properties)];
If $ (threading) = Multi
{
Local target = [feature.get-values Target-os: $ (properties)];
Local option;
Local libs;
Switch $ (target)
{
Case Android: # No Threading Options, everything are in already.
Case windows:option =-mthreads;
Case cygwin:option =-mthreads;
Case solaris:option =-pthreads; libs = RT;
Case BeOS: # No threading Options.
Case haiku:option =;
Case *bsd:option =-pthread; # there is NO-LRT on BSD.
Case SGI: # gcc on IRIX does not support multi-threading.
Case Darwin: # No threading Options.
Case *: option =-pthread; #libs = RT;
}
Comment out the line libs = RT
------------------------------------------------------------------
Indeed all occurrencies of-lrt with sed doesn ' t seem to has any impact on the problem.
What worked for me (on boost 1.53.0 though) is the following:
Edit Tools/build/v2/tools/gcc.jam
Comment libs = RT; In this Code section (by the the-the-line, it could is, and does not has the-pthread option line):
Case *:
{
option =-pthread;
libs = RT; <--comment this line
}
Note:as Initial/brute Force solution, I would take the failed commands and manually run them removing-lrt from them.
Question
So I am trying to build boost 1.55 for Android, but I am getting linking errors for Boost.system and boost.atomic, that SA Y "Error:cannot find-lrt". Of course, Android doesn ' t has LIBRT because its built into the C runtime. So, I am trying to get boost so it won ' t link to librt. I tried just deleting every "-LRT" in the source code:
Find. -type F | Xargs-n1-p 8 sed-i "s/-lrt//g"
But I still get the same error. How does I make boost not link against Librt for Android?
Answer
Indeed all occurrencies of-lrt with sed doesn ' t seem to has any impact on the problem.
What worked for me (on boost 1.53.0 though) is the following:
Edit Tools/build/v2/tools/gcc.jam
Comment libs = RT; In this Code section (by the the-the-line, it could is, and does not has the-pthread option line):
Case *:
{
option =-pthread;
libs = RT; <--comment this line
}
Note:as Initial/brute Force solution, I would take the failed commands and manually run them removing-lrt from them.
Building Boost for Android with error "Cannot FIND-LRT"