From 4f4333c6c52b654b01a297baae12b4897009b631 Mon Sep 17 00:00:00 2001 From: Junghyun Kim Date: Tue, 30 Aug 2016 19:56:02 +0900 Subject: [PATCH] Store build_date in .tizen.build-id section to avoid unnecessary rebuilds - PROBLEM We use OBS to build packages in Tizen. There is a mechanism not to rebuild if the result binary is the same. For example, there is a dependency graph: A->B->C. If A is modified, B would be built. If the result RPM of B is not changed, OBS does not trigger a build of C. To effectively use this mechanism, each packages make sure that the result binary should be the same if the input source is the same. This package uses __DATE__ and __TIME__ which make the result binary is different everytime it is built. To efficiently utilize OBS build mechanism and to modify the package as little as possible, I propose to store this macro in .tizen.build-id section. OBS build-compare tool does not check *.build-id section in the binary. Change-Id: Icc1b62f5f56506d64deae3a5fadabb82eca6f1e6 Signed-off-by: Junghyun Kim --- cmdutils.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/cmdutils.c b/cmdutils.c index 3415c0f..d265f9c 100644 --- a/cmdutils.c +++ b/cmdutils.c @@ -810,13 +810,18 @@ static void print_all_libs_info(int flags, int level) PRINT_LIB_INFO(swscale, SWSCALE, flags, level); } +__attribute__((__section__(".tizen.build-id"))) +static const char BUILD_DATE[] = __DATE__; +__attribute__((__section__(".tizen.build-id"))) +static const char BUILD_TIME[] = __TIME__; + void show_banner(void) { av_log(NULL, AV_LOG_INFO, "%s version " LIBAV_VERSION ", Copyright (c) %d-%d the Libav developers\n", program_name, program_birth_year, this_year); av_log(NULL, AV_LOG_INFO, " built on %s %s with %s\n", - __DATE__, __TIME__, CC_IDENT); + BUILD_DATE, BUILD_TIME, CC_IDENT); av_log(NULL, AV_LOG_VERBOSE, " configuration: " LIBAV_CONFIGURATION "\n"); print_all_libs_info(INDENT|SHOW_CONFIG, AV_LOG_VERBOSE); print_all_libs_info(INDENT|SHOW_VERSION, AV_LOG_VERBOSE); -- 2.7.4