微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

带有 -m16 标志的 GCC 无法编译

如何解决带有 -m16 标志的 GCC 无法编译

我使用的是 Debian 操作系统:

x@y:~$ uname -a
Linux clunasvm 4.19.0-13-amd64 #1 SMP Debian 4.19.160-2 (2020-11-28) x86_64 GNU/Linux

和海湾合作委员会:

x@y:~$ gcc --version
gcc (Debian 8.3.0-6) 8.3.0
copyright (C) 2018 Free Software Foundation,Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or fitness FOR A PARTIculaR PURPOSE.

我有一个 Hello World C++ 应用程序,我想用 -m16 标志编译它以生成 16 位代码。当我向编译器添加标志时,代码不会编译:

g++ -O0 -g3 -Wall -c -fmessage-length=0 -m16 -MMD -MP -MF"src/test.d" -MT"src/test.o" -o "src/test.o" "../src/test.cpp"
In file included from /usr/include/features.h:448,from /usr/include/x86_64-linux-gnu/c++/8/bits/os_defines.h:39,from /usr/include/x86_64-linux-gnu/c++/8/bits/c++config.h:508,from /usr/include/c++/8/iostream:38,from ../src/test.cpp:9:
/usr/include/x86_64-linux-gnu/gnu/stubs.h:7:11: Fatal error: gnu/stubs-32.h: No such file or directory
 # include <gnu/stubs-32.h>
           ^~~~~~~~~~~~~~~~
compilation terminated.

我还缺少什么才能在 x86-64 机器上生成基于 16 位的代码?我需要这个的原因是为了在代码中模拟 16 位 cpu 行为。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。