Bug 13696 - 1.32+ tree fails to build on Android NDK due to missing librt
Summary: 1.32+ tree fails to build on Android NDK due to missing librt
Status: RESOLVED FIXED
Alias: None
Product: Busybox
Classification: Unclassified
Component: Other (show other bugs)
Version: 1.32.x
Hardware: Other Other
: P5 major
Target Milestone: ---
Assignee: unassigned
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-03-31 23:29 UTC by Chris Renshaw
Modified: 2021-04-14 19:43 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:


Attachments
Makefile.flags patch for the reported issue. (1.35 KB, patch)
2021-03-31 23:29 UTC, Chris Renshaw
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Renshaw 2021-03-31 23:29:43 UTC
Created attachment 8856 [details]
Makefile.flags patch for the reported issue.

The addition of librt to Makefile.flags in https://git.busybox.net/busybox/commit/?id=be5a505d771a77c640acc35ceaa470c80e62f954 broke NDK builds.

/home/chris/x-tools/arm-linux-androideabi-r15c-api21-unified/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld.bfd.exe: cannot find -lrt
collect2.exe: error: ld returned 1 exit status
Note: if build needs additional libraries, put them in CONFIG_EXTRA_LDLIBS.
Example: CONFIG_EXTRA_LDLIBS="pthread dl tirpc audit pam"
make: *** [Makefile:719: busybox_unstripped] Error 1

I noticed the -lcrypt check for Android in the same area, presumably for a similar issue where the needed calls are already in bionic, so here's a patch using the same methodology to fix -lrt.
Comment 1 Denys Vlasenko 2021-04-14 17:02:38 UTC
Applied, thanks
Comment 2 Chris Renshaw 2021-04-14 19:43:47 UTC
I see you simplified it! Looks good. Thanks!