EGLIBC於S3C2410 ARM SoC的體驗
標籤:
arm,
eglibc,
openembedded,
openmoko
稍早於「EGLIBC初探」提過CodeSourcery與諸多系統廠商合作,針對glibc的改進計畫 (自2.5版開始),實做出更適合Embedded環境的C Library實做 ── EGLIBC,前文也提及快速建構的script,而OpenEmbedded也正式納入對EGLIBC的支援。所以現在要建構與測試都可以相當快速,以下是參考的option groups組態:
具體的細節可參考Jim Blandy發表於mailing-list的文章「EGLIBC size measurements for option groups」,EGLIBC透過option groups可讓C runtime的建構更加模組化,可輕易挑選Embedded環境所需的特徵,大幅降低code size與memory footprint,以常見組態來說,後者相較於glibc縮減為85%。筆者實際在openmoko GTA01bv4硬體 (based on S3C2410 ARM SoC)測試,在Smartphone的使用情境中,free memory從原本58444 bytes (glibc) 增加到67404 bytes (eglibc),幅度達13%,功能卻沒有因此打折,這與uClibc或其他小型的C Runtime來說,是很大的優勢。jserv@venux:/home/moko/build$ cat ../org.openembedded.dev/packages/glibc/eglibc-svn/option-groups.config
# This file sets default values for all option group variables
# mentioned in option-groups.def; see that file for a description of
# each option group.
OPTION_EGLIBC_ADVANCED_INET6 = n
OPTION_EGLIBC_BSD = n
OPTION_EGLIBC_CATGETS = n
OPTION_EGLIBC_CHARSETS = n
OPTION_EGLIBC_DB_ALIASES = n
OPTION_EGLIBC_ENVZ = n
OPTION_EGLIBC_FSTAB = n
OPTION_EGLIBC_GETLOGIN = n
OPTION_EGLIBC_INET = y
OPTION_EGLIBC_LIBM = y
OPTION_EGLIBC_LOCALES = n
OPTION_EGLIBC_LOCALE_CODE = n
OPTION_EGLIBC_NIS = n
OPTION_EGLIBC_NSSWITCH = y
OPTION_EGLIBC_RCMD = n
OPTION_EGLIBC_SPAWN = n
OPTION_EGLIBC_SUNRPC = n
OPTION_EGLIBC_UTMP = y
OPTION_EGLIBC_UTMPX = n
OPTION_EGLIBC_WORDEXP = n
OPTION_POSIX_REGEXP = y
取得筆者建構的EGLIBC-based openmoko 2007.2 image:http://people.openmoko.org/jserv/images/