-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
undefined reference to `pcsc_assert_wire_constants' error when cross compiling with newest 2.2.0 version #184
Comments
You should use meson instead of configure/make. See https://blog.apdu.fr/posts/2024/05/pcsc-lite-now-uses-meson-build-tool/ |
never used mason. i tried now :) but i have a problem with libusb. i get the following error: /tmp# meson setup pcsc-lite-2.2.0 --cross-file mipsel -Dpolkit=false -Dlibsystemd=false -Dlibudev=false -Dlibusb=true pcsc-lite-2.2.0/meson.build:102:2: ERROR: Dependency "libusb-1.0" not found, tried pkgconfig A full log can be found at /tmp/meson-logs/meson-log.txt** the cross file looks like this: [binaries] [host_machine] i think this is missing for meson, the old way i used: LIBUSB_LIBS="-L$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib -lusb-1.0" LIBUSB_CFLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/libusb-1.0" but i dont know how to use this with meson. |
I never used cross compilation. https://blog.apdu.fr/posts/2020/11/how-to-get-smart-card-support/ |
for years, there was no problem. is there no way to get it worked like it was before? or it is the old method now deprecated? |
i managed to get it worked. the problem was in the file: pcsc-wirecheck-main.c the default values in this file are:#include <stdio.h> int pcsc_assert_wire_constants(void); int
}with this it dont work. but when i change the line:
to
then it works without problem. i dont know if pcsc_assert_wire_constants is important, but without it, now it works like before. the complete way i cross compile it looks like this now: wget https://pcsclite.apdu.fr/files/pcsc-lite-2.2.1.tar.xz |
with the older 2.1.0 version i could succesful cross compile on a x64 machine with debian for mipsel with this:
wget https://pcsclite.apdu.fr/files/pcsc-lite-2.1.0.tar.bz2
tar -xf pcsc-lite-2.1.0.tar.bz2 && cd pcsc-lite-2.1.0
export TOOLCHAIN=/opt/broadcom_7.0
export PATH="$TOOLCHAIN/bin:$PATH"
./configure --prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/ --host=mipsel-unknown-linux-gnu --disable-polkit --disable-libsystemd --disable-libudev --disable-documentation --enable-libusb LIBUSB_LIBS="-L$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib -lusb-1.0" LIBUSB_CFLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/libusb-1.0"
make
make install
but this is not working anymore with the newest 2.2.0 version on the same machine. now i can configure it like this:
wget https://pcsclite.apdu.fr/files/pcsc-lite-2.2.0.tar.xz
tar -xf pcsc-lite-2.2.0.tar.xz && cd pcsc-lite-2.2.0
export TOOLCHAIN=/opt/broadcom_7.0
export PATH="$TOOLCHAIN/bin:$PATH"
./bootstrap &&
./configure
--prefix=$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/
--host=mipsel-unknown-linux-gnu
--disable-polkit
--disable-libsystemd
--disable-libudev
--disable-documentation
--enable-libusb LIBUSB_LIBS="-L$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/lib -lusb-1.0" LIBUSB_CFLAGS="-I$TOOLCHAIN/mipsel-unknown-linux-gnu/sys-root/usr/include/libusb-1.0"
and this works. but when i now do make, i get the following error:
/tmp/pcsc-lite-2.2.0# make
make all-recursive
make[1]: Verzeichnis „/tmp/pcsc-lite-2.2.0“ wird betreten
Making all in src
make[2]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src“ wird betreten
Making all in spy
make[3]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src/spy“ wird betreten
CC libpcscspy.lo
CC ../sys_unix.lo
CCLD libpcscspy.la
make[3]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src/spy“ wird verlassen
make[3]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src“ wird betreten
CC testpcsc.o
CC error.lo
CC libredirect.lo
CCLD libpcsclite.la
CCLD testpcsc
CC pcsc-wirecheck-gen.o
CCLD pcsc-wirecheck-gen
rm -f pcsc-wirecheck-dist.c
./pcsc-wirecheck-gen > pcsc-wirecheck-dist.c.tmp
/bin/bash: Zeile 8: ./pcsc-wirecheck-gen: Kann die Binärdatei nicht ausführen: Fehler im Format der Programmdatei
mv pcsc-wirecheck-dist.c.tmp pcsc-wirecheck-dist.c
CC pcsc-wirecheck-dist.o
CC pcsc-wirecheck-main.o
CCLD pcsc-wirecheck
/opt/broadcom/bin/../lib/gcc/mipsel-unknown-linux-gnu/8.3.0/../../../../mipsel-unknown-linux-gnu/bin/ld: pcsc-wirecheck-main.o: in function
main': /tmp/pcsc-lite-2.2.0/src/pcsc-wirecheck-main.c:12: undefined reference to
pcsc_assert_wire_constants'collect2: error: ld returned 1 exit status
make[3]: *** [Makefile:783: pcsc-wirecheck] Fehler 1
make[3]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src“ wird verlassen
make[2]: *** [Makefile:1332: all-recursive] Fehler 1
make[2]: Verzeichnis „/tmp/pcsc-lite-2.2.0/src“ wird verlassen
make[1]: *** [Makefile:444: all-recursive] Fehler 1
make[1]: Verzeichnis „/tmp/pcsc-lite-2.2.0“ wird verlassen
make: *** [Makefile:374: all] Fehler 2
i dont know, how to get it to work. thats why i am asking here for help :) or is this a bug? thanx for your answer in advance ;)
The text was updated successfully, but these errors were encountered: