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

Numerous GlobalizationNative P/Invokes in System.Private.CoreLib.dll don't have a corresponding native function anymore #96251

Closed
rolfbjarne opened this issue Dec 21, 2023 · 29 comments
Assignees
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Dec 21, 2023

Description

I've looked through the P/Invokes in System.Private.CoreLib.dll, and these don't have a corresponding native entry point in libSystem.Globalization.Native.a:

GlobalizationNative_GetLatestJapaneseEra
GlobalizationNative_CloseSortHandle
GlobalizationNative_CompareString
GlobalizationNative_IndexOf
GlobalizationNative_LastIndexOf
GlobalizationNative_GetSortKey
GlobalizationNative_GetSortVersion
GlobalizationNative_GetICUVersion
GlobalizationNative_IsNormalized
GlobalizationNative_NormalizeString
GlobalizationNative_GetCalendars
GlobalizationNative_GetCalendarInfo
GlobalizationNative_EnumCalendarInfo
GlobalizationNative_GetJapaneseEraStartDate
GlobalizationNative_ChangeCase
GlobalizationNative_ChangeCaseInvariant
GlobalizationNative_ChangeCaseTurkish
GlobalizationNative_GetSortHandle
GlobalizationNative_StartsWith
GlobalizationNative_EndsWith
GlobalizationNative_GetLocaleName
GlobalizationNative_GetLocaleInfoString
GlobalizationNative_GetDefaultLocaleName
GlobalizationNative_IsPredefinedLocale
GlobalizationNative_GetLocaleTimeFormat
GlobalizationNative_GetLocaleInfoInt
GlobalizationNative_GetLocaleInfoGroupingSizes
GlobalizationNative_GetLocales
GlobalizationNative_GetTimeZoneDisplayName

Tested with: 9.0.0-alpha.1.23619.7

This started happening in this maestro bump: xamarin/xamarin-macios#19690, which has this range of commits: c282395...6f4f268, and looking through the commits I'm guessing this is the culprit: #93220

CC @mkhamoyan

Reproduction Steps

Do something like this:

cd packages/microsoft.netcore.app.runtime.mono.ios-arm64/9.0.0-alpha.1.23619.7/runtimes/ios-arm64/native
for symbol in $(monodis System.Private.CoreLib.dll | grep 'pinvokeimpl.*libSystem.Globalization.Native' | sed -e 's/.*as "//' -e 's/".*//'); do
	if ! nm libSystem.Globalization.Native.a|grep "_$symbol\$">/dev/null; then
		echo "NOT FOUND: $symbol"
	fi
done

Expected behavior

No symbols should be reported.

Actual behavior

NOT FOUND: GlobalizationNative_GetLatestJapaneseEra
NOT FOUND: GlobalizationNative_CloseSortHandle
NOT FOUND: GlobalizationNative_CompareString
NOT FOUND: GlobalizationNative_IndexOf
NOT FOUND: GlobalizationNative_LastIndexOf
NOT FOUND: GlobalizationNative_GetSortKey
NOT FOUND: GlobalizationNative_GetSortVersion
NOT FOUND: GlobalizationNative_GetICUVersion
NOT FOUND: GlobalizationNative_IsNormalized
NOT FOUND: GlobalizationNative_NormalizeString
NOT FOUND: GlobalizationNative_GetCalendars
NOT FOUND: GlobalizationNative_GetCalendarInfo
NOT FOUND: GlobalizationNative_EnumCalendarInfo
NOT FOUND: GlobalizationNative_GetJapaneseEraStartDate
NOT FOUND: GlobalizationNative_ChangeCase
NOT FOUND: GlobalizationNative_ChangeCaseInvariant
NOT FOUND: GlobalizationNative_ChangeCaseTurkish
NOT FOUND: GlobalizationNative_GetSortHandle
NOT FOUND: GlobalizationNative_StartsWith
NOT FOUND: GlobalizationNative_EndsWith
NOT FOUND: GlobalizationNative_GetLocaleName
NOT FOUND: GlobalizationNative_GetLocaleInfoString
NOT FOUND: GlobalizationNative_GetDefaultLocaleName
NOT FOUND: GlobalizationNative_IsPredefinedLocale
NOT FOUND: GlobalizationNative_GetLocaleTimeFormat
NOT FOUND: GlobalizationNative_GetLocaleInfoInt
NOT FOUND: GlobalizationNative_GetLocaleInfoGroupingSizes
NOT FOUND: GlobalizationNative_GetLocales
NOT FOUND: GlobalizationNative_GetTimeZoneDisplayName

Regression?

Yes.

Known Workarounds

None - note that this is breaking our build, so we can't take any maestro bumps until this is fixed.

Configuration

No response

Other information

No response

@ghost ghost added the untriaged New issue has not been triaged by the area owner label Dec 21, 2023
@ghost
Copy link

ghost commented Dec 21, 2023

Tagging subscribers to this area: @dotnet/area-system-globalization
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I've looked through the P/Invokes in System.Private.CoreLib.dll, and these don't have a corresponding native entry poin in libSystem.Globalization.Native.a:

GlobalizationNative_GetLatestJapaneseEra
GlobalizationNative_CloseSortHandle
GlobalizationNative_CompareString
GlobalizationNative_IndexOf
GlobalizationNative_LastIndexOf
GlobalizationNative_GetSortKey
GlobalizationNative_GetSortVersion
GlobalizationNative_GetICUVersion
GlobalizationNative_IsNormalized
GlobalizationNative_NormalizeString
GlobalizationNative_GetCalendars
GlobalizationNative_GetCalendarInfo
GlobalizationNative_EnumCalendarInfo
GlobalizationNative_GetJapaneseEraStartDate
GlobalizationNative_ChangeCase
GlobalizationNative_ChangeCaseInvariant
GlobalizationNative_ChangeCaseTurkish
GlobalizationNative_GetSortHandle
GlobalizationNative_StartsWith
GlobalizationNative_EndsWith
GlobalizationNative_GetLocaleName
GlobalizationNative_GetLocaleInfoString
GlobalizationNative_GetDefaultLocaleName
GlobalizationNative_IsPredefinedLocale
GlobalizationNative_GetLocaleTimeFormat
GlobalizationNative_GetLocaleInfoInt
GlobalizationNative_GetLocaleInfoGroupingSizes
GlobalizationNative_GetLocales
GlobalizationNative_GetTimeZoneDisplayName

Tested with: 9.0.0-alpha.1.23619.7

This started happening in this maestro bump: xamarin/xamarin-macios#19690, which has this range of commits: c282395...6f4f268, and looking through the commits I'm guessing this is the culprit: #93220

CC @mkhamoyan

Reproduction Steps

Do something like this:

cd packages/microsoft.netcore.app.runtime.mono.ios-arm64/9.0.0-alpha.1.23619.7/runtimes/ios-arm64/native
for symbol in $(monodis System.Private.CoreLib.dll | grep 'pinvokeimpl.*libSystem.Globalization.Native' | sed -e 's/.*as "//' -e 's/".*//'); do
	if ! nm libSystem.Globalization.Native.a|grep "_$symbol\$">/dev/null; then
		echo "NOT FOUND: $symbol"
	fi
done

Expected behavior

No symbols should be reported.

Actual behavior

NOT FOUND: GlobalizationNative_GetLatestJapaneseEra
NOT FOUND: GlobalizationNative_CloseSortHandle
NOT FOUND: GlobalizationNative_CompareString
NOT FOUND: GlobalizationNative_IndexOf
NOT FOUND: GlobalizationNative_LastIndexOf
NOT FOUND: GlobalizationNative_GetSortKey
NOT FOUND: GlobalizationNative_GetSortVersion
NOT FOUND: GlobalizationNative_GetICUVersion
NOT FOUND: GlobalizationNative_IsNormalized
NOT FOUND: GlobalizationNative_NormalizeString
NOT FOUND: GlobalizationNative_GetCalendars
NOT FOUND: GlobalizationNative_GetCalendarInfo
NOT FOUND: GlobalizationNative_EnumCalendarInfo
NOT FOUND: GlobalizationNative_GetJapaneseEraStartDate
NOT FOUND: GlobalizationNative_ChangeCase
NOT FOUND: GlobalizationNative_ChangeCaseInvariant
NOT FOUND: GlobalizationNative_ChangeCaseTurkish
NOT FOUND: GlobalizationNative_GetSortHandle
NOT FOUND: GlobalizationNative_StartsWith
NOT FOUND: GlobalizationNative_EndsWith
NOT FOUND: GlobalizationNative_GetLocaleName
NOT FOUND: GlobalizationNative_GetLocaleInfoString
NOT FOUND: GlobalizationNative_GetDefaultLocaleName
NOT FOUND: GlobalizationNative_IsPredefinedLocale
NOT FOUND: GlobalizationNative_GetLocaleTimeFormat
NOT FOUND: GlobalizationNative_GetLocaleInfoInt
NOT FOUND: GlobalizationNative_GetLocaleInfoGroupingSizes
NOT FOUND: GlobalizationNative_GetLocales
NOT FOUND: GlobalizationNative_GetTimeZoneDisplayName

Regression?

Yes.

Known Workarounds

None - note that this is breaking our build, so we can't take any maestro bumps until this is fixed.

Configuration

No response

Other information

No response

Author: rolfbjarne
Assignees: -
Labels:

area-System.Globalization

Milestone: -

@rolfbjarne
Copy link
Member Author

@mkhamoyan
Copy link
Contributor

@rolfbjarne yes it is related to #93220 .
After updating dependencies we will need to enable also HybridGlobalization by default xamarin/xamarin-macios#19695 .

@rolfbjarne
Copy link
Member Author

@mkhamoyan that doesn't change anything, our build fails in the same way:

error : clang++ exited with code 1:
error : Undefined symbols for architecture arm64:
error :   "_GlobalizationNative_ChangeCase", referenced from:
error :      -exported_symbol[s_list] command line option
error :      (maybe you meant: _GlobalizationNative_ChangeCaseNative, _GlobalizationNative_ChangeCaseInvariantNative )
error :   "_GlobalizationNative_ChangeCaseInvariant", referenced from:
error :      -exported_symbol[s_list] command line option
error :      (maybe you meant: _GlobalizationNative_ChangeCaseInvariantNative)
error :   "_GlobalizationNative_ChangeCaseTurkish", referenced from:
error :      -exported_symbol[s_list] command line option
error :   "_GlobalizationNative_CloseSortHandle", referenced from:
error :      -exported_symbol[s_list] command line option
error :   "_GlobalizationNative_CompareString", referenced from:
error :      -exported_symbol[s_list] command line option
error :      (maybe you meant: _GlobalizationNative_CompareStringNative)
error :   "_GlobalizationNative_EndsWith", referenced from:
error :      -exported_symbol[s_list] command line option
error :      (maybe you meant: _GlobalizationNative_EndsWithNative)
error :   "_GlobalizationNative_EnumC

which happens because there are P/Invokes to native functions that don't exist anymore.

AFAIK setting HybridGlobalization=true won't change anything unless the trimmer runs, and that doesn't always happen.

@mkhamoyan
Copy link
Contributor

@rolfbjarne we have new set of native functions that should be P/Invoked on hybrid mode https://github.com/dotnet/runtime/blob/main/src/native/libs/System.Globalization.Native/entrypoints.c#L60-#L81 , trimmer run shouldn't be related to hybrid mode.
Issue is that this gives false and it wants to define wrong set of functions, so somehow these targets are not getting defined.
We define these targets here
I'm now checking to see what can cause it.

@mkhamoyan
Copy link
Contributor

@rolfbjarne can we try defining in these section https://github.com/xamarin/xamarin-macios/blob/2bd23381e64494f4dbdcfcd71d161365d111a780/runtime/Makefile#L640 targets -DTARGET_IOS / -DTARGET_TVOS / -DTARGET_MACCATALYST?

@rolfbjarne
Copy link
Member Author

rolfbjarne commented Dec 22, 2023

@mkhamoyan not sure what that would accomplish? We're not compiling runtime code, we're just consuming your already built static/dynamic libraries, so definining those symbols won't change anything on our side.

In other words: those are linker flags, not compiler flags.

@mkhamoyan
Copy link
Contributor

Created #96270 for target definitions, once it will be merged we can check for xamarin-macios .
I'm not sure if there is a way to check it before merging and bumping the runtime version.

@rolfbjarne
Copy link
Member Author

I'm not sure if there is a way to check it before merging and bumping the runtime version.

You can run nm on the static libSystem.Globalization.Native.a library to see which functions it contains.

@mkhamoyan
Copy link
Contributor

The thing is I cannot reproduce same error in runtime tests/samples. When I check libSystem.Globalization.Native.a it contains hybrid functions even without #96270.

@ghost
Copy link

ghost commented Dec 24, 2023

Tagging subscribers to 'os-ios': @steveisok, @akoeplinger, @kotlarmilos
See info in area-owners.md if you want to be subscribed.

Issue Details

Description

I've looked through the P/Invokes in System.Private.CoreLib.dll, and these don't have a corresponding native entry point in libSystem.Globalization.Native.a:

GlobalizationNative_GetLatestJapaneseEra
GlobalizationNative_CloseSortHandle
GlobalizationNative_CompareString
GlobalizationNative_IndexOf
GlobalizationNative_LastIndexOf
GlobalizationNative_GetSortKey
GlobalizationNative_GetSortVersion
GlobalizationNative_GetICUVersion
GlobalizationNative_IsNormalized
GlobalizationNative_NormalizeString
GlobalizationNative_GetCalendars
GlobalizationNative_GetCalendarInfo
GlobalizationNative_EnumCalendarInfo
GlobalizationNative_GetJapaneseEraStartDate
GlobalizationNative_ChangeCase
GlobalizationNative_ChangeCaseInvariant
GlobalizationNative_ChangeCaseTurkish
GlobalizationNative_GetSortHandle
GlobalizationNative_StartsWith
GlobalizationNative_EndsWith
GlobalizationNative_GetLocaleName
GlobalizationNative_GetLocaleInfoString
GlobalizationNative_GetDefaultLocaleName
GlobalizationNative_IsPredefinedLocale
GlobalizationNative_GetLocaleTimeFormat
GlobalizationNative_GetLocaleInfoInt
GlobalizationNative_GetLocaleInfoGroupingSizes
GlobalizationNative_GetLocales
GlobalizationNative_GetTimeZoneDisplayName

Tested with: 9.0.0-alpha.1.23619.7

This started happening in this maestro bump: xamarin/xamarin-macios#19690, which has this range of commits: c282395...6f4f268, and looking through the commits I'm guessing this is the culprit: #93220

CC @mkhamoyan

Reproduction Steps

Do something like this:

cd packages/microsoft.netcore.app.runtime.mono.ios-arm64/9.0.0-alpha.1.23619.7/runtimes/ios-arm64/native
for symbol in $(monodis System.Private.CoreLib.dll | grep 'pinvokeimpl.*libSystem.Globalization.Native' | sed -e 's/.*as "//' -e 's/".*//'); do
	if ! nm libSystem.Globalization.Native.a|grep "_$symbol\$">/dev/null; then
		echo "NOT FOUND: $symbol"
	fi
done

Expected behavior

No symbols should be reported.

Actual behavior

NOT FOUND: GlobalizationNative_GetLatestJapaneseEra
NOT FOUND: GlobalizationNative_CloseSortHandle
NOT FOUND: GlobalizationNative_CompareString
NOT FOUND: GlobalizationNative_IndexOf
NOT FOUND: GlobalizationNative_LastIndexOf
NOT FOUND: GlobalizationNative_GetSortKey
NOT FOUND: GlobalizationNative_GetSortVersion
NOT FOUND: GlobalizationNative_GetICUVersion
NOT FOUND: GlobalizationNative_IsNormalized
NOT FOUND: GlobalizationNative_NormalizeString
NOT FOUND: GlobalizationNative_GetCalendars
NOT FOUND: GlobalizationNative_GetCalendarInfo
NOT FOUND: GlobalizationNative_EnumCalendarInfo
NOT FOUND: GlobalizationNative_GetJapaneseEraStartDate
NOT FOUND: GlobalizationNative_ChangeCase
NOT FOUND: GlobalizationNative_ChangeCaseInvariant
NOT FOUND: GlobalizationNative_ChangeCaseTurkish
NOT FOUND: GlobalizationNative_GetSortHandle
NOT FOUND: GlobalizationNative_StartsWith
NOT FOUND: GlobalizationNative_EndsWith
NOT FOUND: GlobalizationNative_GetLocaleName
NOT FOUND: GlobalizationNative_GetLocaleInfoString
NOT FOUND: GlobalizationNative_GetDefaultLocaleName
NOT FOUND: GlobalizationNative_IsPredefinedLocale
NOT FOUND: GlobalizationNative_GetLocaleTimeFormat
NOT FOUND: GlobalizationNative_GetLocaleInfoInt
NOT FOUND: GlobalizationNative_GetLocaleInfoGroupingSizes
NOT FOUND: GlobalizationNative_GetLocales
NOT FOUND: GlobalizationNative_GetTimeZoneDisplayName

Regression?

Yes.

Known Workarounds

None - note that this is breaking our build, so we can't take any maestro bumps until this is fixed.

Configuration

No response

Other information

No response

Author: rolfbjarne
Assignees: -
Labels:

area-System.Globalization, untriaged, os-ios

Milestone: -

@rolfbjarne
Copy link
Member Author

@mkhamoyan any news about this? More and more people are running into this by installing a newer .NET 9 build.

@SamMonoRT SamMonoRT added this to the 9.0.0 milestone Jan 4, 2024
@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Jan 4, 2024
@mkhamoyan
Copy link
Contributor

@rolfbjarne #96270 is already merged. Can we update xamarin/xamarin-macios#19690 to see if that helps?

@rolfbjarne
Copy link
Member Author

@rolfbjarne #96270 is already merged. Can we update xamarin/xamarin-macios#19690 to see if that helps?

We'll get it once it flows through maestro (looks like it's stuck here at the moment: dotnet/installer#18133)

@steveisok
Copy link
Member

@rolfbjarne @mkhamoyan I suspect the change is not going to help. @rolfbjarne I think the way the pinvokes are validated needs to change. We are shipping with hybrid globalization always on, so there's a smaller subset of pinvokes actually used.

We don't want to trim things out because we plan on adding the ability to turn HG off and use our ICU in a follow up change.

@rolfbjarne
Copy link
Member Author

@rolfbjarne @mkhamoyan I suspect the change is not going to help.

It didn't.

@rolfbjarne I think the way the pinvokes are validated needs to change. We are shipping with hybrid globalization always on, so there's a smaller subset of pinvokes actually used.

We're not actually validating, this is a consequence of:

  1. Asking the native linker to trim unused code (dead strip).
  2. Using static libraries.

In this case we need to tell the native linker which native functions to keep, so we collect all the P/Invokes (whose target library is a static library), and ask the native linker to keep those.

The problem is if there are P/Invokes to native functions that don't exist - in which case the native linker will complain and show an error.

Technically we could stop asking the native linker to trim unused code, but it would turn into a size regression (potentially quite big when using third-party native libraries).

@rolfbjarne
Copy link
Member Author

The thing is I cannot reproduce same error in runtime tests/samples. When I check libSystem.Globalization.Native.a it contains hybrid functions even without #96270.

I build dotnet/runtime like this:

$ ./build.sh mono+libs -os ios -arch arm64

and then I checked that System.Private.CoreLib.dll has GlobalizationNative_CloseSortHandle (I just picked one of the symbols to test for):

$ monodis ./artifacts/bin/microsoft.netcore.app.runtime.ios-arm64/Debug/runtimes/ios-arm64/native/System.Private.CoreLib.dll | grep GlobalizationNative_CloseSortHandle
    .method assembly static hidebysig pinvokeimpl ("libSystem.Globalization.Native" as "GlobalizationNative_CloseSortHandle" winapi nomangle )

but libSystem.Globalization.Native.a does not have the same symbol:

$ nm ./artifacts/bin/microsoft.netcore.app.runtime.ios-arm64/Debug/runtimes/ios-arm64/native/libSystem.Globalization.Native.a | grep GlobalizationNative_CloseSortHandle
[ no output ]

@mkhamoyan
Copy link
Contributor

libSystem.Globalization.Native.a does not have GlobalizationNative_CloseSortHandle symbol as it will not be used when HybridGlobalization is on.
Only these symbols will be used

DllImportEntry(GlobalizationNative_ChangeCaseInvariantNative)
DllImportEntry(GlobalizationNative_ChangeCaseNative)
DllImportEntry(GlobalizationNative_CompareStringNative)
DllImportEntry(GlobalizationNative_GetDefaultLocaleNameNative)
DllImportEntry(GlobalizationNative_EndsWithNative)
DllImportEntry(GlobalizationNative_GetCalendarInfoNative)
DllImportEntry(GlobalizationNative_GetCalendarsNative)
DllImportEntry(GlobalizationNative_GetJapaneseEraStartDateNative)
DllImportEntry(GlobalizationNative_GetLatestJapaneseEraNative)
DllImportEntry(GlobalizationNative_GetLocaleInfoIntNative)
DllImportEntry(GlobalizationNative_GetLocaleInfoPrimaryGroupingSizeNative)
DllImportEntry(GlobalizationNative_GetLocaleInfoSecondaryGroupingSizeNative)
DllImportEntry(GlobalizationNative_GetLocaleInfoStringNative)
DllImportEntry(GlobalizationNative_GetLocaleNameNative)
DllImportEntry(GlobalizationNative_GetLocalesNative)
DllImportEntry(GlobalizationNative_GetLocaleTimeFormatNative)
DllImportEntry(GlobalizationNative_GetSortKeyNative)
DllImportEntry(GlobalizationNative_GetTimeZoneDisplayNameNative)
DllImportEntry(GlobalizationNative_IndexOfNative)
DllImportEntry(GlobalizationNative_IsNormalizedNative)
DllImportEntry(GlobalizationNative_NormalizeStringNative)
DllImportEntry(GlobalizationNative_StartsWithNative)
#endif
DllImportEntry(GlobalizationNative_ToAscii)
DllImportEntry(GlobalizationNative_ToUnicode)
DllImportEntry(GlobalizationNative_InitOrdinalCasingPage)
.

If there is some validation between System.Private.CoreLib.dll and libSystem.Globalization.Native.a symbols, we can filter out from System.Private.CoreLib.dll not used symbols, will it be enough or there are other validations also?
@steveisok @akoeplinger

@steveisok
Copy link
Member

steveisok commented Jan 9, 2024

If there is some validation between System.Private.CoreLib.dll and libSystem.Globalization.Native.a symbols, we can filter out from System.Private.CoreLib.dll not used symbols, will it be enough or there are other validations also?

@steveisok @akoeplinger

I think a linker substitution around the hybrid globalization checks may set SPC right. Assuming I'm correct, @rolfbjarne that is something you would have to do.

@marek-safar
Copy link
Contributor

What @rolfbjarne is pointing out is that libSystem.Globalization.Native.a does not have GlobalizationNative_CloseSortHandle symbol. It does not matter if hybrid globalization is on or off because that native symbol is never available but it's referenced by managed code.

@rolfbjarne
Copy link
Member Author

I think a linker substitution around the hybrid globalization checks may set SPC right. Assuming I'm correct, @rolfbjarne that is something you would have to do.

We can't rely on the linker, because it doesn't always run.

@steveisok
Copy link
Member

We can't rely on the linker, because it doesn't always run.

Got it. I think that might mean we would need to ship two different runtimes. If that's the case, I would rather not support our ICU any longer and adjust the pinvokes from SPC so that they match.

@rolfbjarne
Copy link
Member Author

I think that might mean we would need to ship two different runtimes.

I'm not quite sure I understand the problem.

Is there any reason you can't remove the P/Invokes from System.Private.CoreLib.dll? If they're never going to be called, there's no reason for them to exist.

An alternative solution is to add placeholder/empty native symbols, so that the native linker finds something.

@steveisok
Copy link
Member

I'm not quite sure I understand the problem.

Sorry, I'm mashing up what needs to come after to support HG as the default and being able to flip back to our ICU. It's clear what we need to do to fix this.

@rolfbjarne
Copy link
Member Author

rolfbjarne commented Jan 11, 2024

The last PR fixed the issue with regards to the disconnect between native functions and P/Invokes.

However, the build problem isn't fully resolved yet, it fails with this now:

Undefined symbols for architecture arm64:
  "_u_toupper", referenced from:
      _GlobalizationNative_InitOrdinalCasingPage in libSystem.Globalization.Native.a(pal_common.c.o)
  "_uidna_close", referenced from:
      _GlobalizationNative_ToAscii in libSystem.Globalization.Native.a(pal_idna.c.o)
      _GlobalizationNative_ToUnicode in libSystem.Globalization.Native.a(pal_idna.c.o)
  "_uidna_nameToASCII", referenced from:
      _GlobalizationNative_ToAscii in libSystem.Globalization.Native.a(pal_idna.c.o)
  "_uidna_nameToUnicode", referenced from:
      _GlobalizationNative_ToUnicode in libSystem.Globalization.Native.a(pal_idna.c.o)
  "_uidna_openUTS46", referenced from:
      _GlobalizationNative_ToAscii in libSystem.Globalization.Native.a(pal_idna.c.o)
      _GlobalizationNative_ToUnicode in libSystem.Globalization.Native.a(pal_idna.c.o)
ld: symbol(s) not found for architecture arm64

These symbols used to be provided by libicuuc.a, but that library isn't shipped anymore it seems.

@mkhamoyan
Copy link
Contributor

mkhamoyan commented Jan 11, 2024

We ship licucore (from ios sdk) which contains these symbols.

@rolfbjarne
Copy link
Member Author

We ship licucore (from ios sdk) which contains these symbols.

There's no libicucore.a here:

$ ls -la dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/*.a
-rwxr--r--@ 1 rolf  staff    284904 Jan 10 18:18 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libSystem.Globalization.Native.a
-rwxr--r--@ 1 rolf  staff   2777696 Jan 10 18:18 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libSystem.IO.Compression.Native.a
-rwxr--r--@ 1 rolf  staff    469416 Jan 10 18:18 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libSystem.Native.a
-rwxr--r--@ 1 rolf  staff     31424 Jan 10 18:18 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libSystem.Net.Security.Native.a
-rwxr--r--@ 1 rolf  staff    330168 Jan 10 18:18 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libSystem.Security.Cryptography.Native.Apple.a
-rwxr--r--@ 1 rolf  staff   1283720 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-debugger-static.a
-rwxr--r--@ 1 rolf  staff     67312 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-debugger-stub-static.a
-rwxr--r--@ 1 rolf  staff   2517584 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-diagnostics_tracing-static.a
-rwxr--r--@ 1 rolf  staff     31344 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-diagnostics_tracing-stub-static.a
-rwxr--r--@ 1 rolf  staff    293976 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-hot_reload-static.a
-rwxr--r--@ 1 rolf  staff     45880 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-hot_reload-stub-static.a
-rwxr--r--@ 1 rolf  staff    200040 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-marshal-ilgen-static.a
-rwxr--r--@ 1 rolf  staff     60704 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmono-component-marshal-ilgen-stub-static.a
-rwxr--r--@ 1 rolf  staff  19818880 Jan 10 18:14 dotnet-sdk-9.0.100-alpha.1.24060.49/packs/Microsoft.NETCore.App.Runtime.Mono.ios-arm64/9.0.0-alpha.1.24060.9/runtimes/ios-arm64/native/libmonosgen-2.0.a

@mkhamoyan
Copy link
Contributor

My mistake, we don't ship the lib but use the one from Apple sdks, like /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/lib/libicucore.tbd . @akoeplinger do you know how we can make this lib reachable for xamarin ?

@rolfbjarne
Copy link
Member Author

My mistake, we don't ship the lib but use the one from Apple sdks

Ah, ok, I made it work that way, so this is fixed now then.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants