https://bugs.documentfoundation.org/show_bug.cgi?id=173309

            Bug ID: 173309
           Summary: reduce build tools footprint in cross-compilation
                    (conditionalize build side dependencies when cross
                    compiling)
           Product: LibreOffice
           Version: 27.2.0.0 alpha0+ master
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: medium
         Component: LibreOffice
          Assignee: [email protected]
          Reporter: [email protected]

When cross-compiling is done, some code needs to be built for tools that are
used during the build (what we call "cross-toolset")

In the cross compilation case, configure runs itself a second time with a set
of reduced options used for that cross-toolset and the make starts by building
the build-tools before starting the build for the host/target.

Recently when new libs/dependency were added, always the quick'n'dirty way of
just adding those to the build-toolset side as well was taken (see changes to
PERMITTED_BUILD_TARGETS in configure.ac) - but of course none of the build
tools makes use of stuff needed for document/file format imports for example.

So the easyhack would require going through that list and then sprinkling in
ifdefs into the Makefiles to disable adding the dependencies to the respective
modules (the various gb_<type>_use_extrernal(s) statements) and possible also
some ifdefs in code to skip code that's unused.


Only real cross-compilation target we actively have in use is the Windows build
to aarch64, so doing this task on Windows is recommended (and there is also
where most of the stuff is built internally while on Linux some stuff also is
taken from system dependencies instead)

If the build is doing the build-tools stuff, gb_Side will be defined to
"build", otherwise it will be "host"/the default. So conditionals can check for
that macro in makefiles, and there's also CROSS_COMPILING set to TRUE in case
the build as a whole is a cross-compilation setup.

so tldr:
 * reduce build-tools footprint/dependencies by
   * removing entries from PERMITTED_BUILD_TARGETS in configure.ac
   * and conditionalize the dependencies in the makefiles accordingly
     + can use gb_Side and/or CROSS_COMPILING macros in Makefile for that
   * if required also add corresponding ifdefs to disable bits of code
 * best/primary system: Cross compile to Windows aarch64 from Windows x86_64

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to