-
-
Notifications
You must be signed in to change notification settings - Fork 110
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
static pcscd + ccid #217
Comments
pcsc-lite has a define But I never used it. I guess it will not work with USB hotplug. |
I am able to build pcscd + ccid but:
|
What benefits do you expect from a static link pcscd + libccid? |
Thanks for taking up the report and checking the possibilities. The main goal and benefit is to provide a working statically linked application, along with a static daemon, working without system requirements and dependencies. |
My pcscd (linked statically with libccid) has many other dependencies:
If I disable libsystemd and polkit I still get:
|
Using a static link with ONE driver will have many limitations and would need writing a new hotplug code. I do not plan to work on it now. I worked on a POC:
Here is the patch: diff --git a/meson.build b/meson.build
index 9cb3a2b8..535e7e43 100644
--- a/meson.build
+++ b/meson.build
@@ -143,6 +143,15 @@ if pcsc_arch == 'Darwin'
endif
conf_data.set_quoted('PCSC_ARCH', pcsc_arch)
+# static driver link
+if get_option('static-driver') != ''
+ conf_data.set('PCSCLITE_STATIC_DRIVER', 1)
+ conf_data.set('IFDHANDLERv3', 1)
+ pcscd_dep += declare_dependency(link_args : get_option('static-driver'))
+ pcscd_dep += dependency('libusb-1.0')
+ features += 'static=' + get_option('static-driver')
+endif
+
features += pcsc_arch
features += target_machine.cpu()
features += 'ipcdir=' + get_option('ipcdir')
diff --git a/meson.options b/meson.options
index f0b58cac..7a5d805d 100644
--- a/meson.options
+++ b/meson.options
@@ -53,3 +53,8 @@ option('filter_names',
type : 'boolean',
value : true,
description : 'reader filtering using PCSCLITE_FILTER_IGNORE_READER_NAMES and PCSCLITE_FILTER_EXTEND_READER_NAMES')
+
+option('static-driver',
+ type : 'string',
+ value : '',
+ description : 'link with a specific driver')
diff --git a/src/pcscdaemon.c b/src/pcscdaemon.c
index 7dc804df..b1ada158 100644
--- a/src/pcscdaemon.c
+++ b/src/pcscdaemon.c
@@ -771,6 +771,18 @@ int main(int argc, char **argv)
}
RFWaitForReaderInit();
+#else
+ {
+ const char * deviceName = "usb:058f/9540:libudev:0:/dev/bus/usb/001/005";
+
+ rv = RFAddReader("Static reader", PCSCLITE_HP_BASE_PORT + 0,
+ "fakelib", deviceName);
+ if (SCARD_S_SUCCESS != rv)
+ {
+ Log2(PCSC_LOG_ERROR, "Failed adding device: %s", deviceName);
+ at_exit();
+ }
+ }
#endif
/* initialization succeeded */
First build libccid generating a static library using: Build pcsc-lite using something like: |
@areqq if this feature is important for you, you can contact me by email |
Sorry for the poor responsiveness and delays - I'm on a trip. As you've noticed, just statically linking libccid is not enough, libc/libusb and the rest should be statically linked as well. Without hotplug it would still be usable for me, even with passing reader identification as a parameter/system variable, but without hardcoding in the code. |
Is there a way to build a static pcscd + ccid that doesn’t require libccid.so?
I would like to get one binary file sufficient to operate, without any system dependencies.
The text was updated successfully, but these errors were encountered: