-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Add a proxy for ber scanf/printf varargs native methods. #50540
Conversation
/azp list |
/azp run runtime-libraries-coreclr outerloop, runtime-libraries-coreclr outerloop-osx |
Azure Pipelines successfully started running 2 pipeline(s). |
@@ -0,0 +1,61 @@ | |||
project(LdapProxy.Native C) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nearly all shims under libraries/Native are proxies (trivial wrappers) like this one, but we do not call them proxies. Would System.DirectoryServices.Native
be a better name for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to do that but it looked for me that Ldap related name shows what inside that library better than System.DirectoryServices.Native
, but it is probably for me who did not work System.DirectoryServices
. I will rename it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I can't find a solution for it, System.DirectoryServices.Native
is Linux only so it does not fail like this on Windows. I could delete windows's proxy and use __arglist in C# for Windows.
It means I need to deal with Linux failures first, there sometimes we can't find "ldap" library, example.
I am using find_library(LIBLDAP NAMES ldap)
there, the name could be libldap-2.4.so.2
on Linux, libldap.dylib
on OSX and it works in "default" configs but not in "SingleFile/AllSubsets_Mono" etc, am I missing something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jkotas about naming this library System.DirectoryServicies.Native
. It fits the model of the files we ship.
src/installer/pkg/sfx/Microsoft.NETCore.App/Directory.Build.props
Outdated
Show resolved
Hide resolved
cc @AaronRobinsonMSFT Maybe the complexity involved in implementing this shim will make us rather implement the vararg calling convention for Unix interop in some form. |
4e7f2d0
to
475aa96
Compare
I have fixed "The following files are missing entries in the templated manifest" issues using #46342 as an example, no idea how System.IO.Ports.Native avoids these errors. |
System.IO.Ports.Native doesn't ship with the shared framework, so the native assets don't need to be listed. |
find_library(LIBLDAP NAMES ldap) | ||
if(LIBLDAP STREQUAL LIBLDAP-NOTFOUND) | ||
find_library(LIBLDAP NAMES libldap.dylib) | ||
endif() | ||
|
||
if(LIBLDAP STREQUAL LIBLDAP-NOTFOUND) | ||
find_library(LIBLDAP NAMES libldap-2.4.so.2) | ||
endif() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
find_library(LIBLDAP NAMES ldap) | |
if(LIBLDAP STREQUAL LIBLDAP-NOTFOUND) | |
find_library(LIBLDAP NAMES libldap.dylib) | |
endif() | |
if(LIBLDAP STREQUAL LIBLDAP-NOTFOUND) | |
find_library(LIBLDAP NAMES libldap-2.4.so.2) | |
endif() | |
find_library(LIBLDAP NAMES ldap libldap.dylib libldap-2.4.so.2) |
@@ -0,0 +1,61 @@ | |||
project(LdapProxy.Native C) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @jkotas about naming this library System.DirectoryServicies.Native
. It fits the model of the files we ship.
If I understand correctly we don't need LdapProxy.Native to be shipped with the shared framework, how is System.IO.Ports.Native excluded from it? |
It's excluded here: runtime/eng/liveBuilds.targets Lines 157 to 158 in ee4d435
|
9e38bf5
to
d2a6890
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
squashed the commits for an easier review, rebased on top of the last infra changes.
JanV suggested that we would need Ldap library in our build docker images (now only in running images) so I opened dotnet/arcade#7197 to update them.
@@ -7861,7 +7861,8 @@ | |||
}, | |||
"ModulesToPackages": { | |||
"libSystem.IO.Ports.Native": "runtime.native.System.IO.Ports", | |||
"sni.dll": "runtime.native.System.Data.SqlClient.sni" | |||
"sni.dll": "runtime.native.System.Data.SqlClient.sni", | |||
"libSystem.DirectoryServices.Native": "runtime.native.System.DirectoryServices", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like it works for unix only, maybe we need:
"System.DirectoryServices.Nativ(.dll): "runtime.native.System.DirectoryServices",
@@ -0,0 +1,12 @@ | |||
<Project> | |||
<ItemGroup Condition="'$(GeneratePackage)' == 'true'"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this file was copied from System.IO.Ports.Native but probably should be updated for windows.
d2a6890
to
13dc607
Compare
13dc607
to
60750e3
Compare
fix x86. fix linux
d5b07c6
to
be25066
Compare
replaced by #51205 |
The PR adds wrappers for native varargs methods
ber_scanf
andber_printf
to fix failures on Apple arm64, closes #49105.It was working on other platforms because vararg methods were expecting the arguments in the same registers as regular calls. It does not work for Apple OSX and for consistency I have decided to use these wrappers on all platforms. If these methods are performance-critical we could reconsider it.
This change could be done reverted if we implement #48796.
Until that we would need similar wrappers for all varargs for Apple Arm64, cc @sdmaclea , @janvorli , @JulieLeeMSFT, @mangod9.