[glib/wip/smcv/cross-ld: 3/3] Make ld executable configurable



commit 81936ca5808ed7f52571e1fdc49ecffc4d202b07
Author: Simon McVittie <smcv collabora com>
Date:   Mon Nov 4 10:24:15 2019 +0000

    Make ld executable configurable
    
    Tools like this should be configurable in a cross or native file. In
    particular, if we are cross-compiling (with an executable wrapper like
    qemu-arm), the build system ld is not necessarily able to manipulate
    host system objects.
    
    Signed-off-by: Simon McVittie <smcv collabora com>

 .gitlab-ci/android-setup-env.sh   | 1 +
 .gitlab-ci/cross_file_mingw64.txt | 1 +
 docs/reference/glib/cross.xml     | 1 +
 gio/tests/meson.build             | 5 +++--
 4 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/.gitlab-ci/android-setup-env.sh b/.gitlab-ci/android-setup-env.sh
index 510056f66..d922bfdbe 100755
--- a/.gitlab-ci/android-setup-env.sh
+++ b/.gitlab-ci/android-setup-env.sh
@@ -95,6 +95,7 @@ c_link_args = ['-L${prefix_path}/lib64',
 c = '${toolchain_path}/bin/${CC}'
 cpp = '${toolchain_path}/bin/${CXX}'
 ar = '${toolchain_path}/bin/${AR}'
+ld = '${toolchain_path}/bin/${LD}'
 strip = '${toolchain_path}/bin/${STRIP}'
 pkgconfig = '${PKG_CONFIG}'
 EOM
diff --git a/.gitlab-ci/cross_file_mingw64.txt b/.gitlab-ci/cross_file_mingw64.txt
index 1029b6db1..7c9176b01 100644
--- a/.gitlab-ci/cross_file_mingw64.txt
+++ b/.gitlab-ci/cross_file_mingw64.txt
@@ -12,6 +12,7 @@ c_link_args = []
 c = 'x86_64-w64-mingw32-gcc'
 cpp = 'x86_64-w64-mingw32-g++'
 ar = 'x86_64-w64-mingw32-ar'
+ld = 'x86_64-w64-mingw32-ld'
 objcopy = 'x86_64-w64-mingw32-objcopy'
 strip = 'x86_64-w64-mingw32-strip'
 pkgconfig = 'x86_64-w64-mingw32-pkg-config'
diff --git a/docs/reference/glib/cross.xml b/docs/reference/glib/cross.xml
index 977421faa..c90b30b36 100644
--- a/docs/reference/glib/cross.xml
+++ b/docs/reference/glib/cross.xml
@@ -59,6 +59,7 @@ c_link_args = []
 c = 'x86_64-w64-mingw32-gcc'
 cpp = 'x86_64-w64-mingw32-g++'
 ar = 'x86_64-w64-mingw32-ar'
+ld = 'x86_64-w64-mingw32-ld'
 objcopy = 'x86_64-w64-mingw32-objcopy'
 strip = 'x86_64-w64-mingw32-strip'
 pkgconfig = 'x86_64-w64-mingw32-pkg-config'
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index 2c84a20f3..8b5d105f5 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -586,8 +586,9 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
   # (https://reviews.llvm.org/D58234). FIXME: This test could be enabled for
   # LLVM once that support is in a stable release.
   objcopy = find_program('objcopy', required : false)
+  ld = find_program('ld', required : false)
 
-  if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found()
+  if build_machine.system() == 'linux' and cc.get_id() == 'gcc' and objcopy.found() and ld.found()
     test_gresource_binary = custom_target('test5.gresource',
       input : 'test5.gresource.xml',
       output : 'test5.gresource',
@@ -616,7 +617,7 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
     test_resources_binary = custom_target('test_resources.o',
       input : test_gresource_binary,
       output : 'test_resources.o',
-      command : ['ld',
+      command : [ld,
                  '-r',
                  '-b','binary',
                  '@INPUT@',


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]