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 C#算法问题, 不知道怎么处理这个数据的转换
  • ¥15 YoloV5 第三方库的版本对照问题
  • ¥15 请完成下列相关问题!
  • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
  • ¥15 求daily translation(DT)偏差订正方法的代码
  • ¥15 js调用html页面需要隐藏某个按钮
  • ¥15 ads仿真结果在圆图上是怎么读数的
  • ¥20 Cotex M3的调试和程序执行方式是什么样的?
  • ¥20 java项目连接sqlserver时报ssl相关错误
  • ¥15 一道python难题3