Closed roychowdhuryrohit-dev closed 2 years ago
Looks like you're trying to link a static version. And the static libcrypto.a seams to require pthread... Could this be ?
@AndreasFuchsSIT The same process runs successfully during native build but when I try to run the make build as a part of Snapcraft build this error occurs. Do I need to install any dependency from apt for pthread library? I have already installed autoconf-archive
and libpthread-stubs0-dev
.
libc6-dev (on ubuntu 20.04) contains the libpthreat.a
Additionally you need to add -lpthreat
to the end of your compile.
But I honestly doubt that you want to compile statically. According to your script you want to get the shared object. So something is misconfigured here.
You could post the output of make V=1
so we can see the actual compiler invocation.
Also your parameters for ./configure
would be interesting (line 7 in file config.log)
libc6-dev
is already installed but the issue still occurs../configure --with-udevrulesdir=/etc/udev/rules.d
make -j$(nproc)
sudo make install
sudo sed -i "s/tss/$(whoami)/gi" /etc/udev/rules.d/tpm-udev.rules
sudo udevadm control --reload-rules && sudo udevadm trigger
sudo ldconfig
sudo apt install tpm2-tools
The error occurs at line 2.
make V=1
.
log.txtOk, I guess I don't get it. Your log.txt shows a complete and error-free build...
Ok, I guess I don't get it. Your log.txt shows a complete and error-free build...
Specifically libpthread.so.0
is missing in ~/parts/part_name/install/lib/x86_64-linux-gnu/
(the path used by Snapcraft during override-build) but present inside /usr/lib/x86_64-linux-gnu/
. I checked with dpkg -L and the tpm build dependencies are all getting installed at /usr/lib/*
but during build time Snapcraft only uses header files from ~/parts/part_name/install/lib/x86_64-linux-gnu/
which I found out from the Makefile generated by configure script.
Can you tell how does the configure script scan dependency paths and where to look for?
./configure --with-udevrulesdir=/etc/udev/rules.d
Turns out Snapcraft overrides env variables like CXXFLAGS and LDFLAGS on its own to set -isystem directories. Resetting them fixed the issue.
What happened?
PROBLEM
When tpm2-tss library is built during Snapcraft build step using
make
, it produces the following error.What is expected ?
It should install the tpm2-tss library successfully so that following condition is satisfied.
https://github.com/archethic-foundation/archethic-node/blob/8c68da5f20286a0c46d233fedc2ac7fec1a6d86d/Makefile#L12