mirror of
https://github.com/monero-project/monero.git
synced 2025-03-12 09:28:28 +00:00
Avoid -march=native when reproducible builds are wanted
Distribution builds that intend to have verifiable binaries, set the SOURCE_DATE_EPOCH variable. Those builds should not default to -march=native so that verification builds can produce bit-identical results on other CPUs of the same architecture. See https://reproducible-builds.org/ for why this is good. This patch was done while working on reproducible builds for openSUSE.
This commit is contained in:
parent
a1eca8ca7e
commit
b1526e06e6
1 changed files with 4 additions and 0 deletions
|
@ -178,6 +178,10 @@ string(TOLOWER ${CMAKE_BUILD_TYPE} CMAKE_BUILD_TYPE_LOWER)
|
|||
# when ARCH is not set to an explicit identifier, cmake's builtin is used
|
||||
# to identify the target architecture, to direct logic in this cmake script.
|
||||
# Since ARCH is a cached variable, it will not be set on first cmake invocation.
|
||||
|
||||
if (NOT ARCH AND DEFINED ENV{SOURCE_DATE_EPOCH})
|
||||
set(ARCH "default")
|
||||
endif()
|
||||
if (NOT ARCH_ID)
|
||||
if (NOT ARCH OR ARCH STREQUAL "" OR ARCH STREQUAL "native" OR ARCH STREQUAL "default")
|
||||
if(CMAKE_SYSTEM_PROCESSOR STREQUAL "")
|
||||
|
|
Loading…
Reference in a new issue