]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
glibc-site_2.28.bb: Add it for speeding up do_configure
authorRobert Yang <liezhi.yang@windriver.com>
Tue, 8 Jan 2019 09:42:52 +0000 (17:42 +0800)
committerRobert Yang <liezhi.yang@windriver.com>
Thu, 10 Jan 2019 03:31:19 +0000 (19:31 -0800)
commit625dc853b0c953a4e066d9088796886f6d0b5103
treebf32b34eba74936eb9de087842d7a9217179f157
parent237ed166f48b0e32684a5307d3b47b9485238ed9
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>
meta/recipes-core/glibc-site/glibc-site_2.28.bb [new file with mode: 0644]
meta/recipes-core/glibc-site/site_config/funcs [new file with mode: 0644]
meta/recipes-core/glibc-site/site_config/headers [new file with mode: 0644]
meta/recipes-core/glibc-site/site_config/types [new file with mode: 0644]