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.
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?)
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.
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?
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?
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.
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....