How do I report a very small bug in a single file?

When I start my build, a file appears at this path:
/build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl/linux-4.14.111/arch/mips/ralink/mt7620.c and it is missing an include: #include <asm/div64.h>

I can't seem to find where it gets unpacked from, or who/how to report this.

Thanks

That looks like the main Linux kernel.
So kernel.org would be the right place.

But note that the Linux extracted in the toolchain is not used in the actual firmware build, so that is just the vanilla kernel sources without any OpenWrt specific patches. (But it is needed for musl libc build, I think.)

The main kernel build sources are in a different place.

How does the bug actually manifest to you?
(At which stage? Which error? Is your buildhost a typical major Linux distro?)

For reporting OpenWrt bugs, however, this would be the way:
https://openwrt.org/bugs

make target/linux/{clean,prepare} will get you the patched sources in the build tree.

make target/linux/{clean,prepare} QUILT=Y will extract them, but not patch them. quilt can then be used to examine and manage the patches. This would let you see if the file is present in the distro.

The source tarballs can also be downloaded from various places, such as kernel.org. The can also be browsed at, for example https://elixir.bootlin.com/linux/v4.14.111/source/include/asm-generic/div64.h

So given that it looks like the file is present in upstream Linux for your version, at least as asm-generic, it would seem that checking the patch series, what it is you're trying to compile, and your build configuration might be a good place to start.

Rereading your first post

it isn't completely clear what file is involved. Is it that there is a file there that you believe is missing the #include or that the target of the #include is missing?

Sorry, edited the original post to include the filename.

The file mt7620.c is missing the div64.h include. Without it it throws an implicit func declaration error on the "do_div" call used.

As far as I can tell, I am not patching this file. The original also seems to be missing the include:
https://elixir.bootlin.com/linux/v4.14.111/source/arch/mips/ralink/mt7620.c

What is the error that you get?
I think that that file in toolchain dir is only used for building musl libc, but actual drivers are built in builddir/target, do I wonder if you really get an error there.
What is the error log with some context?

make[5]: Entering directory '/home/tony/newkernel/build_dir/target-mipsel_24kc_musl/linux-ramips_mt7620/linux-4.14.111'
  CHK     include/config/kernel.release
  CHK     include/generated/uapi/linux/version.h
  CHK     include/generated/utsrelease.h
  CHK     include/generated/bounds.h
  CHK     include/generated/timeconst.h
  CHK     include/generated/asm-offsets.h
  CALL    scripts/checksyscalls.sh
  CHK     scripts/mod/devicetable-offsets.h
  CHK     include/generated/compile.h
  CC      arch/mips/ralink/mt7620.o
arch/mips/ralink/mt7620.c: In function 'mt7620_calc_rate':
arch/mips/ralink/mt7620.c:376:2: error: implicit declaration of function 'do_div'; did you mean 'do_exit'? [-Werror=implicit-function-declaration]
  do_div(t, div);
  ^~~~~~
  do_exit
cc1: some warnings being treated as errors
scripts/Makefile.build:326: recipe for target 'arch/mips/ralink/mt7620.o' failed
make[6]: *** [arch/mips/ralink/mt7620.o] Error 1
Makefile:1039: recipe for target 'arch/mips/ralink' failed

Like I suspected, your error does not come from the toolchain build phase as you originally claimed (build_dir/toolchain-mipsel_24kc_gcc-7.3.0_musl), but from the later target build phase (build_dir/target-mipsel_24kc_musl).

Not sure how to solve that error, but at least it looks more clear where you actually get the error.

You need likely look at the target-specific patch series for that target like @jeff suggested, and possibly add a patch that corrects the asm / asm-generic difference. Current patches are in https://github.com/openwrt/openwrt/tree/master/target/linux/ramips/patches-4.14 if I guess your target right.

make target/linux/{clean,prepare} V=s will show you how much the kernel files are patched already now.

This exact same 'bug' just hit me, so its either not reported, not fixed, or necessary to patch for every kernel version. Kernel = linux-4.14.132

  CHK     include/generated/compile.h
  CC      arch/mips/ralink/mt7620.o
  AR      certs/built-in.o
arch/mips/ralink/mt7620.c: In function 'mt7620_calc_rate':
arch/mips/ralink/mt7620.c:376:2: error: implicit declaration of function 'do_div'; did you mean 'do_exit'? [-Werror=implicit-function-declaration]
  do_div(t, div);
  ^~~~~~
  do_exit
cc1: some warnings being treated as errors
  CC      mm/filemap.o
scripts/Makefile.build:326: recipe for target 'arch/mips/ralink/mt7620.o' failed
make[6]: *** [arch/mips/ralink/mt7620.o] Error 1
Makefile:1038: recipe for target 'arch/mips/ralink' failed
make[5]: *** [arch/mips/ralink] Error 2
make[5]: *** Waiting for unfinished jobs....