LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* Rebuilding and checksumming the Linux kernel
@ 2007-04-01 18:56 Edgardo Hames
  2007-04-01 18:58 ` Arjan van de Ven
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Edgardo Hames @ 2007-04-01 18:56 UTC (permalink / raw)
  To: linux-kernel

I'm working on a project with teams spread across the world and we all
work on the same repository patching the kernel and then integrating
into a common main branch. Even though we label the source code, we
would like to make sure that we are all building the same kernel by
running md5sum on the resulting binary.

Right now, this is not possible because the kernel includes a
timestamp and a build number on the binary. What are this timestamps
used for? Can we just remove them? Is there any other thing that may
lead to different binaries? (we are using the exact toolchains and
build machines, so we can assume that the same executable is generated
if the input source is the same).

Please, cc me in your replies because I'm not subscribed to the list.

Thanks for your time,
Ed

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
@ 2007-04-01 18:58 ` Arjan van de Ven
  2007-04-01 19:02 ` Jan Engelhardt
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Arjan van de Ven @ 2007-04-01 18:58 UTC (permalink / raw)
  To: Edgardo Hames; +Cc: linux-kernel

On Sun, 2007-04-01 at 15:56 -0300, Edgardo Hames wrote:
> I'm working on a project with teams spread across the world and we all
> work on the same repository patching the kernel and then integrating
> into a common main branch. Even though we label the source code, we
> would like to make sure that we are all building the same kernel by
> running md5sum on the resulting binary.
> 
> Right now, this is not possible because the kernel includes a
> timestamp and a build number on the binary. What are this timestamps
> used for? Can we just remove them? Is there any other thing that may
> lead to different binaries? (we are using the exact toolchains and
> build machines, so we can assume that the same executable is generated
> if the input source is the same).

elfutils has a "elfcmp" program that may be useful for you

another trick could be to run objdump -d on the vmlinux, and then
compare the assembly file.. you could even grep out any known date like
things that way,,


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
  2007-04-01 18:58 ` Arjan van de Ven
@ 2007-04-01 19:02 ` Jan Engelhardt
  2007-04-01 21:02 ` David Schwartz
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 8+ messages in thread
From: Jan Engelhardt @ 2007-04-01 19:02 UTC (permalink / raw)
  To: Edgardo Hames; +Cc: linux-kernel


On Apr 1 2007 15:56, Edgardo Hames wrote:
>
> I'm working on a project with teams spread across the world and we all
> work on the same repository patching the kernel and then integrating
> into a common main branch. Even though we label the source code, we
> would like to make sure that we are all building the same kernel by
> running md5sum on the resulting binary.

If you just want to make sure that interfaces match,
CONFIG_MODULE_SRCVERSION_ALL should be doing the right thing.


Jan
-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Rebuilding and checksumming the Linux kernel
  2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
  2007-04-01 18:58 ` Arjan van de Ven
  2007-04-01 19:02 ` Jan Engelhardt
@ 2007-04-01 21:02 ` David Schwartz
  2007-04-01 21:06 ` Sam Ravnborg
  2007-04-02  1:03 ` Edgardo Hames
  4 siblings, 0 replies; 8+ messages in thread
From: David Schwartz @ 2007-04-01 21:02 UTC (permalink / raw)
  To: linux-kernel


> I'm working on a project with teams spread across the world and we all
> work on the same repository patching the kernel and then integrating
> into a common main branch. Even though we label the source code, we
> would like to make sure that we are all building the same kernel by
> running md5sum on the resulting binary.

> Right now, this is not possible because the kernel includes a
> timestamp and a build number on the binary. What are this timestamps
> used for? Can we just remove them? Is there any other thing that may
> lead to different binaries? (we are using the exact toolchains and
> build machines, so we can assume that the same executable is generated
> if the input source is the same).

I think this is wrong in principle even if you can get it to work in
practice. If you want to all work on the same kernel, then keep a single
copy somewhere that you all work from. There is no reason the same source
code will or should always produce the same output. Compilers are not
generally required to be deterministic.

DS



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
                   ` (2 preceding siblings ...)
  2007-04-01 21:02 ` David Schwartz
@ 2007-04-01 21:06 ` Sam Ravnborg
  2007-04-01 21:53   ` Edgardo Hames
  2007-04-02  1:03 ` Edgardo Hames
  4 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2007-04-01 21:06 UTC (permalink / raw)
  To: Edgardo Hames; +Cc: linux-kernel

On Sun, Apr 01, 2007 at 03:56:30PM -0300, Edgardo Hames wrote:
> I'm working on a project with teams spread across the world and we all
> work on the same repository patching the kernel and then integrating
> into a common main branch. Even though we label the source code, we
> would like to make sure that we are all building the same kernel by
> running md5sum on the resulting binary.
> 
> Right now, this is not possible because the kernel includes a
> timestamp and a build number on the binary. What are this timestamps
> used for? Can we just remove them? Is there any other thing that may
> lead to different binaries? (we are using the exact toolchains and
> build machines, so we can assume that the same executable is generated
> if the input source is the same).

Soon you will be able to say:

KBUILD_BUILD_TIMESTAMP="2007-02-30 01:02.03" KBUILD_BUILD_VERSION=99 make

It will hit -mm soon and mainline in next merge window.
Patch is in kbuild.git at git.kernel.org.

	Sam

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-01 21:06 ` Sam Ravnborg
@ 2007-04-01 21:53   ` Edgardo Hames
  0 siblings, 0 replies; 8+ messages in thread
From: Edgardo Hames @ 2007-04-01 21:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Sam Ravnborg

On 4/1/07, Sam Ravnborg <sam@ravnborg.org> wrote:
> On Sun, Apr 01, 2007 at 03:56:30PM -0300, Edgardo Hames wrote:
> > I'm working on a project with teams spread across the world and we all
> > work on the same repository patching the kernel and then integrating
> > into a common main branch. Even though we label the source code, we
> > would like to make sure that we are all building the same kernel by
> > running md5sum on the resulting binary.
> >
> > Right now, this is not possible because the kernel includes a
> > timestamp and a build number on the binary. What are this timestamps
> > used for? Can we just remove them? Is there any other thing that may
> > lead to different binaries? (we are using the exact toolchains and
> > build machines, so we can assume that the same executable is generated
> > if the input source is the same).
>
> Soon you will be able to say:
>
> KBUILD_BUILD_TIMESTAMP="2007-02-30 01:02.03" KBUILD_BUILD_VERSION=99 make
>
> It will hit -mm soon and mainline in next merge window.
> Patch is in kbuild.git at git.kernel.org.

This is so much more than I could have asked for! I will try this
patch on my version of the kernel.

Thanks a lot,
Ed
-- 
Encontrá a "Tu psicópata favorito" http://tuxmaniac.blogspot.com

The future is not what it used to be.
-- Paul Valéry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
                   ` (3 preceding siblings ...)
  2007-04-01 21:06 ` Sam Ravnborg
@ 2007-04-02  1:03 ` Edgardo Hames
  2007-04-02  1:41   ` Jan Engelhardt
  4 siblings, 1 reply; 8+ messages in thread
From: Edgardo Hames @ 2007-04-02  1:03 UTC (permalink / raw)
  To: linux-kernel

On Apr 1, 6:10 pm, "David Schwartz"  wrote:
> > I'm working on a project with teams spread across the world and we all
> > work on the same repository patching the kernel and then integrating
> > into a common main branch. Even though we label the source code, we
> > would like to make sure that we are all building the same kernel by
> > running md5sum on the resulting binary.
> > Right now, this is not possible because the kernel includes a
> > timestamp and a build number on the binary. What are this timestamps
> > used for? Can we just remove them? Is there any other thing that may
> > lead to different binaries? (we are using the exact toolchains and
> > build machines, so we can assume that the same executable is generated
> > if the input source is the same).
>
> I think this is wrong in principle even if you can get it to work in
> practice. If you want to all work on the same kernel, then keep a single
> copy somewhere that you all work from. There is no reason the same source
> code will or should always produce the same output. Compilers are not
> generally required to be deterministic.

Could you please be a little more specific? We keep toolchains in our
SCM tool, so we can always retrieve a particular version of them and
rebuild with them. Why shouldn't we get the same binary then? I'm
really interested in hearing your opinion on this practice.

Thanks,
Ed
-- 
Encontrá a "Tu psicópata favorito" http://tuxmaniac.blogspot.com

The future is not what it used to be.
-- Paul Valéry

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Rebuilding and checksumming the Linux kernel
  2007-04-02  1:03 ` Edgardo Hames
@ 2007-04-02  1:41   ` Jan Engelhardt
  0 siblings, 0 replies; 8+ messages in thread
From: Jan Engelhardt @ 2007-04-02  1:41 UTC (permalink / raw)
  To: Edgardo Hames; +Cc: linux-kernel


On Apr 1 2007 22:03, Edgardo Hames wrote:

>> code will or should always produce the same output. Compilers are not
>> generally required to be deterministic.
>
> Could you please be a little more specific? We keep toolchains in our
> SCM tool,

Compile this, shush.

#include <stdio.h>
int main(void)
{
	printf("%s %s\n", __DATE__, __TIME__);
	return 0;
}


Jan
-- 

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2007-04-02  1:41 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-01 18:56 Rebuilding and checksumming the Linux kernel Edgardo Hames
2007-04-01 18:58 ` Arjan van de Ven
2007-04-01 19:02 ` Jan Engelhardt
2007-04-01 21:02 ` David Schwartz
2007-04-01 21:06 ` Sam Ravnborg
2007-04-01 21:53   ` Edgardo Hames
2007-04-02  1:03 ` Edgardo Hames
2007-04-02  1:41   ` Jan Engelhardt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).