[glib: 1/2] Fix cross build error for Windows with gcc




commit 229f7d4a03d862900f7c359b7156b889f7c34483
Author: Ralf Habacker <ralf habacker freenet de>
Date:   Thu Jan 6 09:18:37 2022 +0100

    Fix cross build error for Windows with gcc
    
    This commit puts an additional underscore before the external symbol
    `_g_binary_test1_resource_data` when using gcc for Windows, to match
    the compiler's expectation.
    
    Fixes #2571
    
    Signed-off-by: Ralf Habacker <ralf habacker freenet de>

 gio/tests/meson.build | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gio/tests/meson.build b/gio/tests/meson.build
index f8cf7b655..8212f75da 100644
--- a/gio/tests/meson.build
+++ b/gio/tests/meson.build
@@ -734,11 +734,16 @@ if not meson.is_cross_build() or meson.has_exe_wrapper()
                  '-o','@OUTPUT@'])
 
     # Rename symbol to match the one in the C file
+    if cc.get_id() == 'gcc' and host_system == 'windows'
+      underscore = '_'
+    else
+      underscore = ''
+    endif
     test_resources_binary2 = custom_target('test_resources2.o',
       input : test_resources_binary,
       output : 'test_resources2.o',
       command : [objcopy,
-                 '--add-symbol','_g_binary_test1_resource_data=.data:0',
+                 '--add-symbol', underscore + '_g_binary_test1_resource_data=.data:0',
                  '@INPUT@',
                  '@OUTPUT@'])
 


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