GNU make - 切换到不同版本会影响构建输出吗?

GNU make - could switching to diff version affect build output?

我目前正在使用 GNU Make 3.81 --jobs=1 但正在尝试迁移到 GNU Make 4.2.1 --jobs=X 即多线程。

makefile、环境等一切其他完全相同。

问题

.obj 或任何工件是否可能不同?

更新

假设 makefile 在逻辑上是正确的,这意味着所有依赖项都已正确且彻底地指定,即它们是 "parallel-correct"

如果你的 Makefiles 并行正确,差异就不会来自那里。

但是,使用不同版本的 make 会导致不同的作品。有成百上千的原因,特别是对于从一个版本到另一个版本的如此长的跳跃。这是一个示例,来自版本 3.82 的发行说明:

* WARNING: Backward-incompatibility!
  The library search behavior has changed to be compatible with the standard
  linker behavior. Prior to this version for prerequisites specified using
  the -lfoo syntax make first searched for libfoo.so in the current
  directory, vpath directories, and system directories. If that didn't yield
  a match, make then searched for libfoo.a in these directories. Starting
  with this version make searches first for libfoo.so and then for libfoo.a
  in each of these directories in order.

因此,使用 3.82 版而不是 3.81 版会导致您的链接器使用不同的库文件,从而生成不同的二进制文件。

列出 3.81 和 4.2.1 之间所有类似的可能性将是一项艰巨的任务。