From: Junghyun Kim Date: Tue, 30 Aug 2016 12:04:36 +0000 (+0900) Subject: Store build_date in .tizen.build-id section to avoid unnecessary rebuilds X-Git-Tag: submit/tizen/20160913.071022^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fheads%2Ftizen_4.0_tv;p=platform%2Fupstream%2Fpython-pycurl.git 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: Iae3d7ecff33b3a85f9052193335cbb73a802a295 Signed-off-by: Junghyun Kim --- diff --git a/src/pycurl.c b/src/pycurl.c index a17a23b..1bcd503 100644 --- a/src/pycurl.c +++ b/src/pycurl.c @@ -3410,6 +3410,8 @@ insint_m(PyObject *d, char *name, long value) insobj2(d, curlmultiobject_constants, name, v); } +__attribute__((__section__(".tizen.build-id"))) +static const char COMPILE_DATE[] = __DATE__ " " __TIME__; /* Initialization function for the module */ #if defined(PyMODINIT_FUNC) @@ -3450,7 +3452,7 @@ initpycurl(void) /* Add version strings to the module */ insstr(d, "version", curl_version()); - insstr(d, "COMPILE_DATE", __DATE__ " " __TIME__); + insstr(d, "COMPILE_DATE", COMPILE_DATE); insint(d, "COMPILE_PY_VERSION_HEX", PY_VERSION_HEX); insint(d, "COMPILE_LIBCURL_VERSION_NUM", LIBCURL_VERSION_NUM);