gpt4 book ai didi

c++ - 二进制目标文件在每次构建中发生变化

转载 作者:塔克拉玛干 更新时间:2023-11-03 00:08:54 24 4
gpt4 key购买 nike

在每次构建时使用 G++ GNU 编译器进行编译时,在不更改源代码的情况下,我会得到一个不同的二进制目标文件。是否有编译选项每次都会给我相同的二进制文件。

最佳答案

从 GCC 手册页复制:

-frandom-seed=string
This option provides a seed that GCC uses when it would otherwise use random numbers. It is used to generate certain symbol names that have to be different in every compiled file. It is also used to place unique stamps in coverage data files and the object files that produce them. You can use the -frandom-seed option to produce reproducibly identical object files.

The string should be different for every file you compile.

关于c++ - 二进制目标文件在每次构建中发生变化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4140329/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com