During a build, the do_compile
task
happens after source is fetched, unpacked, and configured.
If the recipe passes through do_compile
successfully, nothing needs to be done.
However, if the compile step fails, you need to diagnose the failure. Here are some common issues that cause failures:
Parallel build failures: These failures manifest themselves as intermittent errors, or errors reporting that a file or directory that should be created by some other part of the build process could not be found. This type of failure can occur even if, upon inspection, the file or directory does exist after the build has failed, because that part of the build process happened in the wrong order.
To fix the problem, you need to either satisfy
the missing dependency in the Makefile or whatever
script produced the Makefile, or (as a workaround)
set
PARALLEL_MAKE
to an empty string:
PARALLEL_MAKE = ""
Improper host path usage:
This failure applies to recipes building for the target
or nativesdk
only.
The failure occurs when the compilation process uses
improper headers, libraries, or other files from the
host system when cross-compiling for the target.
To fix the problem, examine the
log.do_compile
file to identify
the host paths being used (e.g.
/usr/include
,
/usr/lib
, and so forth) and then
either add configure options, apply a patch, or do both.
Failure to find required
libraries/headers:
If a build-time dependency is missing because it has
not been declared in
DEPENDS
,
or because the dependency exists but the path used by
the build process to find the file is incorrect and the
configure step did not detect it, the compilation
process could fail.
For either of these failures, the compilation process
notes that files could not be found.
In these cases, you need to go back and add additional
options to the configure script as well as possibly
add additional build-time dependencies to
DEPENDS
.
Occasionally, it is necessary to apply a patch to the
source to ensure the correct paths are used.