On 11/17/21 10:50 PM, Arnd Bergmann wrote:
On Thu, Nov 18, 2021 at 7:21 AM Randy Dunlap rdunlap@infradead.org wrote:
When CONFIG_DMASOUND_ATARI=y and CONFIG_DMASOUND_Q40=m, dmasound_atari.o is built first (listed first in the Makefile), so dmasound_core.o is built as builtin, not for use by loadable modules. Then dmasound_q40.o is built and linked with the already-built dmasound_core.o, but the latter does not support use by loadable modules. This causes the missing symbol to be undefined.
Fixes this build error: ERROR: modpost: "dmasound_deinit" [sound/oss/dmasound/dmasound_q40.ko] undefined!
I suspect your patch now breaks the case where multiple drivers are built-in, because that puts the same global symbols into vmlinux more than once.
True dat.
-EXPORT_SYMBOL(dmasound); -EXPORT_SYMBOL(dmasound_init); -#ifdef MODULE -EXPORT_SYMBOL(dmasound_deinit); -#endif
From a very brief look, I would think that removing this #ifdef and unconditionally defining dmasound_deinit is the correct solution here, to solve the case of the core driver being built-in but called from a loadable module, the Makefile logic is otherwise correct.
OK, thanks for the info. I'm not going to spend any more time on it...