[OE-core] [PATCH 0/4] Refactor usage of gcc -ffile-prefix-map

Juro Bystricky juro.bystricky at intel.com
Wed Dec 13 21:31:12 UTC 2017


The gcc that comes with OE-core supports a compiler option -ffile-prefix-map.
This option is essential in order to support binary reproducibility of packages
built from sources containing absolute paths due to various __FILE__ macros.
These can contain absolute path names of source code files as encountered on
the build host machine.
This affects basically all 150+ packaged kernel-module*, out of tree modules
(everybody inheriting module.bbclass, i.e. lttng-modules) and potentially individual
recipes.

While this compiler options is very useful, the presence cannot be assumed as
we may be building using an external toolchain. The detection code was already present
in kernel.bbclass. Since we may want to use this option (if present) in additional places,
it makes sense putting the detection code in a separate bbclass as opposed to replicating it
each time.
Not being aware of any better place, I put the code into a new bbclass "compiler-options.bbclass"

This patchset refactors kernel.bbclass and module.bbclass to use the new compiler-options.bbclass.
For a good measure the patcheset also contains a modified recipe for pulsaudio, demonstrating
how to use the compiler-options in a recipe.


Juro Bystricky (4):
  compiler-options.bbclass: provide and validate options
  kernel.bbclass: use class compiler-options
  module.bbclass: improve reproducibility
  pulseaudio: improve reproducibility

 meta/classes/compiler-options.bbclass              | 24 +++++++
 meta/classes/kernel.bbclass                        | 15 +----
 meta/classes/module.bbclass                        |  5 +-
 .../pulseaudio/pulseaudio/no-builddir.patch        | 74 ++++++++++++++++++++++
 .../pulseaudio/pulseaudio_11.1.bb                  | 12 +++-
 5 files changed, 115 insertions(+), 15 deletions(-)
 create mode 100644 meta/classes/compiler-options.bbclass
 create mode 100644 meta/recipes-multimedia/pulseaudio/pulseaudio/no-builddir.patch

-- 
2.7.4




More information about the Openembedded-core mailing list