Bug 13487 - systemd: meson_options.txt defaults to build host gnu-efi include paths
Summary: systemd: meson_options.txt defaults to build host gnu-efi include paths
Status: RESOLVED FIXED
Alias: None
Product: OE-Core
Classification: Build System, Metadata & Runtime
Component: core (show other bugs)
Version: 3.0
Hardware: x86 Multiple
: Undecided normal
Target Milestone: ---
Assignee: Ross Burton
QA Contact:
URL:
Whiteboard:
Depends on:
Blocks:
 
Reported: 2019-08-20 22:36 UTC by Chin Huat Ang
Modified: 2019-08-22 14:42 UTC (History)
3 users (show)

See Also:
OS type for building Yocto: ---
Type of Regression: ---
Verified:
Documentation change: No (bug/feature does not impact docs)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.