GCC Cross compile to a i586 architecture (Vortex86DX)

后端 未结 1 492
独厮守ぢ
独厮守ぢ 2020-12-20 07:39

I have Ubuntu 12.01 with gcc 4.8.2 and would like to cross compile for the Vortex86DX CPU running an old 2.6.23 kernel.

I´m trying the following testing code:

<
相关标签:
1条回答
  • 2020-12-20 08:21

    I think the problem is the order of the command switches, i.e. the linker first discovers the dependencies (libgcc, libstdc++) and only then resolves them. If you give it -static-libgcc before it found the dependency then it will simply ignore it.

    the following works for me:

    $ g++ -m32 -march=i586 test.cpp -o test586 -static -static-libgcc -static-libstdc++
    $ ./test586 
    Hello world
    $ ldd test586 
    not a dynamic executable
    
    0 讨论(0)
提交回复
热议问题