Rig*_*ory 5 architecture zsh apple-m1
我在尝试找到安装 m1 mac (darwin arm64) 之前出现的旧版本 npm 软件包的解决方法时遇到了这个命令
据我了解,这将尝试启动具有架构的 zsh 会话x86_64。(尽管arch再次运行会给我带来i386某种与x86_64我认为兼容的结果。)
但据我所知,架构在硬件中被定义为处理器芯片。要模拟不同的架构,您需要一些更重的软件,例如 virtualbox 或 qemu。
那么它arch -x86_64 zsh实际上是做什么的呢?它实际上模拟了不同的架构吗?
我尝试阅读这些man arch内容,但内容太多,我无法真正理解。
...
DESCRIPTION
The arch command with no arguments, displays the machine's architecture type.
The other use of the arch command is to run a selected architecture of a universal binary. A universal
binary contains code that can run on different architectures. By default, the operating system will select
the architecture that most closely matches the processor type. A 64-bit architecture is preferred over a
32-bit architecture on a 64-bit processor, while only 32-bit architectures can run on a 32-bit processor.
When the most natural architecture is unavailable, the operating system will try to pick another
architecture. On 64-bit processors, a 32-bit architecture is tried. Otherwise, no architecture is run, and
an error results.
The arch command can be used to alter the operating system's normal selection order. The most common use is
to select the 32-bit architecture on a 64-bit processor, even if a 64-bit architecture is available.
The arch_name argument must be one of the currently supported architectures:
i386 32-bit intel
x86_64 64-bit intel
x86_64h 64-bit intel (haswell)
arm64 64-bit arm
arm64e 64-bit arm (Apple Silicon)
...
Run Code Online (Sandbox Code Playgroud)
通用二进制文件包含多个单独的二进制文件。执行时,将选择最兼容的二进制文件来实际执行。
该arch命令只是通过显式选择要运行的命令来覆盖此自动选择。是否可以在当前平台上运行所选的可执行文件是另一回事。
如果您将通用二进制视为哈希表,那么arch只是查找操作。
| 归档时间: |
|
| 查看次数: |
6274 次 |
| 最近记录: |