Is there a right way to pass additional compiler flags to the coreboot makefiles? We've been working on making the Heads firmware reproducible and found that the -fdebug-prefix-map option is necessary to deal with different build directories. To make this work with coreboot we ended passing in environment variables CFLAGS_x86_32 and CFLAGS_x86_64:
EXTRA_FLAGS="-fdebug-prefix-map=`pwd`=. -gno-record-gcc-switches" make CFLAGS_x86_32="$EXTRA_FLAGS" CFLAGS_x86_64="$EXTRA_FLAGS"
Ideally coreboot could use this in its Makefile to avoid having any build tree path dependencies included in the binary, although for now the Heads build script passes in these extra flags to all of our dependencies.
With this (and several other commits this week), Heads is now 100% reproducible (tested on Ubuntu, Qubes' Fedora, and an ancient Debian):
https://github.com/osresearch/heads/releases/tag/v0.1.0