gcc-arm-linux-gnueabi command not found

前端 未结 11 949
轮回少年
轮回少年 2020-12-13 00:50

I am trying to install the gnu arm toolchain for ubuntu. I first downloaded the tar from CodeSourcery. However when I go into the bin folder, I cannot run any of the binarie

11条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-13 01:27

    I had to cross compile C code in Ubuntu for ARM. This worked for me:

    $ sudo apt install gcc-arm-none-eabi

    Later, tested it on the qemu emulator

    #Install qemu
    sudo apt-get install qemu qemu-user-static qemu-system-arm
    
    #Cross compile "helloworld.c"
    $ arm-none-eabi-gcc --specs=rdimon.specs   -Wl,--start-group -lgcc -lc -lm -lrdimon -Wl,--end-group helloworld.c -o helloworld
    
    #Run
    qemu-arm-static helloworld
    
    

提交回复
热议问题