Matthias Klose <[email protected]> writes: > On 1/18/26 21:15, Jeffrey Law wrote: >> On 1/18/2026 1:00 PM, James K. Lowden wrote: >>> On Fri, 16 Jan 2026 16:44:37 -0700 >>> Jeffrey Law <[email protected]> wrote: >>> >>>> On 1/16/2026 1:00 PM, James K. Lowden wrote: >>>>> At present libgcobol requires the target to supply libxml2. That >>>>> complicates building cross compilers and mitigates against how >>>>> distributions are normally built. The remedy is to make libgcobol a >>>>> bootstrap library, >>>> So does libxml2 get linked into target code? Or libxml2 needed to >>>> build the compiler itself? >>> The gcobol compiler does not use libxml2. libgcobol mediates between >>> libxml2 and the compiled COBOL program. By that means, libxml2 is >>> linked into the target code. >>> >>> When libgcobol is built, it is linked to libxml2 because libgcobol >>> provides support for the XML PARSE statement in COBOL. The >>> compiled COBOL program is linked to libgcobol, which is linked to >>> libxml2, which is -- somehow -- provided by the target environment. >>> >>> As of now, libgcobol/configure.ac confirms that libxml2 is installed. >>> The build relies on the host to supply the header files and library. >> But is libgcobol target or not? Based on the above it sounds like >> it's target side. > > unlike mpfr, gmp, isl, which are only needed for the host, libxml2 is > needed for the target. libgcobol is not needed for a bootstrap. We > have a similar relationship for libgo/libffi, libphobos and zlib > (where the latter is built in-tree for the target), or with libobjc, > configured for boehm-gc and bdw-gc which needs to be provided for the > target.
(As you know, we agree on all of this, but just commenting on a few points..) Right. For zlib right now, in Gentoo, we don't even use the system copy of zlib for libphobos (we do otherwise) because it's a bit of a headache to arrange for the correct build of that. And zlib is far more stable tha libxml2, so it is at least acceptable there (no ABI breaks etc). > >> Ultimately the question that I'm looking to get answered is where >> does the libxml2 code run? Is it for the host, build or target >> machine? >> We don't include the C library with GCC, but we do include the C++ >> runtime library with GCC. The decisions here aren't necessarily >> that clear cut. > > problems are usually seen when building for multilib targets, and > cross compilers. > > [...] > > - for cross compilers, you need either build the target libxml2 > before you start building the cross compiler, or you need to build > it in-tree during the build. For packaging a cross compilers, > that makes the cross build a two-stage step, first building a C/C++ > cross compiler, then building libxml2, then rebuilding the > cross compiler including the cobol front-end. > Yep, and this is a big headache. It *is* made much easier than it would be otherwise by the fact that it turns out libxml2's ICU support is discouraged (per its README, which either you or James pointed out in our chats). I'm really not keen on making libxml2 a 'special' library we build for crosses. We do that for a very limited set of core toolchain libraries right now. > [...] sam
signature.asc
Description: PGP signature
