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

Fix using dlopen on OpenBSD #198

Closed
wants to merge 1 commit into from

Conversation

brad0
Copy link
Contributor

@brad0 brad0 commented Jul 29, 2024

libraries dlopen'd on OpenBSD need to have the major version
left off.

libraries dlopen'd on OpenBSD need to have the major version
left off.
@LudovicRousseau
Copy link
Owner

Surprising

How do you install 2 different major versions of a library at the same time?
You can't do that on OpenBSD?

@brad0
Copy link
Contributor Author

brad0 commented Aug 1, 2024

Surprising

How do you install 2 different major versions of a library at the same time?
You can't do that on OpenBSD?

Shared libs and versioning are handled a bit differently with OpenBSD versus other ELF based OS.
There are no symlinks. As in no libfoo.so, libfoo.so.1 symlinks. Just libfoo.so.2.0, libfoo.so.3.0.

@LudovicRousseau
Copy link
Owner

ah OK.
So will it work if the code uses libpcsclite_real.so.1.0 instead of libpcsclite_real.so.1?

@LudovicRousseau
Copy link
Owner

I tried on OpenBSD 7.5 and I have NO problem with the current code.

In the build directory the files are:

openbsd$ ls
build.ninja                libpcsclite_real.so.1      pcsc_demo.p
compile_commands.json      libpcsclite_real.so.1.p    pcscd
config.h                   libpcscspy.so              pcscd.8
doxygen.conf               libpcscspy.so.0            pcscd.h
libpcsclite.so             libpcscspy.so.0.p          pcscd.p
libpcsclite.so.1           meson-info                 pcsclite.h
libpcsclite.so.1.p         meson-logs                 reader.conf.5
libpcsclite_fake.so        meson-private              testpcsc
libpcsclite_fake.so.p      meson-uninstalled          testpcsc.p
libpcsclite_real.so        pcsc_demo

I have no problem to run the sample code ./testpcsc for example:

penbsd$ ./testpcsc                                                            

MUSCLE PC/SC Lite unitary test Program

THIS PROGRAM IS NOT DESIGNED AS A TESTING TOOL FOR END USERS!
Do NOT use it unless you really know what you do.

Testing SCardEstablishContext	: Command successful.
Testing SCardIsValidContext	: Command successful.
Testing SCardIsValidContext	: Invalid handle. (don't panic)
Testing SCardListReaderGroups	: Command successful.
Group 01: SCard$DefaultReaders
Testing SCardFreeMemory		: Command successful.
Testing SCardListReaders	: Cannot find a smart card reader. (don't panic)
Testing SCardGetStatusChange 
Please insert a working reader	: ^C

If pcscd is not started I get:

openbsd$ ./testpcsc                                                            

MUSCLE PC/SC Lite unitary test Program

THIS PROGRAM IS NOT DESIGNED AS A TESTING TOOL FOR END USERS!
Do NOT use it unless you really know what you do.

Testing SCardEstablishContext	: Service not available.

"Service not available." is the expected error.

If I remove libpcsclite_real.so.1 I get instead:

openbsd$ ./testpcsc                                                            

MUSCLE PC/SC Lite unitary test Program

THIS PROGRAM IS NOT DESIGNED AS A TESTING TOOL FOR END USERS!
Do NOT use it unless you really know what you do.

loading "libpcsclite_real.so.1" failed: File not found
Testing SCardEstablishContext	: Internal error.

I guess your problem is elsewhere.

@LudovicRousseau
Copy link
Owner

No feedback since one month.
If you think there is a real bug please add your comments.

Closing for now

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

Successfully merging this pull request may close these issues.

2 participants