dongpang2029 2015-01-08 13:15
浏览 1111
已采纳

Golang交叉编译:gccgo-无法识别的命令行选项`-marm`

I'm trying to compile a Go app for linux/arm and keep running into problems on my Ubuntu machine. When I run GOOS=linux GOARCH=arm go build in my source directory, I get tons of erorrs that are variations of:

# github.com/huin/mqtt

gccgo: error: unrecognized command line option `-marm`

Running gccgo --help informs me that options starting with -g, -f -m (and others) will be passed on to any sub-processes started by gccgo, so I don't know which process it's sending -marm to.

Any clues? Ubuntu 14.10 LTS, 64bit

  • 写回答

1条回答 默认 最新

  • dongnuo2879 2015-01-09 11:23
    关注

    So thanks to a clue by Dean, I've worked out the issue and solved it.

    The issue was caused by me installing Go via apt-get, then removing it (via apt-get), then installing Go from the golang website. There were still files left over from the first install, which were probably older versions and therefore didn't have support for the -marm flag.

    I was going to wipe my dev machine anyway, so I did, installed Ubuntu again, installed Go from the website (not via apt-get) and everything worked first time. If you don't want to wipe your machine, then just make sure to look around to see if there are version conflicts.

    I've been stung by this sort of thing before (when installing node.js via apt-get, realising it was many versions out of date, then removing, and installing node.js via source), so if anyone is reading this, be careful when installing software via apt-get, then upgrading, as you might have similar version issues like I did!

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3
  • ¥15 牛顿斯科特系数表表示
  • ¥15 arduino 步进电机
  • ¥20 程序进入HardFault_Handler
  • ¥15 oracle集群安装出bug
  • ¥15 关于#python#的问题:自动化测试