Bug 13487

Summary: systemd: meson_options.txt defaults to build host gnu-efi include paths
Product: [Build System, Metadata & Runtime] OE-Core Reporter: Chin Huat Ang <chin.huat.ang>
Component: coreAssignee: Ross Burton <ross.burton>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: Undecided CC: meta.mr.watcher, meta.watcher, richard.purdie
Version: 3.0   
Target Milestone: ---   
Hardware: x86   
OS: Multiple   
Whiteboard:
OS type for building Yocto: --- Type of Regression: ---
Verified: Documentation change: No (bug/feature does not impact docs)

Description Chin Huat Ang 2019-08-20 22:36:05 UTC
Building systemd on build host with gnu-efi triggers the following compile-host-path QA error:

ERROR: QA Issue: systemd: The compile log indicates that host include and/or library paths were used.

It looks like systemd recipe needs PACKAGECONFIG gnu-efi so that it doesn't assume host gnu-efi:

https://github.com/systemd/systemd-stable/blob/v242-stable/meson_options.txt#L304

log.do_configure reported these host paths:

         EFI lib directory:                 /usr/lib                                                                                                                                      
         EFI lds directory:                 /usr/lib                                                                                                                                      
         EFI include directory:             /usr/include/efi   

log.do_compile contains the following warnings:

cc1: warning: include location "/usr/include/efi" is unsafe for cross-compilation [-Wpoison-system-directories]
cc1: warning: include location "/usr/include/efi/x86_64" is unsafe for cross-compilation [-Wpoison-system-directories]
cc1: warning: SSE instruction set disabled, using 387 arithmetics
x86_64-oe-linux-ld: warning: library search path "/usr/lib" is unsafe for cross-compilation
Comment 1 Chin Huat Ang 2019-08-20 22:41:13 UTC
Probably add this line to systemd recipe:

PACKAGECONFIG[gnu-efi] = "-Dgnu-efi=true -Defi-libdir=${STAGING_LIBDIR} -Defi-includedir=${STAGING_INCDIR}/efi,-Dgnu-efi=false,gnu-efi"
Comment 2 Ross Burton 2019-08-21 10:26:52 UTC
Filed upstream at https://github.com/systemd/systemd/issues/13371
Comment 3 Ross Burton 2019-08-21 10:59:18 UTC
Tested that oneliner, patch sent.