From patchwork Thu May 26 09:02:54 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Markos Chandras X-Patchwork-Id: 626626 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rFjq46SPJz9t3x for ; Thu, 26 May 2016 19:03:12 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id B810610682; Thu, 26 May 2016 02:03:10 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id BD8BB105E3 for ; Thu, 26 May 2016 02:03:09 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 1A0C2161128 for ; Thu, 26 May 2016 03:03:09 -0600 (MDT) X-ASG-Debug-ID: 1464253387-0b32373bb38aa90001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id Cxai49q0gA6Gfjxm (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Thu, 26 May 2016 03:03:07 -0600 (MDT) X-Barracuda-Envelope-From: mchandras@suse.de X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO mx2.suse.de) (195.135.220.15) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 26 May 2016 09:03:07 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at suse.de designates 195.135.220.15 as permitted sender) X-Barracuda-Apparent-Source-IP: 195.135.220.15 X-Barracuda-RBL-IP: 195.135.220.15 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id D341CAAF4; Thu, 26 May 2016 09:03:04 +0000 (UTC) X-CudaMail-Envelope-Sender: mchandras@suse.de From: Markos Chandras To: dev@openvswitch.org X-CudaMail-MID: CM-E1-525004775 X-CudaMail-DTE: 052616 X-CudaMail-Originating-IP: 195.135.220.15 Date: Thu, 26 May 2016 10:02:54 +0100 X-ASG-Orig-Subj: [##CM-E1-525004775##][PATCH] util: Drop 'date' and 'time' arguments from ovs_set_program_name Message-Id: <1464253374-4052-1-git-send-email-mchandras@suse.de> X-Mailer: git-send-email 2.8.2 X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1464253387 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 X-Barracuda-Spam-Score: 0.60 X-Barracuda-Spam-Status: No, SCORE=0.60 using global scores of TAG_LEVEL=3.5 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=4.0 tests=BSF_SC5_MJ1963, RDNS_NONE X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.3.29916 Rule breakdown below pts rule name description ---- ---------------------- -------------------------------------------------- 0.10 RDNS_NONE Delivered to trusted network by a host with no rDNS 0.50 BSF_SC5_MJ1963 Custom Rule MJ1963 Cc: Jan Engelhardt Subject: [ovs-dev] [PATCH] util: Drop 'date' and 'time' arguments from ovs_set_program_name X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" The 'date' and 'time' arguments are normally being set by 'ovs_set_program_name' using __DATE__ and __TIME__. However, this breaks reproducible builds since even without any changes in the toolchain, build system etc, the end binary will still differ in that regard. This is also visible when building with -Wdate-time: utilities/ovs-dpctl.c:61:29: warning: macro "__DATE__" might prevent reproducible builds [-Wdate-time] set_program_name(argv[0]); ^ and it's also something that triggers the following warning in the openSUSE OBS builds: [...] openvswitch.x86_64: W: file-contains-date-and-time /usr/bin/ovs-ofctl openvswitch.x86_64: W: file-contains-date-and-time /usr/bin/ovs-appctl Your file uses __DATE and __TIME__ this causes the package to rebuild when not needed [...] This patch drops these two arguments from ovs_set_program_name__ and renames the function to ovs_set_program_name dropping the previous preprocessor macro in the process. This finally removes the remaining references to __DATE__ and __TIME__ from the sources which is something that has already been done in commit 26bfaeaa9687 ("Stop using __DATE__ and __TIME__ in startup string.") for the kernel datapath. Cc: Jan Engelhardt Signed-off-by: Markos Chandras --- include/openvswitch/util.h | 6 +----- lib/util.c | 17 +++++------------ 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/include/openvswitch/util.h b/include/openvswitch/util.h index 2230b2a..363fa39 100644 --- a/include/openvswitch/util.h +++ b/include/openvswitch/util.h @@ -25,11 +25,7 @@ extern "C" { #endif -void ovs_set_program_name__(const char *name, const char *version, - const char *date, const char *time); - -#define ovs_set_program_name(name, version) \ - ovs_set_program_name__(name, version, __DATE__, __TIME__) +void ovs_set_program_name(const char *name, const char *version); const char *ovs_get_program_name(void); const char *ovs_get_program_version(void); diff --git a/lib/util.c b/lib/util.c index 94311ac..6ca04ad 100644 --- a/lib/util.c +++ b/lib/util.c @@ -461,14 +461,9 @@ ovs_strerror(int error) * vSwitch. Otherwise, it is assumed to be an external program linking against * the Open vSwitch libraries. * - * The 'date' and 'time' arguments should likely be called with - * "__DATE__" and "__TIME__" to use the time the binary was built. - * Alternatively, the "ovs_set_program_name" macro may be called to do this - * automatically. */ void -ovs_set_program_name__(const char *argv0, const char *version, const char *date, - const char *time) +ovs_set_program_name(const char *argv0, const char *version) { char *basename; #ifdef _WIN32 @@ -496,14 +491,12 @@ ovs_set_program_name__(const char *argv0, const char *version, const char *date, free(program_version); if (!strcmp(version, VERSION)) { - program_version = xasprintf("%s (Open vSwitch) "VERSION"\n" - "Compiled %s %s\n", - program_name, date, time); + program_version = xasprintf("%s (Open vSwitch) "VERSION"\n", + program_name); } else { program_version = xasprintf("%s %s\n" - "Open vSwitch Library "VERSION"\n" - "Compiled %s %s\n", - program_name, version, date, time); + "Open vSwitch Library "VERSION"\n", + program_name, version); } }