From: Robert Yang Date: Tue, 8 Jan 2019 09:42:52 +0000 (+0800) Subject: glibc-site_2.28.bb: Add it for speeding up do_configure X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=625dc853b0c953a4e066d9088796886f6d0b5103;p=thirdparty%2Fopenembedded%2Fopenembedded-core-contrib.git 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 --- 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 00000000000..937209886c1 --- /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 00000000000..d80bb1fdd7f --- /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 00000000000..871466d77fb --- /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 00000000000..178bd85a00b --- /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 *