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

configure-system-libraries.sh: Skip 32bit libraries during lookup on x64 Linux. #21353 #21382

Open
wants to merge 1 commit into
base: bleed
Choose a base branch
from

Conversation

tinix0
Copy link
Contributor

@tinix0 tinix0 commented Apr 1, 2024

Fixes #21353
When looking up system libraries on x64 Linux, there might be 32bit libraries present higher on the path priority list than 64bit libraries. These should be skipped, since there is no official 32bit build of .NET 6 for Linux.

Tested on OpenSuse Tumbleweed.

Copy link
Contributor

@anvilvapre anvilvapre left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. uname, arch are part of binutils. readelf is part of binutils. the last is not installed by default (on at least ubuntu). perhaps you could use file on the resolved symlink to the so.
  2. is arch (and readelf) available on macos? would be good if someone tests the script there.
  3. you now call uname and arch for each match. before calling the function there is also already a check on OS. wouldn't it be better to just to the arch check there as well and pass one additional function arguments to indicate the OS and arch.
  4. couldn't a simpler approach be to just call the patch_config function with only 64bit search dirs on 64 bit platforms? this was the readelf check is no longer needed? assuming 64 bit so files are always in lib64 dirs?

@anvilvapre
Copy link
Contributor

i believe there is also a matching issue for this. perhaps you can try to link it. i.e. resolves #issueid.

@tinix0
Copy link
Contributor Author

tinix0 commented Apr 2, 2024

  1. uname, arch are part of binutils. readelf is part of binutils. the last is not installed by default (on at least ubuntu). perhaps you could use file on the resolved symlink to the so.

    1. is arch (and readelf) available on macos? would be good if someone tests the script there.

    2. you now call uname and arch for each match. before calling the function there is also already a check on OS. wouldn't it be better to just to the arch check there as well and pass one additional function arguments to indicate the OS and arch.

    3. couldn't a simpler approach be to just call the patch_config function with only 64bit search dirs on 64 bit platforms? this was the readelf check is no longer needed? assuming 64 bit so files are always in lib64 dirs?

  1. Possibly, but the output is less deterministic.
  2. The script already uses arch in darwin path. readelf is not required to be present, its under an linux if statement after all. I do own a Mac and can check it.
  3. You are right it would be better to check only once
  4. 64bit files might not always be in /lib64, IIRC some distributions put them directly into /lib.

i believe there is also a matching issue for this. perhaps you can try to link it. i.e. resolves #issueid.

I forgot Github does not reference issues from name.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Symlinks from configure script point to 32bit libraries if both, 32bit and 64bit libraries are installed
2 participants