Hi,

> On 23 Aug 2021, at 09:07, Martin Liška <mli...@suse.cz> wrote:
> 
> On 8/18/21 20:37, Iain Sandoe wrote:

>> For mach-o, we encapsulate streamed IR for LTO in three special
>> sections with a table that describes their entries.  The table is expected
>> to be written with native endianness for the target, but for cross-endian
>> cross-compilation the swapping was omitted.  Fixed thus.

> I noticed the change produced the following Clang warning:
> 
> build/libiberty/simple-object-mach-o.c:1231:10: warning: incompatible pointer 
> types passing 'unsigned int *' to parameter of type 'unsigned char *' 
> [-Wincompatible-pointer-types]

thanks for catching that, fixed as below 
tested on x86_64-darwin X powerpc-darwin (with clang and GCC).
pushed to master, thanks
Iain


diff --git a/libiberty/simple-object-mach-o.c b/libiberty/simple-object-mach-o.c
index 72b69d19c21..a8869e7c639 100644
--- a/libiberty/simple-object-mach-o.c
+++ b/libiberty/simple-object-mach-o.c
@@ -1228,7 +1228,7 @@ simple_object_mach_o_write_segment (simple_object_write 
*sobj, int descriptor,
       /* Swap the indices, if required.  */
 
       for (i = 0; i < (nsects_in * 4); ++i)
-       set_32 (&index[i], index[i]);
+       set_32 ((unsigned char *) &index[i], index[i]);
 
       sechdr_offset += sechdrsize;
 

Reply via email to