代码之家  ›  专栏  ›  技术社区  ›  DevWithZachary

collect2:ld返回1退出状态-p4a zope2

  •  0
  • DevWithZachary  · 技术社区  · 12 年前

    我正在使用python为Android构建zope2,但最终出现以下错误:

    Leaving ARM enviromnent
    Skipped build_python
    Skipped build_pil
    Entering in ARM enviromnent
    Compiler found at /home/zachary/android-ndk-r8c/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin//arm-linux-androideabi-gcc
    Biglink create /home/zachary/python-for-android/build/libs/libpymodules.so library
    Biglink arguments:
     /home/zachary/python-for-android/build/objects/_arraysurfarray.so.o
     /home/zachary/python-for-android/build/objects/c_opengl_debug.so.o
     /home/zachary/python-for-android/build/objects/_MethodObject.so.o
     /home/zachary/python-for-android/build/objects/_android_sound.so.o
     /home/zachary/python-for-android/build/objects/key.so.o
     /home/zachary/python-for-android/build/objects/pixelarray.so.o
     /home/zachary/python-for-android/build/objects/shader.so.o
     /home/zachary/python-for-android/build/objects/buffer.so.o
     /home/zachary/python-for-android/build/objects/cPickleCache.so.o
     /home/zachary/python-for-android/build/objects/stencil_instructions.so.o
     /home/zachary/python-for-android/build/objects/draw.so.o
     /home/zachary/python-for-android/build/objects/instructions.so.o
     /home/zachary/python-for-android/build/objects/TimeStamp.so.o
     /home/zachary/python-for-android/build/objects/gfxdraw.so.o
     /home/zachary/python-for-android/build/objects/fbo.so.o
     /home/zachary/python-for-android/build/objects/_android.so.o
     /home/zachary/python-for-android/build/objects/opengl_utils.so.o
     /home/zachary/python-for-android/build/objects/_event.so.o
     /home/zachary/python-for-android/build/objects/transformation.so.o
     /home/zachary/python-for-android/build/objects/_proxy.so.o
     /home/zachary/python-for-android/build/objects/surface.so.o
     /home/zachary/python-for-android/build/objects/_IOBTree.so.o
     /home/zachary/python-for-android/build/objects/display.so.o
     /home/zachary/python-for-android/build/objects/_initgroups.so.o
     /home/zachary/python-for-android/build/objects/_LOBTree.so.o
     /home/zachary/python-for-android/build/objects/transform.so.o
     /home/zachary/python-for-android/build/objects/_imagingmath.so.o
     /home/zachary/python-for-android/build/objects/_Record.so.o
     /home/zachary/python-for-android/build/objects/_IIBTree.so.o
     /home/zachary/python-for-android/build/objects/vertex.so.o
     /home/zachary/python-for-android/build/objects/gl_instructions.so.o
     /home/zachary/python-for-android/build/objects/_zope_interface_coptimizations.so.o
     /home/zachary/python-for-android/build/objects/opengl.so.o
     /home/zachary/python-for-android/build/objects/_ExtensionClass.so.o
     /home/zachary/python-for-android/build/objects/properties.so.o
     /home/zachary/python-for-android/build/objects/_Persistence.so.o
     /home/zachary/python-for-android/build/objects/surflock.so.o
     /home/zachary/python-for-android/build/objects/texture.so.o
     /home/zachary/python-for-android/build/objects/_zope_security_checker.so.o
     /home/zachary/python-for-android/build/objects/joystick.so.o
     /home/zachary/python-for-android/build/objects/_OIBTree.so.o
     /home/zachary/python-for-android/build/objects/_LLBTree.so.o
     /home/zachary/python-for-android/build/objects/_zope_i18nmessageid_message.so.o
     /home/zachary/python-for-android/build/objects/context_instructions.so.o
     /home/zachary/python-for-android/build/objects/_IFBTree.so.o
     /home/zachary/python-for-android/build/objects/_fsBTree.so.o
     /home/zachary/python-for-android/build/objects/_MultiMapping.so.o
     /home/zachary/python-for-android/build/objects/font.so.o
     -lsdl_ttf
     /home/zachary/python-for-android/build/objects/base.so.o
     /home/zachary/python-for-android/build/objects/_OOBTree.so.o
     /home/zachary/python-for-android/build/objects/vbo.so.o
     /home/zachary/python-for-android/build/objects/event.so.o
     /home/zachary/python-for-android/build/objects/_ComputedAttribute.so.o
     /home/zachary/python-for-android/build/objects/imageext.so.o
     -lsdl_image
     -lpng
     /home/zachary/python-for-android/build/objects/cdrom.so.o
     /home/zachary/python-for-android/build/objects/_zope_container_contained.so.o
     /home/zachary/python-for-android/build/objects/color.so.o
     /home/zachary/python-for-android/build/objects/_android_billing.so.o
     /home/zachary/python-for-android/build/objects/constants.so.o
     /home/zachary/python-for-android/build/objects/rwobject.so.o
     /home/zachary/python-for-android/build/objects/_Acquisition.so.o
     /home/zachary/python-for-android/build/objects/cPersistence.so.o
     /home/zachary/python-for-android/build/objects/context.so.o
     /home/zachary/python-for-android/build/objects/vertex_instructions.so.o
     /home/zachary/python-for-android/build/objects/bufferproxy.so.o
     /home/zachary/python-for-android/build/objects/image.so.o
     /home/zachary/python-for-android/build/objects/_LFBTree.so.o
     /home/zachary/python-for-android/build/objects/rect.so.o
     /home/zachary/python-for-android/build/objects/mask.so.o
     /home/zachary/python-for-android/build/objects/cAccessControl.so.o
     /home/zachary/python-for-android/build/objects/overlay.so.o
     /home/zachary/python-for-android/build/objects/jnius.so.o
     -Llibs/armeabi
     -llog
     /home/zachary/python-for-android/build/objects/_imaging.so.o
     -L/home/zachary/python-for-android/src/obj/local/armeabi
     -L/home/zachary/android-ndk-r8c/platforms/android-14/arch-arm/usr/lib
     -ljpeg
     /home/zachary/python-for-android/build/objects/time.so.o
     /home/zachary/python-for-android/build/objects/fastevent.so.o
     /home/zachary/python-for-android/build/objects/okascore.so.o
     /home/zachary/python-for-android/build/objects/compiler.so.o
     -lGLESv2
     /home/zachary/python-for-android/build/objects/_Missing.so.o
     /home/zachary/python-for-android/build/objects/cDocumentTemplate.so.o
     /home/zachary/python-for-android/build/objects/_zope_proxy_proxy.so.o
     /home/zachary/python-for-android/build/objects/mouse.so.o
     -L/home/zachary/python-for-android/src/obj/local/armeabi/
     -lz
     -L/home/zachary/python-for-android/build/python-install/lib
     -lsdl
     -lpython2.7
     /home/zachary/python-for-android/build/objects/_OLBTree.so.o
     /home/zachary/python-for-android/build/objects/stopper.so.o
     -lm
     -L/home/zachary/python-for-android/build/libs
    /home/zachary/python-for-android/build/objects/_LOBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_LOBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_IIBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_IIBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_OIBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_OIBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_LLBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_LLBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_IFBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_IFBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_fsBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_fsBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_OOBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_OOBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/cPersistence.so.o: In function `ring_move_to_head':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:55: multiple definition of `ring_move_to_head'
    /home/zachary/python-for-android/build/objects/cPickleCache.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:55: first defined here
    /home/zachary/python-for-android/build/objects/cPersistence.so.o: In function `ring_add':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:38: multiple definition of `ring_add'
    /home/zachary/python-for-android/build/objects/cPickleCache.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:38: first defined here
    /home/zachary/python-for-android/build/objects/cPersistence.so.o: In function `ring_del':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:46: multiple definition of `ring_del'
    /home/zachary/python-for-android/build/objects/cPickleCache.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/persistent/ring.c:46: first defined here
    /home/zachary/python-for-android/build/objects/_LFBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_LFBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    /home/zachary/python-for-android/build/objects/_zope_proxy_proxy.so.o: In function `init_zope_proxy_proxy':
    /tmp/easy_install-pE3zst/zope.proxy-3.6.1/src/zope/proxy/_zope_proxy_proxy.c:1120: multiple definition of `init_zope_proxy_proxy'
    /home/zachary/python-for-android/build/objects/_zope_container_contained.so.o:/tmp/easy_install-yJWap3/zope.container-3.11.2/src/zope/container/_zope_proxy_proxy.c:1074: first defined here
    /home/zachary/python-for-android/build/objects/_zope_proxy_proxy.so.o: In function `WrapperType_Lookup':
    /tmp/easy_install-pE3zst/zope.proxy-3.6.1/src/zope/proxy/_zope_proxy_proxy.c:154: multiple definition of `WrapperType_Lookup'
    /home/zachary/python-for-android/build/objects/_zope_container_contained.so.o:/tmp/easy_install-yJWap3/zope.container-3.11.2/src/zope/container/_zope_proxy_proxy.c:154: first defined here
    /home/zachary/python-for-android/build/objects/_OLBTree.so.o: In function `init_persist_type':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: multiple definition of `init_persist_type'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeModuleTemplate.c:455: first defined here
    /home/zachary/python-for-android/build/objects/_OLBTree.so.o: In function `get_bucket_state':
    /tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: multiple definition of `get_bucket_state'
    /home/zachary/python-for-android/build/objects/_IOBTree.so.o:/tmp/easy_install-mi1nSH/ZODB3-3.10.5/src/BTrees/BTreeTemplate.c:1150: first defined here
    collect2: ld returned 1 exit status
    zachary@zachary-VirtualBox:~/python-for-android$ 
    

    为了达到这一点(从而复制错误/问题),我必须执行以下操作:

    • 在本例中使用32位Build环境Ubutu 13.10
    • 使用此配方构建Zope2:

    !/bin/bash

    VERSION_zope2=${VERSION_zope2:-2.13}
    URL_zope2=http://github.com/zopefoundation/Zope/archive/$VERSION_zope2.zip
    BUILD_zope2=$BUILD_PATH/zope2/$(get_directory $URL_zope2)
    RECIPE_zope2=$RECIPES_PATH/zope2
    
    function prebuild_zope2() {
        true
    }
    
    function build_zope2() {
        cd $BUILD_zope2
    
        push_arm
    
        export LDFLAGS="$LDFLAGS -L$LIBS_PATH"
        export LDSHARED="$LIBLINK"
    
        HOSTPYTHON=/home/zac/Documents/Projects/Apps/python-for-android/build/hostpython/Python-2.7.2/hostpython
        try $HOSTPYTHON bootstrap.py
        try bin/buildout
    
        unset LDSHARED
        pop_arm
    }
    
    function postbuild_zope2() {
        true
    }
    
    • 通过执行以下操作修复Zope2和_SSL的错误:

      python for android/build/hostpython/python-2.72/Lib-ln-s/构建/lib.linux-x86_64-2.7平台-linux3

    然后一切都应该建立到上面的点

    1 回复  |  直到 12 年前
        1
  •  0
  •   Marco Mariani    12 年前

    biglink脚本基本上从build/objects/*so.o中找到的所有内容创建一个库

    但是zope对象有时会定义相同的符号,例如,这是 _IFBTree.c :

    /* IFBTree - int key, float value BTree
    
       Implements a collection using int type keys
       and float type values
    */
    
    /* Setup template macros */
    
    #define PERSISTENT
    
    #define MOD_NAME_PREFIX "IF"
    
    #define DEFAULT_MAX_BUCKET_SIZE 120
    #define DEFAULT_MAX_BTREE_SIZE 500
    
    #include "_compat.h"
    #include "intkeymacros.h"
    #include "floatvaluemacros.h"
    
    #ifdef PY3K
    #define INITMODULE PyInit__IFBTree
    #else
    #define INITMODULE init_IFBTree
    #endif
    #include "BTreeModuleTemplate.c"
    

    和 _IIBTree.c :

    /* IIBTree - int key, int value BTree
    
       Implements a collection using int type keys
       and int type values
    */
    
    /* Setup template macros */
    
    #define PERSISTENT
    
    #define MOD_NAME_PREFIX "II"
    
    #define DEFAULT_MAX_BUCKET_SIZE 120
    #define DEFAULT_MAX_BTREE_SIZE 500
    
    #include "_compat.h"
    #include "intkeymacros.h"
    #include "intvaluemacros.h"
    
    #ifdef PY3K
    #define INITMODULE PyInit__IIBTree
    #else
    #define INITMODULE init_IIBTree
    #endif
    #include "BTreeModuleTemplate.c"
    

    如您所见,两者都包括 BTreeModuleTemplate.c ,因此,如果将生成的.o文件合并在一起,函数之间的名称冲突是不可避免的。

    在这种情况下,可以从生成的库中排除冲突对象:

    diff --git a/src/tools/biglink b/src/tools/biglink
    index 1f82d18..7b05fb5 100755
    --- a/src/tools/biglink
    +++ b/src/tools/biglink
    @@ -7,9 +7,24 @@ import subprocess
    
     sofiles = [ ]
    
    +blacklist = [
    +    '_LOBTree.so', '_LLBTree.so', 'cPersistence.so', '_zope_', 'cPickleCache.so',
    +    '_LFBTree.so', '_OOBTree.so', '_IIBTree.so', '_OLBTree.so', '_IFBTree.so',
    +    '_IOBTree.so', '_fsBTree.so',
    +]
    +
    +def is_blacklisted(fn):
    +    for name in blacklist:
    +        if fn.startswith(name):
    +            return True
    +    return False
    +
    +
     for directory in sys.argv[2:]:
    
         for fn in os.listdir(directory):
    +        if is_blacklisted(fn):
    +            continue
             fn = os.path.join(directory, fn)
    
             if not fn.endswith(".so.o"):
    
    推荐文章