Forums » Saxon/C Help and Discussions »
Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34'
Added by Martin Honnen almost 2 years ago
I am currently trying to use SaxonC 12.0 HE on WSL Debian 11, I get various ld errors when trying to build e.g. the commands:
mh@LibertyDell:~/libsaxon-HEC-linux-v12.0/command$ ./build-saxonc-commands.sh
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_getattr_np@GLIBC_2.32'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlclose@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_kill@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_join@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_setname_np@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getstack@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlsym@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_condattr_setclock@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlopen@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_getattr_np@GLIBC_2.32'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlclose@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_kill@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_join@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_setname_np@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getstack@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlsym@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_condattr_setclock@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlopen@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
Validate.c: In function ‘validate’:
Validate.c:32:19: warning: implicit declaration of function ‘j_run_validate’; did you mean ‘j_validate’? [-Wimplicit-function-declaration]
32 | long status = j_run_validate(environi->thread, (void *)processorDataRef);
| ^~~~~~~~~~~~~~
| j_validate
/usr/bin/ld: /tmp/ccTeiEt8.o: in function `validate':
Validate.c:(.text+0xa8): undefined reference to `j_run_validate'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_getattr_np@GLIBC_2.32'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlclose@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_kill@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_join@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_setname_np@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getstack@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlsym@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_condattr_setclock@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `dlopen@GLIBC_2.34'
/usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
I am not sure whether I need to install something first, I checked e.g.
apt list libc6
Listing... Done
libc6/stable,stable-updates,now 2.31-13+deb11u5 amd64 [installed]
apt list gcc
Listing... Done
gcc/stable,now 4:10.2.1-1 amd64 [installed]
mh@LibertyDell:~/libsaxon-HEC-linux-v12.0/command$ apt list g++
Listing... Done
g++/stable,now 4:10.2.1-1 amd64 [installed]
Is there something I need to update?
Replies (6)
Please register to reply
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by O'Neil Delpratt almost 2 years ago
I have not seen this error before. Wondering if you need to add the -lpthread
option when you compile the Cf files in the build script.
Do the C+ samples work?
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by O'Neil Delpratt almost 2 years ago
This error actually seems related to the following bug issue: https://saxonica.plan.io/issues/5856
I want to add that I had to install libc6 because it needed GLIBC_2.32 instead of the default version provided by Debian. You can see that through the second apt-get install.
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by Martin Honnen almost 2 years ago
No, building the C++ samples gives similar errors
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_getattr_np@GLIBC_2.32'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `dlclose@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_kill@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_join@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_setname_np@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getstack@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `dlsym@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_setstacksize@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_condattr_setclock@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `dlopen@GLIBC_2.34'
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/10/../../../../lib/libsaxon-hec-12.0.so: undefined reference to `pthread_create@GLIBC_2.34'
collect2: error: ld returned 1 exit status
I had seen that note about libc6 but as
apt list libc6
Listing... Done
libc6/stable,stable-updates,now 2.31-13+deb11u5 amd64 [installed]
tells me I have the stable version I am not sure what to change/how to proceed. Is the current Debian 11 relase with 2.31 using a too old version of glibc to build SaxonC 12 (where the undefined references seem mostly to 2.34 but one also to 2.32)?
I will see whether adding -lpthread
makes a difference.
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by Martin Honnen almost 2 years ago
So if I understand the suggested changes from the referenced issue the apt-get -t sid install -y libc6 libc6-dev libc6-dbg libcrypt1
would install some development version of those libraries instead of the stable ones.
Hmm, I don't know whether that causes problems with the stability of other programs. Guess it is fine if you do it in a Docker environment dedicated to the SaxonC installation but I am not sure I should try that directly in the WSL Debian installation.
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by Martin Honnen almost 2 years ago
Is there now a note or paragraph in the SaxonC 12 documentation explaining how to proceed to install/compile SaxonC 12.1 on a Linux distribution where the distribution's glibc is not sufficient to compile SaxonC as it gives the errors like undefined reference to
pthread_create@GLIBC_2.34'and
undefined reference to pthread_getattr_np@GLIBC_2.32'
?
I am still seeing these with the Debian stable release which seems to have glibc 2.31 and neither the SaxonC commands nor the cpp samples build.
The comment in https://saxonica.plan.io/issues/5856#note-1 says "We will add a note in the documentation regarding libc6 requirement for some systems." but I can't find anything in the current docs.
RE: Building commands on Debian 11 fails: /usr/bin/ld: /home/mh/libsaxon-HEC-linux-v12.0/command/../libs/nix/libsaxon-hec-12.0.so: undefined reference to `pthread_attr_getguardsize@GLIBC_2.34' - Added by O'Neil Delpratt over 1 year ago
We will look to build the SaxonC library with older version of glibc.
Please register to reply