Bug 4553

Summary: cracklib: do_compile failed on RHEL5.8 in which glibc version less than 2.9
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Hongxu Jia <hongxu.jia>
Component: coreAssignee: Hongxu Jia <hongxu.jia>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: hongxu.jia, kai.kang, liezhi.yang, mark.hatle, meta.mr.watcher, meta.watcher, ning.zhang, Qi.Chen, sen.zhang, sgw, yi.zhao
Version: 1.5   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: ---

Description Hongxu Jia 2013-05-24 09:51:16 UTC
*env
Build Configuration:
BB_VERSION        = "1.19.0"
BUILD_SYS         = "x86_64-linux"
NATIVELSBSTRING   = "RedHatEnterpriseClient-5.8"
TARGET_SYS        = "i586-poky-linux"
MACHINE           = "qemux86"
DISTRO            = "poky"
DISTRO_VERSION    = "1.4+snapshot-20130524"
TUNE_FEATURES     = "m32 i586"
TARGET_FPU        = ""
meta              
meta-yocto        
meta-yocto-bsp    = "hongxu-0524:e8197722de1f6006ceae0d4266de91c1db7278e3"

Update python to 2.6
glibc's version: glibc-2.5-81

*problem
do_compile cracklib failed
...
| ../lib/.libs/libcrack.so: undefined reference to `be64toh'
| ../lib/.libs/libcrack.so: undefined reference to `htobe16'
| ../lib/.libs/libcrack.so: undefined reference to `htobe32'
| ../lib/.libs/libcrack.so: undefined reference to `htobe64'
| ../lib/.libs/libcrack.so: undefined reference to `be32toh'
| ../lib/.libs/libcrack.so: undefined reference to `be16toh'
| collect2: ld returned 1 exit status
...

*analysis
cracklib invokes C functions `be16toh/be32toh/be64toh/htobe16/htobe32/htobe64'
to fix endian issue on multi platform, but these functions are nonstandard
which were added to glibc in version 2.9. So do_compile failed while host's
glibc version < 2.9

*solution
Use standard `htons/htonl/ntohs/ntohl' instead. For the `be64toh/htobe64',
there is not similar functions, we define `ntohll/htonll' on local to replace.
Comment 1 Hongxu Jia 2013-05-30 03:23:49 UTC
There are two solution to fix this issue, and Mark Hatle's is better.

Merged into master:
http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=5a607c1e48c6921ceaf393cd71a36cf5ace2f3fa