软件从x86移植到arm需要做什么?

I know that lately Microsoft is trying to help ARM getting into the Windows laptop market (and I personally think it’s good idea), but that so far most of the software available on Windows is designed only for x86 architecture, so any arm-based windows machine right now runs most of its programs inside an emulator.
What I don’t understand is why porting those applications into arm architecture would be so demanding. I guess most of them are written in C or C++, and only a few of them have parts written directly in assembly, so why isn’t it as simple as running a compiler’m studying C right now and I know some stuff can work differently depending on the machine you run the program into, and we’ve been taught to avoid writing machine dependent code if possible. But for the most part it looks like you can write a program in C and compile it for any machine supported by the compiler without too many worries (except for machines with strongly limited resources of course).
So where is the problem that prevents companies from porting their software into arm architectures it about some optimization problems, or is it because of some behaviours that may change when compiling for another architecture, requiring many efforts in debuggingp>

目前微软在尝试为windows laptop支持ARM,现在windows的方案是在x86里运行ARM的模拟器。
我不是很懂移植到ARM需要做什么工作,我感觉现在很多软件都是用C/C++写的,只有少数是汇编写的,所以是不是只要换个编译器就可以构建出ARM的软件了r> 所以,目前把软件一直到ARM的难点在哪里p>

Most c or c++ programs written for windows “just” need to be recompiled and tested on the new plafrom, as the compiler takes care of making the executable match the instruction set. As long as your compiler is able to target ARM, you can do this. So far, so good. However, virtually all real-world programs depend on vendor or open source libraries that would also have to be compiled on ARM. If even one of these libraries is not available on ARM, your software won’t work. If it’s an open souce library, you can try to rebuild it. if it’s a closed-source library, you’re stuck.

Programs written in languages that depend upon a runtime (e.g. Java, Python) to execute their bytecode or other intermediate language representation need that rumtime to have been ported to ARM in the same way that any other c or c++ program was. I don’t know the status of this. A google search indicated Java was ported.

If your compiler, all libraries, and runtimes all support ARM, it still takes time and money. At that point, you need to decide whether the returns are worth it.

windows的大多数软件只是需要重新编译并在新平台上测试就可以了,因为编译器会为代码寻找对应架构的指令集并翻译。你只需要只要把编译器换成目标平台ARM的编译器。然而,软件存在依赖的问题,假如说软件所依赖的上游软件/库没有转向ARM平台,或者他是闭源的,即使你把当前软件重新在ARM上编译,也没办法运行。

声明:本站部分文章及图片源自用户投稿,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2022年5月13日
下一篇 2022年5月13日

相关推荐