简体   繁体   English

如何在64位Qt应用程序中使用32位汇编功能?

[英]How to use 32-bit Assembly functions in 64-bit Qt app?

I have written some arithmetic operations in Assembly *.s file in 32-bit architecture and I'd like to use them in Qt application built by Qt 5.10.1 GCC 64bit kit. 我已经在32位体系结构的Assembly * .s文件中编写了一些算术运算,我想在Qt 5.10.1 GCC 64位套件所构建的Qt应用程序中使用它们。 Creating a simple C++ program I used following command to build executable file: 创建一个简单的C ++程序,我使用以下命令来构建可执行文件:

g++ -o prog main.cpp float_operations.s -m32

Now I can't figure out how to emplace building *.s file into building process of Qt app to make functions from *.s file usable in my Qt app. 现在,我不知道如何将构建* .s文件放入Qt应用程序的构建过程中,以使来自* .s文件的功能在我的Qt应用程序中可用。

I've found some solutions to include x64 assembly files but in this case is strongly necessary for me to use 32-bit assembly :( 我发现一些解决方案可以包含x64汇编文件,但是在这种情况下,使用32位汇编:(

Thank you. 谢谢。

You have 3 options: 您有3种选择:

  • Rewrite the assembly to 64-bit (any language with a 64-bit assembler or compiler) so it can load into a 64-bit process. 将程序集重写为64位(使用64位汇编器或编译器的任何语言),以便可以将其加载到64位进程中。
  • Change the application to 32-bit so the 32-bit assembly can run in-process. 将应用程序更改为32位,以便32位程序集可以在进程中运行。
  • Run two processes, one 32-bit and one 64-bit, and use interprocess communication. 运行两个进程,一个32位和一个64位,并使用进程间通信。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM