Store build_date in .tizen.build-id section to avoid unnecessary rebuilds 46/86146/1 accepted/tizen/common/20160831.162119 accepted/tizen/ivi/20160901.065307 accepted/tizen/mobile/20160901.065050 accepted/tizen/tv/20160901.065143 accepted/tizen/wearable/20160901.065220 submit/tizen/20160831.052250
authorJunghyun Kim <jh0822.kim@samsung.com>
Tue, 30 Aug 2016 10:56:02 +0000 (19:56 +0900)
committerMinje Ahn <minje.ahn@samsung.com>
Tue, 30 Aug 2016 23:55:08 +0000 (08:55 +0900)
- 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 <jh0822.kim@samsung.com>
cmdutils.c

index 3415c0f..d265f9c 100644 (file)
@@ -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);