Hi Simon, >>> However, I just discovered that there are two targets that would break >>> with this patch: both sparc-*-linux* and sparc64-*-linux* include >>> sparc-sol2-tdep.o and sparc64-sol2-tdep.o in configure.tgt. With the >>> new call to sol2_init_abi which only lives in sol2-tdep.o, gdb would >>> fail to link. I have no idea what business they have with >>> Solaris-specific files: I suspect that's to allow debugging of >>> Solaris/SPARC binaries (i.e. GDB_OSABI_SOLARIS). What should I do about >>> this? Maybe I also could include sol2-tdep.o on Linux/SPARC, but is >>> this TRT? AFAICS those files received only mechanical changes over the >>> last two years (haven't looked further), and I have no way of testing >>> changes. >> >> Hmm, sparc-*-linux* and sparc64-*-linux* have no business including some >> Solaris-specific files in the build. >> >> When building a GDB on sparc64/Linux, it shouldn't have support for debugging >> sparc64/Solaris binaries. If you want that, you need to pass >> --enable-targets=sparc64-solaris-something (I don't know what the actual >> triplet >> would be). > > sparc{v9,64}-sun-solaris2.11 > >> So it seems like there is some untangling here, putting the functions on the >> files that they really belong to, until you can successfully build a >> sparc64/Linux >> GDB without including the sol2 tdep files. I haven't looked much at the patch > > From a quick check, this should just work today: the functions declared > in sparc*-sol2-tdep.c are only called in Solaris-specific files already. > I'll give it a try separately. sparc{32,64}_sol2_init_abi are currently > declared in common files (sparc*-tdep.h), but they can just be made > static and the declarations removed. the following patch does just that: tested on sparc64-unknown-linux-gnu (build only due to PR tdep/26170) and sparcv9-sun-solaris2.11. Ok for master? Rainer -- ----------------------------------------------------------------------------- Rainer Orth, Center for Biotechnology, Bielefeld University 2020-06-24 Rainer Orth * configure.tgt (gdb_target_obs): Remove sparc-sol2-tdep.o, sol2-tdep.o, sparc64-sol2-tdep.o. (gdb_target_obs): Remove sparc64-sol2-tdep.o, sol2-tdep.o, sparc-sol2-tdep.o. * sparc-sol2-tdep.c (sparc32_sol2_init_abi): Make static. * sparc-tdep.h (sparc32_sol2_init_abi): Remove. * sparc64-sol2-tdep.c (sparc64_sol2_init_abi): Make static. * sparc64-tdep.h (sparc64_sol2_init_abi): Remove.