mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2025-01-31 12:41:49 +01:00
Remove LLVM_ENABLE_TIMESTAMPS
Summary: As per the discussion on LLVM-dev this patch proposes removing LLVM_ENABLE_TIMESTAMPS. The only complicated bit of this patch is the Windows support. On windows we used to log an error if /INCREMENTAL was passed to the linker when timestamps were disabled. With this change since timestamps in code are always disabled we will always compile on windows with /Brepro unless /INCREMENTAL is specified, and we will log a warning when /INCREMENTAL is specified to notify the user that the build will be non-deterministic. See: http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html Reviewers: bogner, silvas, rnk Subscribers: llvm-commits Differential Revision: http://reviews.llvm.org/D19892 llvm-svn: 268670
This commit is contained in:
parent
69d6307407
commit
64aa95c1c8
@ -249,11 +249,6 @@ set(LLVM_EXPERIMENTAL_TARGETS_TO_BUILD ""
|
|||||||
option(BUILD_SHARED_LIBS
|
option(BUILD_SHARED_LIBS
|
||||||
"Build all libraries as shared libraries instead of static" OFF)
|
"Build all libraries as shared libraries instead of static" OFF)
|
||||||
|
|
||||||
option(LLVM_ENABLE_TIMESTAMPS "Enable embedding timestamp information in build" OFF)
|
|
||||||
if(LLVM_ENABLE_TIMESTAMPS)
|
|
||||||
set(ENABLE_TIMESTAMPS 1)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
option(LLVM_ENABLE_BACKTRACES "Enable embedding backtraces on crash." ON)
|
option(LLVM_ENABLE_BACKTRACES "Enable embedding backtraces on crash." ON)
|
||||||
if(LLVM_ENABLE_BACKTRACES)
|
if(LLVM_ENABLE_BACKTRACES)
|
||||||
set(ENABLE_BACKTRACES 1)
|
set(ENABLE_BACKTRACES 1)
|
||||||
|
@ -365,17 +365,15 @@ if( MSVC )
|
|||||||
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT LLVM_ENABLE_TIMESTAMPS AND CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
|
||||||
# clang-cl and cl by default produce non-deterministic binaries because
|
# clang-cl and cl by default produce non-deterministic binaries because
|
||||||
# link.exe /incremental requires a timestamp in the .obj file. clang-cl
|
# link.exe /incremental requires a timestamp in the .obj file. clang-cl
|
||||||
# has the flag /Brepro to force deterministic binaries, so pass that when
|
# has the flag /Brepro to force deterministic binaries. We want to pass that
|
||||||
# LLVM_ENABLE_TIMESTAMPS is turned off.
|
# whenever you're building with clang unless you're passing /incremental.
|
||||||
# This checks CMAKE_CXX_COMPILER_ID in addition to check_cxx_compiler_flag()
|
# This checks CMAKE_CXX_COMPILER_ID in addition to check_cxx_compiler_flag()
|
||||||
# because cl.exe does not emit an error on flags it doesn't understand,
|
# because cl.exe does not emit an error on flags it doesn't understand,
|
||||||
# letting check_cxx_compiler_flag() claim it understands all flags.
|
# letting check_cxx_compiler_flag() claim it understands all flags.
|
||||||
check_cxx_compiler_flag("/Brepro" SUPPORTS_BREPRO)
|
check_cxx_compiler_flag("/Brepro" SUPPORTS_BREPRO)
|
||||||
append_if(SUPPORTS_BREPRO "/Brepro" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
|
||||||
|
|
||||||
if (SUPPORTS_BREPRO)
|
if (SUPPORTS_BREPRO)
|
||||||
# Check if /INCREMENTAL is passed to the linker and complain that it
|
# Check if /INCREMENTAL is passed to the linker and complain that it
|
||||||
# won't work with /Brepro.
|
# won't work with /Brepro.
|
||||||
@ -383,14 +381,13 @@ if( MSVC )
|
|||||||
string(TOUPPER "${CMAKE_MODULE_LINKER_FLAGS}" upper_module_flags)
|
string(TOUPPER "${CMAKE_MODULE_LINKER_FLAGS}" upper_module_flags)
|
||||||
string(TOUPPER "${CMAKE_SHARED_LINKER_FLAGS}" upper_shared_flags)
|
string(TOUPPER "${CMAKE_SHARED_LINKER_FLAGS}" upper_shared_flags)
|
||||||
|
|
||||||
string(FIND "${upper_exe_flags}" "/INCREMENTAL" exe_index)
|
string(FIND "${upper_exe_flags} ${upper_module_flags} ${upper_shared_flags}"
|
||||||
string(FIND "${upper_module_flags}" "/INCREMENTAL" module_index)
|
"/INCREMENTAL" linker_flag_idx)
|
||||||
string(FIND "${upper_shared_flags}" "/INCREMENTAL" shared_index)
|
|
||||||
|
|
||||||
if (${exe_index} GREATER -1 OR
|
if (${linker_flag_idx} GREATER -1)
|
||||||
${module_index} GREATER -1 OR
|
message(WARNING "/Brepro not compatible with /INCREMENTAL linking - builds will be non-deterministic")
|
||||||
${shared_index} GREATER -1)
|
else()
|
||||||
message(FATAL_ERROR "LLVM_ENABLE_TIMESTAMPS not compatible with /INCREMENTAL linking")
|
append("/Brepro" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
@ -456,9 +453,7 @@ elseif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
|
|||||||
endif()
|
endif()
|
||||||
endif (LLVM_ENABLE_WARNINGS)
|
endif (LLVM_ENABLE_WARNINGS)
|
||||||
append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
append_if(LLVM_ENABLE_WERROR "-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
|
||||||
if (NOT LLVM_ENABLE_TIMESTAMPS)
|
add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
|
||||||
add_flag_if_supported("-Werror=date-time" WERROR_DATE_TIME)
|
|
||||||
endif ()
|
|
||||||
if (LLVM_ENABLE_CXX1Y)
|
if (LLVM_ENABLE_CXX1Y)
|
||||||
check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
|
check_cxx_compiler_flag("-std=c++1y" CXX_SUPPORTS_CXX1Y)
|
||||||
append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
|
append_if(CXX_SUPPORTS_CXX1Y "-std=c++1y" CMAKE_CXX_FLAGS)
|
||||||
|
@ -16,9 +16,6 @@
|
|||||||
/* Define if position independent code is enabled */
|
/* Define if position independent code is enabled */
|
||||||
#cmakedefine ENABLE_PIC
|
#cmakedefine ENABLE_PIC
|
||||||
|
|
||||||
/* Define if timestamp information (e.g., __DATE__) is allowed */
|
|
||||||
#cmakedefine ENABLE_TIMESTAMPS ${ENABLE_TIMESTAMPS}
|
|
||||||
|
|
||||||
/* Define to 1 if you have the `arc4random' function. */
|
/* Define to 1 if you have the `arc4random' function. */
|
||||||
#cmakedefine HAVE_DECL_ARC4RANDOM ${HAVE_DECL_ARC4RANDOM}
|
#cmakedefine HAVE_DECL_ARC4RANDOM ${HAVE_DECL_ARC4RANDOM}
|
||||||
|
|
||||||
|
@ -1775,9 +1775,6 @@ public:
|
|||||||
if (CPU == "generic")
|
if (CPU == "generic")
|
||||||
CPU = "(unknown)";
|
CPU = "(unknown)";
|
||||||
OS << ".\n"
|
OS << ".\n"
|
||||||
#if (ENABLE_TIMESTAMPS == 1)
|
|
||||||
<< " Built " << __DATE__ << " (" << __TIME__ << ").\n"
|
|
||||||
#endif
|
|
||||||
<< " Default target: " << sys::getDefaultTargetTriple() << '\n'
|
<< " Default target: " << sys::getDefaultTargetTriple() << '\n'
|
||||||
<< " Host CPU: " << CPU << '\n';
|
<< " Host CPU: " << CPU << '\n';
|
||||||
}
|
}
|
||||||
|
@ -375,13 +375,13 @@ function configure_llvmCore() {
|
|||||||
echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
|
echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
|
||||||
cmake -G "Unix Makefiles" \
|
cmake -G "Unix Makefiles" \
|
||||||
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
|
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
|
||||||
-DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME="(timestamp not enabled)" \
|
-DLLVM_CONFIGTIME="(timestamp not enabled)" \
|
||||||
$ExtraConfigureFlags $BuildDir/llvm.src \
|
$ExtraConfigureFlags $BuildDir/llvm.src \
|
||||||
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
|
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
|
||||||
env CC="$c_compiler" CXX="$cxx_compiler" \
|
env CC="$c_compiler" CXX="$cxx_compiler" \
|
||||||
cmake -G "Unix Makefiles" \
|
cmake -G "Unix Makefiles" \
|
||||||
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
|
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
|
||||||
-DLLVM_ENABLE_TIMESTAMPS=OFF -DLLVM_CONFIGTIME="(timestamp not enabled)" \
|
-DLLVM_CONFIGTIME="(timestamp not enabled)" \
|
||||||
$ExtraConfigureFlags $BuildDir/llvm.src \
|
$ExtraConfigureFlags $BuildDir/llvm.src \
|
||||||
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
|
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
|
||||||
fi
|
fi
|
||||||
|
Loading…
x
Reference in New Issue
Block a user