meson: use the host architecture compiler/linker for src/boot/efi
authorHelmut Grohne <helmut@subdivi.de>
Thu, 27 Sep 2018 15:17:37 +0000 (17:17 +0200)
committerFelipe Sateler <fsateler@debian.org>
Thu, 6 Dec 2018 00:03:34 +0000 (00:03 +0000)
cross building systemd to arm64 presently fails, because the build
system uses plain gcc and plain ld (build architecture compiler and
linker respectively) for building src/boot/efi. These values come from
the efi-cc and efi-ld options respectively. It rather should be using
host tools here.

Fixes: b710072da441 ("add support for building efi modules")
(cherry picked from commit df7cacae696ae3c1d13d2f9a4db24815e07e29a1)

Gbp-Pq: Name meson-use-the-host-architecture-compiler-linker-for-src-b.patch

meson_options.txt
src/boot/efi/meson.build

index dc7951b99177ca3e8621cf55c59bd873c820bf75..8f9cfd979270c4a4eb0733bafa768effd860352c 100644 (file)
@@ -278,9 +278,9 @@ option('dbus', type : 'combo', choices : ['auto', 'true', 'false'],
 
 option('gnu-efi', type : 'combo', choices : ['auto', 'true', 'false'],
        description : 'gnu-efi support for sd-boot')
-option('efi-cc', type : 'string', value : 'gcc',
+option('efi-cc', type : 'string',
        description : 'the compiler to use for EFI modules')
-option('efi-ld', type : 'string', value : 'ld',
+option('efi-ld', type : 'string',
        description : 'the linker to use for EFI modules')
 option('efi-libdir', type : 'string',
        description : 'path to the EFI lib directory')
index 8ec1fa7be4d55713e74e33f088743ea6ede321f7..db47bb7c5dd0a4320bec4229bf1ac50bcf1d4494 100644 (file)
@@ -34,7 +34,13 @@ stub_sources = '''
 
 if conf.get('ENABLE_EFI') == 1 and get_option('gnu-efi') != 'false'
         efi_cc = get_option('efi-cc')
+        if efi_cc == ''
+                efi_cc = ' '.join(cc.cmd_array())
+        endif
         efi_ld = get_option('efi-ld')
+        if efi_ld == ''
+                efi_ld = find_program('ld', required: true)
+        endif
         efi_incdir = get_option('efi-includedir')
 
         gnu_efi_path_arch = ''