diff options
author | Robert Yang <liezhi.yang@windriver.com> | 2019-01-08 17:42:52 +0800 |
---|---|---|
committer | Robert Yang <liezhi.yang@windriver.com> | 2019-01-09 19:31:19 -0800 |
commit | 625dc853b0c953a4e066d9088796886f6d0b5103 (patch) | |
tree | bf32b34eba74936eb9de087842d7a9217179f157 /meta | |
parent | 237ed166f48b0e32684a5307d3b47b9485238ed9 (diff) | |
download | openembedded-core-contrib-625dc853b0c953a4e066d9088796886f6d0b5103.tar.gz |
glibc-site_2.28.bb: Add it for speeding up do_configure
* How to generate site_config/funcs:
- Do a world build and save autoconf cache values to a directory such as
/tmp/saved_ac_cv:
1) Add the following line to local.conf
MACHINE="qemux86"
EXTRA_OECONF_append = " --cache-file=/tmp/saved_ac_cv/${TARGET_ARCH}/${PN}-cache"
2) Do a world build
$ bitbake world
3) Find out the top 100 used functions, these functions are used by about more
than 20 recipes in a world build.
$ find /tmp/i586/ /tmp/qemux86/ -name '*_cache_config' -exec cat {} \; | \
grep '^ac_cv_func_' | awk -F= '{print $1}' | sed 's/^ac_cv_func_//' | \
sort | uniq -c | sort -n | awk '{print $2}' | tail -n 100 | sort -o /tmp/target_funcs
- Find out glibc functions
$ grep '^ ' /path/to/2.28-r0/build-i586-poky-linux/libc.map | sed -e 's/;/\n/g' | \
sed -e 's/^ *//g' -e '/^$/d' | sort -o /tmp/libc.map
- Get the common funcs in both /tmp/libc.map and /tmp/target_funcs
$ comm -1 -2 /tmp/libc.map /tmp/target_funcs > site_config/funcs
* How to generate site_config/headers:
- Find out the top 100 used headers, these functions are used by about more
than 20 recipes in a world build.
$ find /tmp/i586/ /tmp/qemux86/ -name '*_cache_config' -exec cat {} \; | \
grep '^ac_cv_header_' | awk -F= '{print $1}' | sed 's/^ac_cv_header_//' | \
sort | uniq -c | sort -n | awk '{print $2}' | tail -n 100 | sort -o /tmp/target_headers
- Find out glibc headers
$ find tmp/work/i586-poky-linux/glibc/2.28-r0/git/include/ -name '*.h' | \
sed -e 's#.*git/include/##' | sort -o /tmp/libc_headers_orig
$ cat /tmp/libc_headers_orig | sed -e 's#.*git/include/##' -e 's#/#_#g' -e 's#\.#_#g' | sort -o /tmp/libc_headers
$ comm -1 -2 /tmp/target_headers /tmp/libc_headers > /tmp/tr_headers
$ for i in `cat /tmp/libc_headers_orig`; do
i_tr=`echo $i | sed -e 's#.*git/include/##' -e 's#/#_#g' -e 's#\.#_#g'`
if grep -q -E "^$i_tr$" /tmp/tr_headers; then
echo $i
fi
done > site_config/headers
Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/recipes-core/glibc-site/glibc-site_2.28.bb | 21 | ||||
-rw-r--r-- | meta/recipes-core/glibc-site/site_config/funcs | 66 | ||||
-rw-r--r-- | meta/recipes-core/glibc-site/site_config/headers | 64 | ||||
-rw-r--r-- | meta/recipes-core/glibc-site/site_config/types | 21 |
4 files changed, 172 insertions, 0 deletions
diff --git a/meta/recipes-core/glibc-site/glibc-site_2.28.bb b/meta/recipes-core/glibc-site/glibc-site_2.28.bb new file mode 100644 index 0000000000..937209886c --- /dev/null +++ b/meta/recipes-core/glibc-site/glibc-site_2.28.bb @@ -0,0 +1,21 @@ +SUMMARY = "Create glibc site config for speeding up do_configure" + +# The LICENSE is the same as glibc +LICENSE = "GPLv2 & LGPLv2.1" +SECTION = "libs" + +INHIBIT_DEFAULT_DEPS = "1" + +DEPENDS = "virtual/${TARGET_PREFIX}gcc virtual/${TARGET_PREFIX}compilerlibs virtual/libc" + +inherit autotools nopackages + +do_compile() { + : +} + +do_install() { + : +} + +BBCLASSEXTEND = "nativesdk" diff --git a/meta/recipes-core/glibc-site/site_config/funcs b/meta/recipes-core/glibc-site/site_config/funcs new file mode 100644 index 0000000000..d80bb1fdd7 --- /dev/null +++ b/meta/recipes-core/glibc-site/site_config/funcs @@ -0,0 +1,66 @@ +bind_textdomain_codeset +clock_gettime +fcntl +fork +ftruncate +getaddrinfo +getcwd +geteuid +getgrgid_r +gethostbyname +getline +getopt_long_only +getpagesize +getpwuid_r +gettimeofday +getuid +localtime_r +mbrtowc +memcpy +memmove +mempcpy +memset +mkstemp +mmap +mprotect +nl_langinfo +pipe +poll +putenv +raise +readlink +realpath +select +setenv +setlocale +setresuid +sigaction +snprintf +socket +stpcpy +strcasecmp +strchr +strdup +strerror +strerror_r +strftime +strncasecmp +strndup +strnlen +strrchr +strstr +strtol +strtoul +symlink +sysconf +towlower +tsearch +unsetenv +vasprintf +vfork +vprintf +vsnprintf +waitpid +wcrtomb +wcslen +wcsnlen diff --git a/meta/recipes-core/glibc-site/site_config/headers b/meta/recipes-core/glibc-site/site_config/headers new file mode 100644 index 0000000000..871466d77f --- /dev/null +++ b/meta/recipes-core/glibc-site/site_config/headers @@ -0,0 +1,64 @@ +alloca.h +arpa/inet.h +byteswap.h +ctype.h +dirent.h +dlfcn.h +endian.h +errno.h +execinfo.h +fcntl.h +features.h +float.h +getopt.h +grp.h +iconv.h +inttypes.h +langinfo.h +libintl.h +limits.h +locale.h +malloc.h +math.h +memory.h +netdb.h +netinet/in.h +poll.h +pthread.h +pwd.h +search.h +signal.h +stdio_ext.h +stdlib.h +string.h +strings.h +stropts.h +sys/cdefs.h +sys/file.h +sys/ioctl.h +syslog.h +sys/mman.h +sys/param.h +sys/poll.h +sys/prctl.h +sys/resource.h +sys/select.h +sys/socket.h +sys/stat.h +sys/statvfs.h +sys/sysctl.h +sys/sysmacros.h +sys/time.h +sys/times.h +sys/types.h +sys/uio.h +sys/un.h +sys/utsname.h +sys/wait.h +sys/xattr.h +termios.h +time.h +unistd.h +utime.h +wchar.h +wctype.h diff --git a/meta/recipes-core/glibc-site/site_config/types b/meta/recipes-core/glibc-site/site_config/types new file mode 100644 index 0000000000..178bd85a00 --- /dev/null +++ b/meta/recipes-core/glibc-site/site_config/types @@ -0,0 +1,21 @@ +char +char * +double +float +int +long +long double +long int +long long +long long int +short +short int +signed char +unsigned char +unsigned int +unsigned long +unsigned long int +unsigned long long int +unsigned short +unsigned short int +void * |