All of lore.kernel.org
 help / color / mirror / Atom feed
From: "lkml@tigusoft.pl" <lkml@tigusoft.pl>
To: linux-kernel@vger.kernel.org
Subject: howto make define seen in all files?
Date: Sun, 18 Aug 2013 05:56:45 +0200	[thread overview]
Message-ID: <201308180556.45833.lkml@tigusoft.pl> (raw)

[-- Attachment #1: Type: Text/Plain, Size: 373 bytes --]

Hi, I want to provide a general defined macro like __MY__TIME__ (for 
determinictic build) and that symbol should be seen as #define or -D... to gcc 
in all files;

Value of __MY_TIME__ is determined once, at start of build.

I was using file scripts/mkcompile_h as in the attached .diff patch, worked in 
3.2.48 but in 3.2.50 files do not see the value _MY_BUILD__TIME__


[-- Attachment #2: linux-3.2.48-deterministic-build.diff --]
[-- Type: text/x-patch, Size: 3616 bytes --]

diff -uprN a/arch/x86/math-emu/errors.c b/arch/x86/math-emu/errors.c
--- a/arch/x86/math-emu/errors.c	2013-06-29 05:06:45.000000000 +0200
+++ b/arch/x86/math-emu/errors.c	2013-07-25 15:46:14.922972587 +0200
@@ -332,7 +332,7 @@ asmlinkage void FPU_exception(int n)
 	if ((~control_word & n & CW_Exceptions) || (n == EX_INTERNAL)) {
 #ifdef PRINT_MESSAGES
 		/* My message from the sponsor */
-		printk(FPU_VERSION " " __DATE__ " (C) W. Metzenthen.\n");
+		printk(FPU_VERSION " " _MY_BUILD__DATE__ " (C) W. Metzenthen.\n");
 #endif /* PRINT_MESSAGES */
 
 		/* Get a name string for error reporting */
diff -uprN a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c	2013-06-29 05:06:45.000000000 +0200
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c	2013-07-25 15:46:06.990972484 +0200
@@ -43,7 +43,7 @@ int brcmf_msg_level;
 #ifdef BCMDBG
 static const char brcmf_version[] =
 	"Dongle Host Driver, version " BRCMF_VERSION_STR "\nCompiled on "
-	__DATE__ " at " __TIME__;
+	_MY_BUILD__TIME__ " at " _MY_BUILD__DATE__;
 #else
 static const char brcmf_version[] =
 	"Dongle Host Driver, version " BRCMF_VERSION_STR;
diff -uprN a/drivers/staging/rts5139/rts51x_scsi.c b/drivers/staging/rts5139/rts51x_scsi.c
--- a/drivers/staging/rts5139/rts51x_scsi.c	2013-06-29 05:06:45.000000000 +0200
+++ b/drivers/staging/rts5139/rts51x_scsi.c	2013-07-25 15:46:03.808972463 +0200
@@ -2067,7 +2067,7 @@ int proc_info(struct Scsi_Host *host, ch
 	SPRINTF("       Vendor: Realtek Corp.\n");
 	SPRINTF("      Product: RTS51xx USB Card Reader\n");
 	SPRINTF("      Version: %s\n", DRIVER_VERSION);
-	SPRINTF("        Build: %s\n", __TIME__);
+	SPRINTF("        Build: %s\n", _MY_BUILD__TIME__);
 
 	/*
 	 * Calculate start of next buffer, and return value.
diff -uprN a/drivers/staging/wlags49_h2/wl_version.h b/drivers/staging/wlags49_h2/wl_version.h
--- a/drivers/staging/wlags49_h2/wl_version.h	2013-06-29 05:06:45.000000000 +0200
+++ b/drivers/staging/wlags49_h2/wl_version.h	2013-07-25 15:46:19.639972804 +0200
@@ -130,7 +130,7 @@ err: define bus type;
 #endif  /* BUS_XXX */
 
 #ifdef DBG
-#define MODULE_DATE         __DATE__ " " __TIME__
+#define MODULE_DATE         _MY_BUILD__DATE__ " " _MY_BUILD__TIME__
 #else
 #define MODULE_DATE         "07/18/2004 13:30:00"
 #endif // DBG
diff -uprN a/fs/ubifs/super.c b/fs/ubifs/super.c
--- a/fs/ubifs/super.c	2013-06-29 05:06:45.000000000 +0200
+++ b/fs/ubifs/super.c	2013-07-25 15:46:11.783972639 +0200
@@ -1435,7 +1435,7 @@ static int mount_ubifs(struct ubifs_info
 	ubifs_msg("reserved for root:  %llu bytes (%llu KiB)",
 		c->report_rp_size, c->report_rp_size >> 10);
 
-	dbg_msg("compiled on:         " __DATE__ " at " __TIME__);
+	dbg_msg("compiled on:         " _MY_BUILD__DATE__ " at " _MY_BUILD__TIME__);
 	dbg_msg("min. I/O unit size:  %d bytes", c->min_io_size);
 	dbg_msg("max. write size:     %d bytes", c->max_write_size);
 	dbg_msg("LEB size:            %d bytes (%d KiB)",
diff -uprN a/scripts/mkcompile_h b/scripts/mkcompile_h
--- a/scripts/mkcompile_h	2013-06-29 05:06:45.000000000 +0200
+++ b/scripts/mkcompile_h	2013-07-25 15:45:47.194972240 +0200
@@ -42,6 +42,11 @@ if [ -z "$KBUILD_BUILD_TIMESTAMP" ]; the
 else
 	TIMESTAMP=$KBUILD_BUILD_TIMESTAMP
 fi
+
+# create _MY_BUILD__TIME__ instead __TIME__ (and DATE) deterministic build
+_MY_BUILD__TIME__=`date  -d "$TIMESTAMP"  "+%H:%M:%S"`
+_MY_BUILD__DATE__=`date  -d "$TIMESTAMP"  "+%b %d %Y"`
+
 if test -z "$KBUILD_BUILD_USER"; then
 	LINUX_COMPILE_BY=$(whoami | sed 's/\\/\\\\/')
 else

             reply	other threads:[~2013-08-18  4:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-18  3:56 lkml [this message]
2013-08-19 20:26 ` howto make define seen in all files? Michal Marek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201308180556.45833.lkml@tigusoft.pl \
    --to=lkml@tigusoft.pl \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.