From 0463131f75cbb341def4b783c3295b82fde61b23 Mon Sep 17 00:00:00 2001 From: Rolf Bjarne Kvinge Date: Tue, 19 Apr 2022 15:11:34 +0200 Subject: [AOT] Don't set the 'CorrectedSynthesize' flag in the objc_imageinfo section. (#21451) * [AOT] Don't set the 'CorrectedSynthesize' flag in the objc_imageinfo section. According to Apple's headers, it's not used anymore, and ignored. However, with Xcode 13.3, it seems Apple has re-used this value for something else, and it's causing warnings in the linker: > ld: warning: '[...]/arm64/Xamarin.iOS.dll.o' was built with class_ro_t pointer signing enabled, but previous .o files were not Fixes https://github.com/mono/mono/issues/21450. Ref: https://opensource.apple.com/source/objc4/objc4-818.2/runtime/objc-abi.h.auto.html * Don't set the 'CorrectedSynthesize' flag when using LLVM either. --- mono/mini/aot-compiler.c | 2 +- mono/mini/mini-llvm.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/mono/mini/aot-compiler.c b/mono/mini/aot-compiler.c index 1a9b616fc50..8b48cf51eed 100644 --- a/mono/mini/aot-compiler.c +++ b/mono/mini/aot-compiler.c @@ -11730,7 +11730,7 @@ emit_objc_selectors (MonoAotCompile *acfg) fprintf (acfg->fp, ".align 3\n"); fprintf (acfg->fp, "L_OBJC_IMAGE_INFO:\n"); fprintf (acfg->fp, ".long 0\n"); - fprintf (acfg->fp, ".long 16\n"); + fprintf (acfg->fp, ".long 0\n"); } static void diff --git a/mono/mini/mini-llvm.c b/mono/mini/mini-llvm.c index c29cf857a60..8337372ab29 100644 --- a/mono/mini/mini-llvm.c +++ b/mono/mini/mini-llvm.c @@ -6929,7 +6929,7 @@ process_bb (EmitContext *ctx, MonoBasicBlock *bb) ctx->module->objc_selector_to_var = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); LLVMValueRef info_var = LLVMAddGlobal (ctx->lmodule, LLVMArrayType (LLVMInt8Type (), 8), "@OBJC_IMAGE_INFO"); - int32_t objc_imageinfo [] = { 0, 16 }; + int32_t objc_imageinfo [] = { 0, 0 }; LLVMSetInitializer (info_var, mono_llvm_create_constant_data_array ((uint8_t *) &objc_imageinfo, 8)); LLVMSetLinkage (info_var, LLVMPrivateLinkage); LLVMSetExternallyInitialized (info_var, TRUE); -- cgit v1.2.3