VirtualBox

vbox的更動 44473 路徑 trunk/src/bldprogs


忽略:
時間撮記:
2013-1-30 下午04:37:38 (12 年 以前)
作者:
vboxsync
訊息:

Additions/x11: rework checking missing symbols in the X server drivers and do not accept libc etc. symbols in the XFree86 ones.

檔案:
修改 1 筆資料

圖例:

未更動
新增
刪除
  • trunk/src/bldprogs/checkUndefined.sh

    r43257 r44473  
    1515#
    1616# Compare undefined symbols in a shared or static object against a new-line
    17 # separated list of grep patterns in a text file.
     17# separated list of grep patterns in a set of text files and complain if
     18# symbols are found which aren't in the files.
    1819#
    19 # Usage: /bin/sh <script name> <object> <allowed undefined symbols> [--static]
     20# Usage: /bin/sh <script name> <object> [--static] <undefined symbol file...>
    2021#
    21 # Currently only works for native objects on Linux platforms
     22# Currently only works for native objects on Linux (and Solaris?) platforms.
    2223#
    2324
     
    2728}
    2829
    29 hostos=$1
    30 target=$2
    31 symbols=$3
    32 static=$4
    33 
    34 if test $# -lt 3 || test $# -gt 4 || test ! -r "$target" || test ! -r "$symbols"; then
    35   if test ! -r "$target"; then
    36     echoerr "$0: '$target' not readable"
    37   elif test ! -r "$symbols"; then
    38     echoerr "$0: '$symbols' not readable"
    39   else
    40     echoerr "$0: Wrong number of arguments"
    41   fi
    42   args_ok="no"
     30hostos="${1}"
     31target="${2}"
     32shift 2
     33if test "${1}" = "--static"; then
     34    static="${1}"
     35    shift
    4336fi
    4437
    45 if test $# -eq 4 && test "$static" != "--static"; then
    46   args_ok="no"
     38if test $# -lt 1; then
     39    echoerr "${0}: Wrong number of arguments"
     40    args_ok="no"
    4741fi
     42if test ! -r "${target}"; then
     43    echoerr "${0}: '${target}' not readable"
     44    args_ok="no"
     45fi
     46for i in "${@}"; do
     47    if test ! -r "${i}"; then
     48        echoerr "${0}: '${i}' not readable"
     49        args_ok="no"
     50    fi
     51done
    4852
    4953if test "$args_ok" = "no"; then
    50   echoerr "Usage: $0 <object> <allowed undefined symbols> [--static]"
     54  echoerr "Usage: $0 <object> [--static] <undefined symbol file...>"
    5155  exit 1
    5256fi
     
    6872fi
    6973
    70 if test ! -x "$objdumpbin"; then
    71     echoerr "$0: '$objdumpbin' not found or not executable."
     74if test ! -x "${objdumpbin}"; then
     75    echoerr "${0}: '${objdumpbin}' not found or not executable."
    7276    exit 1
    7377fi
    7478
    75 undefined=`$objdumpbin $command $target | $grepbin '*UND*' | $grepbin -v -f $symbols | kmk_sed -e 's/^.*[[:blank:]]\(.*\)/\1/'`
     79undefined=`"${objdumpbin}" ${command} "${target}" | kmk_sed -n 's/.*\*UND\*.*\s\([:graph:]*\)/\1/p'`
     80for i in "${@}"; do
     81    undefined=`echo "${undefined}" | "${grepbin}" -v -f "${i}"`
     82done
    7683num_undef=`echo $undefined | wc -w`
    7784
    7885if test $num_undef -ne 0; then
    79   echoerr "$0: following symbols not defined in $symbols:"
    80   echoerr "$undefined"
     86  echoerr "${0}: following symbols not defined in the files ${@}:"
     87  echoerr "${undefined}"
    8188  exit 1
    8289fi
注意: 瀏覽 TracChangeset 來幫助您使用更動檢視器

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette