Re: [PATCH] Documentation: kbuild: Add document about reproducible builds

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2019-09-11 at 21:17 +0900, Masahiro Yamada wrote:
> Hi Ben,
> 
> 
> Thanks for this.
> Please let me add some comments.
> 
> 
> On Wed, Sep 11, 2019 at 8:54 PM Ben Hutchings <ben@xxxxxxxxxxxxxxx> wrote:
[...]
> > +Absolute filenames
> > +------------------
> > +
> > +When the kernel is built out-of-tree, debug information may include
> > +absolute filenames for the source files.  The ``__FILE__`` macro may
> > +also expand to an absolute filename.  This must be overridden by
> > +including `prefix-map options`_ in the `KCFLAGS`_ variable.
> 
> Do you mean -fmacro-prefix-map ?

No, I mean -ffile-prefix-map or the older -fdebug-prefix-map.

> If so, it is already taken care of by the top Makefile.
> If you use GCC 8 or newer, it is automatically added to
> KBUILD_CFLAGS.

Ah, that's helpful.  So, I suppose I should just mention
-fdebug-prefix-map here and warn that __FILE__ will still be a proble
if using older compiler versions.

> > +Generated files in source packages
> > +----------------------------------
> > +
> > +The build processes for some programs under the ``tools/``
> > +subdirectory do not completely support out-of-tree builds.  This may
> > +cause source packages built using e.g. ``make rpm-pkg`` to include
> > +generated files and so be unreproducible.  It may be necessary to
> > +clean the source tree completely (``make mrproper`` or
> > +``git clean -d -f -x``) before building a source package.
> 
> Currently, the source package building does not support
> out-of-tree build anyway.

Yes, I realise that.

> 'make O=foo rpm-pkg' fails with an error message.
> 
> Building in a pristine source will solve the issue.
[...]

The issue I'm thinking about is that an out-of-tree build, prior to the
package build, *should* leave the source pristine and sometimes does
not.

For Debian's official kernel packages, we build a binary package of the
upstream source, and at some times this has unexpectedly included some 
generated files.  I believe a similar issue would affect the upstream
package scripts.

Ben.

-- 
Ben Hutchings
The obvious mathematical breakthrough [to break modern encryption]
would be development of an easy way to factor large prime numbers.
                                                           - Bill Gates

Attachment: signature.asc
Description: This is a digitally signed message part


[Index of Archives]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Linux FS]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux