How to disable -Werror=date-time/macro "__DATE__" might prevent reproducible builds

The date-time warning is new in gcc 4.9 I think - it is possibly turned on implicitly by -Wall (and turned into an error implicitly by -Werror).

You could try turning it off explicitly using the -Wno- form i.e. by adding

-Wno-error=date-time 

to the CFLAGS.


I tried quite a few times adding the "Wno-error=date-time" line to the CFLAGS, but it didn't seem to work.

The easiest solution by far for me was to find the file that was producing the "__DATE__" line by executing

grep -r "__DATE__"

which (for the source code that I'm working with) gave me the file

acore/info.patch:+          "Compiled on " __DATE__ " for kernel %s"

I simply changed this to a string without the variable by removing the quotation marks, i.e.

"Compiled on __DATE__ for kernel %s"

The compilation was then able to proceed

EDIT: As mentioned before, use make clean before running configure and make, or even better, extract a fresh version from the zip/tar file


It might be better to remove the offending macro by deleting line 66 from the rtw_debug.c file.

sed -i -e '66d' /home/andy/RTL8812AU_linux_v4.3.8_12175.20140902/driver/rtl8812AU_linux_v4.3.8_12175.20140902/core/rtw_debug.c

Now you can continue with the build:

cd /home/andy/RTL8812AU_linux_v4.3.8_12175.20140902/
sudo make clean
make
sudo make install