Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clang error compiling for iOS #2617

Open
MartinZikmund opened this issue Aug 14, 2024 · 4 comments
Open

clang error compiling for iOS #2617

MartinZikmund opened this issue Aug 14, 2024 · 4 comments
Labels

Comments

@MartinZikmund
Copy link

Describe the bug

Trying to build an iOS app using Microsoft.Graph library fails with the following:

clang exited with code 1:
/Users/mzikmund/Library/Caches/Xamarin/mtbs/builds/iOSTabbedApp3/c545e9e939b879654bbf76c0344987a782d645ee60de988037adf42061544d17/obj/Debug/net8.0-ios/iossimulator-arm64/nativelibraries/aot-output/arm64/Microsoft.Graph.dll.s:73678288:1: error: addend too big for relocation
adrp x16, mono_aot_Microsoft_Graph_got@PAGE+8388608
^
/Users/mzikmund/Library/Caches/Xamarin/mtbs/builds/iOSTabbedApp3/c545e9e939b879654bbf76c0344987a782d645ee60de988037adf42061544d17/obj/Debug/net8.0-ios/iossimulator-arm64/nativelibraries/aot-output/arm64/Microsoft.Graph.dll.s:73678293:1: error: addend too big for relocation
adrp x16, mono_aot_Microsoft_Graph_got@PAGE+8388608
^
/Users/mzikmund/Library/Caches/Xamarin/mtbs/builds/iOSTabbedApp3/c545e9e939b879654bbf76c0344987a782d645ee60de988037adf42061544d17/obj/Debug/net8.0-ios/iossimulator-arm64/nativelibraries/aot-output/arm64/Microsoft.Graph.dll.s:73678332:1: error: addend too big for relocation
adrp x16, mono_aot_Microsoft_Graph_got@PAGE+8388608
^

Expected behavior

Should not error out.

How to reproduce

Can be easily reproduced on a blank iOS app that references and uses Microsoft Graph - see this repro:

iOSTabbedApp3.zip

  1. Open the .sln in VS2022
  2. Connect to remote Mac (mine is a M2-based Mac)
  3. Try to run the on an iOS Simulator

SDK Version

5.56.0

Latest version known to work for scenario above?

N/A

Known Workarounds

None

Debug output

Click to expand log ```
</details>


### Configuration

Microsoft Visual Studio Enterprise 2022
Version 17.11.0
VisualStudio.17.Release/17.11.0+35208.52

Windows 11 26120
macOS Sonoma 14.5 9 (Apple M2)

### Other information

_No response_
@MartinZikmund MartinZikmund added status:waiting-for-triage An issue that is yet to be reviewed or assigned type:bug A broken experience labels Aug 14, 2024
@andrueastman
Copy link
Member

Thanks for raising this @MartinZikmund

I notice in you csproj you have

<TrimMode Condition="'$(Configuration)' == 'Release'">full</TrimMode>

Any chance you can confirm if the issue still occurs in release mode as well?

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed status:waiting-for-triage An issue that is yet to be reviewed or assigned labels Aug 15, 2024
MartinZikmund added a commit to unoplatform/uno that referenced this issue Aug 15, 2024
@MartinZikmund
Copy link
Author

MartinZikmund commented Aug 28, 2024

@andrueastman Sorry for the delay, had other unrelated iOS build issues. I can confirm that in Release mode the app builds without errors. Still, the Debug mode fails with the error above. Can you please reopen the issue to keep it tracked?

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close Status: No recent activity labels Aug 28, 2024
@andrueastman andrueastman reopened this Aug 29, 2024
@andrueastman
Copy link
Member

To confirm here, is there a reason not to enable the trim mode in debug as well?

<TrimMode">full</TrimMode>

The alternative would be to use partial trimming and opt in the graph lib. https://learn.microsoft.com/en-us/dotnet/core/deploying/trimming/trimming-options?pivots=dotnet-8-0#trimming-granularity

Due to the large surface of API and SDK enabling trimming will give a smaller binary for your scenario focussing on the paths you are calling/using.

@andrueastman andrueastman added status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close and removed Needs: Attention 👋 labels Aug 29, 2024
@MartinZikmund
Copy link
Author

There is no reason in particular, just that by default the iOS app/MAUI app csproj will not have it enabled for Debug, which means when user installs MS Graph library they will need to know to make this additional step. We offer MS Graph as part of our addons in Uno Platform and this would mean we need to provide additional documentation for users, as they will otherwise hit this error and will most likely assume the problem is caused by our framework rather by this. In this manner it would be more user friendly if there was no error out of the box

@microsoft-github-policy-service microsoft-github-policy-service bot added Needs: Attention 👋 and removed status:waiting-for-author-feedback Issue that we've responded but needs author feedback to close labels Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants