Giter VIP home page Giter VIP logo

Comments (7)

LeiWang1999 avatar LeiWang1999 commented on May 31, 2024 2

在编译protobuf的时候加上,不是在umd这个工程的makefile里面加。

from zynq-nvdla.

LeiWang1999 avatar LeiWang1999 commented on May 31, 2024

以前有碰到过,当时是参考这个方案解决的:
https://blog.csdn.net/qq_30653631/article/details/107620137

from zynq-nvdla.

simam00 avatar simam00 commented on May 31, 2024

Hi @LeiWang1999,

I am trying to cross-compile Tengine using this cross compiler: https://releases.linaro.org/components/toolchain/binaries/7.3-2018.05/aarch64-linux-gnu/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu.tar.xz. I've cross-compiled the runtime, compiler and protobuf libraries, but when I build Tengine using the cross-compiler, it throws this error in linking the CXX shared library:

/home/simam/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: /home/simam/Senior_Proj/Tengine/source/device/opendla/lib/libprotobuf.a(message.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol _ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC /home/simam/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: /home/simam/Senior_Proj/Tengine/source/device/opendla/lib/libprotobuf.a(message.o)(.text.startup+0x30): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol _ZNSt8ios_base4InitD1Ev@@GLIBCXX_3.4'
/home/simam/Downloads/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status

I went through the blog you mentioned in your comment, but how would you go about fixing this error for a cross compiler?

from zynq-nvdla.

LeiWang1999 avatar LeiWang1999 commented on May 31, 2024

@simam00 I am sorry about that I didn't get that issue, I compiled all these libs on the aarch64 instead of cross-compilation

from zynq-nvdla.

yss-pku avatar yss-pku commented on May 31, 2024

我也碰到了这个问题,但是用上面这个方法没有解决,还是报同样的错误。

/usr/bin/ld: /Tengine/source/device/opendla/lib/libprotobuf.a(descriptor.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol _ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' can not be used when making a shared object; recompile with -fPIC
/usr/bin/ld: /Tengine/source/device/opendla/lib/libprotobuf.a(descriptor.o)(.text+0x8f8): unresolvable R_AARCH64_ADR_PREL_PG_HI21 relocation against symbol _ZNSs4_Rep20_S_empty_rep_storageE@@GLIBCXX_3.4' /usr/bin/ld: final link failed: Bad value collect2: error: ld returned 1 exit status source/CMakeFiles/tengine-lite.dir/build.make:6550: recipe for target 'source/libtengine-lite.so' failed gmake[3]: *** [source/libtengine-lite.so] Error 1 CMakeFiles/Makefile2:103: recipe for target 'source/CMakeFiles/tengine-lite.dir/all' failed gmake[2]: *** [source/CMakeFiles/tengine-lite.dir/all] Error 2 CMakeFiles/Makefile2:588: recipe for target 'examples/CMakeFiles/tm_classification_opendla.dir/rule' failed gmake[1]: *** [examples/CMakeFiles/tm_classification_opendla.dir/rule] Error 2 Makefile:279: recipe for target 'tm_classification_opendla' failed gmake: *** [tm_classification_opendla] Error 2

我看有人说加上-fPIC, 具体在makefile哪里加呢

from zynq-nvdla.

yss-pku avatar yss-pku commented on May 31, 2024

在编译protobuf的时候加上,不是在umd这个工程的makefile里面加。

感谢,已经解决!

from zynq-nvdla.

wei8171023 avatar wei8171023 commented on May 31, 2024

在编译protobuf的时候加上,不是在umd这个工程的makefile里面加。

感谢,已经解决!

请问你是怎么解决的呢?在makefile哪里加上-fPIC呢?

from zynq-nvdla.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.