Mastercard / pkcs11-tools

A set of tools to manage objects on PKCS#11 cryptographic tokens. Compatible with many PKCS#11 library, including major HSM brands, NSS and softoken.
Other
162 stars 33 forks source link

build failure on Linux #36

Closed tulsidas closed 1 year ago

tulsidas commented 1 year ago

Describe the bug Following the steps on INSTALL wiki, the make step fails to build the project

To Reproduce Steps to reproduce the behavior:

  1. Clone project
  2. run ./bootstrap.sh
  3. run make

Error:

In file included from attribctx_lexer.c:49:
../gl/string.h:965:1: error: expected ‘,’ or ‘;’ before ‘_GL_ATTRIBUTE_MALLOC’
  965 | _GL_FUNCDECL_SYS (strdup, char *,
      | ^~~~~~~~~~~~~~~~
make[2]: *** [Makefile:1655: libp11_la-attribctx_lexer.lo] Error 1

Attaching config.log

Operating System (please complete the following information):

keldonin commented 1 year ago

Hi @tulsidas, I also encountered this issue on FreeBSD, when using recent versions of GCC. It seems to be caused by:

I could make it work by using clang as the compiler on my platform. Can you give it a try?

# I haven't checked, I would expect the package name to be clang, please verify how it's labelled
sudo apt-get install clang

./bootstrap.sh
./configure CC=clang
make
tulsidas commented 1 year ago

@keldonin that worked! thanks for the quick response 👍🏼

keldonin commented 1 year ago

@tulsidas you welcome. There is nevertheless an underlying issue that we must address.

tulsidas commented 1 year ago

feel free to contact me if you need to try out something on Linux

keldonin commented 1 year ago

Out of curiosity, what is the linux distribution you run? Is it just plain Debian?

tulsidas commented 1 year ago

Yes, Debian testing thou

$ cat /etc/os-release

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian
HOME_URL="https://www.debian.org/"
SUPPORT_URL="https://www.debian.org/support"
BUG_REPORT_URL="https://bugs.debian.org/"
keldonin commented 1 year ago

Hi @tulsidas, thanks for the information. I see this version will be released by June 10th. I'll give it a try - on a side note, the project compiles like a charm on the current Debian release (11).

tulsidas commented 1 year ago

@keldonin FYI I just tried building today (a fresh clone) and it worked ok

keldonin commented 1 year ago

@keldonin FYI I just tried building today (a fresh clone) and it worked ok

As of release 2.6.0 I intend to ship binaries. There are already RPMs available, Debian packages to come later. You could try to deploy the RPM using alien on Ubuntu.