2

配置脚本的摘录由于Killed: 9 错误而失败,即 iOS 5 只能运行签名的应用程序。所以我需要找到一种方法ldid -s在这些测试中放置一些地方,唯一的问题是在哪里。

任何人???

失败了

checking build system compiler gcc... no
checking build system compiler gcc -g -O2 ... no
checking build system compiler cc... no
checking build system compiler gcc... no
checking build system compiler c89... no
checking build system compiler c99... no
configure: error: Cannot find a build system compiler

和 config.log

onfigure:15586: gcc -c -g -O2  conftest.c >&5
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking sys/time.h presence
configure:15586: gcc -E  conftest.c
configure:15586: $? = 0
configure:15586: result: yes
configure:15586: checking for sys/time.h
configure:15586: result: yes
configure:15677: checking build system compiler gcc
configure:15690: gcc conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27218 Killed: 9               ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no
configure:15677: checking build system compiler gcc -g -O2
configure:15690: gcc -g -O2  conftest.c
conftest.c: In function 'main':
conftest.c:4: warning: incompatible implicit declaration of built-in function 'exit'
configure:15693: $? = 0
./configure: line 15675: 27234 Killed: 9               ./a.out
./configure: line 15695: ./b.out: No such file or directory
./configure: line 15695: ./a.exe: No such file or directory
./configure: line 15695: ./a_out.exe: No such file or directory
./configure: line 15695: ./conftest: No such file or directory
configure:15700: result: no

最后是 ./configure 脚本..

if test -n "$CC_FOR_BUILD"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $CC_FOR_BUILD" >&5
    $as_echo_n "checking build system compiler $CC_FOR_BUILD... " >&6; }
    # remove anything that might look like compiler output to our "||" expression
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
    int
    main ()
    {
      exit(0);
    }
    EOF
    gmp_compile="$CC_FOR_BUILD conftest.c"
    cc_for_build_works=no
    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
      (eval $gmp_compile) 2>&5
      ac_status=$?
      $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
      test $ac_status = 0; }; then
      if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
        cc_for_build_works=yes
      fi
    fi
    rm -f conftest* a.out b.out a.exe a_out.exe
    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cc_for_build_works" >&5
    $as_echo "$cc_for_build_works" >&6; }
    if test "$cc_for_build_works" = yes; then
      :
    else
      as_fn_error $? "Specified CC_FOR_BUILD doesn't seem to work" "$LINENO" 5
    fi

    elif test -n "$HOST_CC"; then
      { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system compiler $HOST_CC" >&5
    $as_echo_n "checking build system compiler $HOST_CC... " >&6; }
    # remove anything that might look like compiler output to our "||" expression
    rm -f conftest* a.out b.out a.exe a_out.exe
    cat >conftest.c <<EOF
    int
    main ()
    {
      exit(0);
    }
4

1 回答 1

1

我不得不承认,除了最简单的 shell 脚本之外,我的阅读能力很差,但基本上,您需要在运行可执行文件之前对其进行伪造代码签名。看起来您要运行的可执行文件被称为conftest,对吗?因此,请尝试在此块中签名:

if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$gmp_compile\""; } >&5
  (eval $gmp_compile) 2>&5
  ac_status=$?
  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
  test $ac_status = 0; }; then

  #begin added code
  ldid -S ./conftest
  #end added code

  if (./a.out || ./b.out || ./a.exe || ./a_out.exe || ./conftest) >&5 2>&1; then
    cc_for_build_works=yes
  fi
fi

显然,ldid如果/usr/bin/ldid在现有的PATH.

更新:根据海报下面的评论,a.out实际上是需要签名的可执行文件,而不是conftest.

于 2012-09-16T20:59:08.710 回答