Move dump_avail[] extern declaration and inlines into new header vm/vm_dumpset.h.
This fixes default gcc build for mips.
Differential D26741
Avoid dump_avail[] redefinition. kib on Oct 11 2020, 7:44 PM. Authored by Tags None Referenced Files
Details
Move dump_avail[] extern declaration and inlines into new header vm/vm_dumpset.h. This fixes default gcc build for mips.
Diff Detail
Event TimelineComment Actions This seems to remedy the initial problem. I then ran into a 'function with a non-void return type does not return a value' in @mjg's work and applied this diff because it looks like the switch is supposed to cover it: diff --git a/sys/kern/vfs_cache.c b/sys/kern/vfs_cache.c index 0880ed26b28..e425dd85468 100644 --- a/sys/kern/vfs_cache.c +++ b/sys/kern/vfs_cache.c @@ -4242,6 +4242,8 @@ cache_fplookup_impl(struct vnode *dvp, struct cache_fpl *fpl) cache_fpl_cleanup_cnp(cnp); return (error); } + + __assert_unreachable(); } /* I then ran into this, which seems to make little sense: /usr/src/sys/amd64/amd64/exception.S: Assembler messages: /usr/src/sys/amd64/amd64/exception.S:613: Error: found 'U', expected: ')' /usr/src/sys/amd64/amd64/exception.S:613: Error: junk `UL)' after expression /usr/src/sys/amd64/amd64/exception.S:1268: Error: found 'U', expected: ')' /usr/src/sys/amd64/amd64/exception.S:1268: Error: junk `UL)' after expression --- exception.o --- Comment Actions Is this a gcc build? gcc is notorious for the following problem: explicitly handing all enum cases one by one without any form of catch-all results in a warning that something is not handled. They have a bug report somewhere about this but they don't fix the problem. The particular instance you see here is one of several, you did not see more because of the support.S compilation failure. I don't know what's the best way to address this, given __address_unreachable semantics it is worrisome the compiler will assume the not mentioned cases now got handling. I would argue the thing to do is to disable the enumeration warn to begin with. Comment Actions Yeah, this is with amd64-gcc9 in my particular case, I was trying to test if bfd still "optimizes" away dynamic mode if there are no dynamic references. Comment Actions
Look at assym.inc for PMAP_UCR3_NOMASK and UCR3_LOAD_MASK. Or better, pre-process exception.S and look at the preprocessed asm. Comment Actions If someone is to do anything serious with gcc I suggest the following:
The bug report I mentioned: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87950 Comment Actions This is rather orthogonal to the review as is. The goal is to fix _mips_ gcc build, amd64 gcc would be nice and I will do whatever is needed. But in the different changeset. Comment Actions Sorry, my commentary was also mostly orthogonal... I can confirm that this review + the vfs_cache.c hack are sufficient for mips buildkernel w/ gcc9. Comment Actions Could you update .clang-format to sort vm_param.h after vm.h and before vm/*?
Comment Actions Alternatively, move this code to a different header file. None of the new dump-related code uses struct vm_page. Comment Actions Thanks for fixing this. Grepping around, I believe vm_dumpset.h should also be included in: sys/mips/atheros/ar531x/ar5315_machdep.c Comment Actions For vm_phys.c dump_avail[] is locally defined, I am not sure declaration is useful. It would provide some consistency checking indeed but contamination with unneeded symbols is probably worse than this minor improvement. Other files you listed are not used during tinderbox builds. I added the header following your notes.
|