13

I am trying to compile a driver for a Netis WF2190 adapter. Yes, I just downloaded the latest from them.

How can I disable the -Werror=date-time in the build? I can't find it anywhere in the build script so I figure it must be some global default setting. Clearly the code is just trying to embed the build date/time into the output, so there should be no problem with disabling this warning.

Here are some of the warnings I'm getting that are being treated as errors:

/home/andy/RTL8812AU_linux_v4.3.8_12175.20140902/driver/rtl8812AU_linux_v4.3.8_12175.20140902/core/rtw_debug.c:66:1: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
/home/andy/RTL8812AU_linux_v4.3.8_12175.20140902/driver/rtl8812AU_linux_v4.3.8_12175.20140902/core/rtw_debug.c:66:1: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
cc1: some warnings being treated as errors
  • 2
    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. -Wno-error=date-time added to the CFLAGS but I'm guessing and can't test it. – steeldriver Mar 6 '15 at 20:26
  • @steeldriver yes, that worked, thank you! You are welcome to submit it as an answer and I will accept it. The other part of the problem was I didn't realize the install script was re-extracting the source every time and overwriting changes I made to the makefile. – Andy Mar 6 '15 at 21:57
14

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.

  • What, specifically, does one need to type into the terminal to do this? – Hack-R Nov 27 '16 at 0:24
  • 1
    Hi @steeldriver Is this the correct syntax: CFLAGS += "-Wno-error=date-time " – Nayab Basha Sayed Mar 13 '17 at 5:38
3

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

1

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
  • sudo make clean is important – mchid Jul 25 '15 at 20:12

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.