mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-09-26 12:20:25 +00:00
9ee61db39e811af0f0751a6f42f9f33a3cd6c3d6
src/Makefile's `all` target carries a module_tests prerequisite, which
recurses into tests/modules. That Makefile pins the compiler to whatever
gcc is in PATH:
# This is a hack to override the default CC. When running with SANITIZER=memory
# tough we want to keep the compiler as clang as MSan is not supported for gcc
ifeq ($(uname_S),Linux)
ifneq ($(SANITIZER),memory)
LD = gcc
CC = gcc
endif
endif
while still taking CFLAGS/LDFLAGS from the environment, so a cross build
compiles and links all 47 test modules with the build host's gcc using
the target compiler flags. With the gcc toolchain those flags include
-fcanon-prefix-map (DEBUG_PREFIX_MAP_EXTRA in
meta/classes/toolchain/gcc.bbclass), which only exists in GCC >= 13. The
cross compiler always has it, the build host's gcc may not, and the build
then fails:
| gcc -I../../src -O2 -g -fcanon-prefix-map \
-ffile-prefix-map=.../sources/redis-8.10.1=/usr/src/debug/redis/8.10.1 \
... -std=gnu11 -O2 -fPIC -c commandfilter.c -o commandfilter.xo
| gcc: error: unrecognized command-line option '-fcanon-prefix-map';
did you mean '-fmacro-prefix-map='?
The modules are test-only artifacts: nothing links or installs them, and
only the tcl suite that `make test` drives from the build tree consumes
them. Drop them from `all` so no host compiler takes part in the cross
build at all; `test` keeps its own module_tests prerequisite. This has to
happen in the Makefile rather than by naming narrower goals in
do_compile, because `install: all` re-runs the phony target on its own.
With the patch applied the only compiler left in log.do_compile is
${TARGET_PREFIX}gcc, where 47 host gcc compile and 47 host gcc link
invocations used to be.
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Collection of layers for the OE-core universe
Main layer maintainer: Khem Raj raj.khem@gmail.com
This repository is a collection of layers to supplement OE-Core with additional packages, Each layer have designated maintainer Please see the respective READMEs in the layer subdirectories
Languages
BitBake
85.1%
Shell
5.6%
NASL
3.4%
C
2.6%
Roff
1.8%
Other
1.3%