Skip to content
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

Compilation issues on Linux with Tasn1 (version 4.19.0) & clock_gettime.c #168

Open
pcaswell opened this issue Feb 21, 2023 · 2 comments
Open

Comments

@pcaswell
Copy link

Hi,
I've tried to upgrade our product to use DSM 0.4.3 (from 0.3.2) and have struggled somewhat - although I do now have a build. I'm building on Centos 7 with GCC 11.3.0 and TASN 4.19.0. Here are my observations for what they are worth.

  1. With Tasn1 4.19.0 the ASN1_TYPE is macro is deprecated and should be replaced with asn1_node.
  2. The clock_gettime.c file doesn't take into account HAVE_CLOCK_GETTIME so on Linux the build fails with fatal error: mach/mach.h: No such file or directory
  3. I get this warning on line 231 of src/smb_message.c - I'm not sure if this is something to worry about:
    warning: taking address of packed member of ‘struct ’ may result in an unaligned pointer value [-Waddress-of-packed-member

I am not at all familiar with meson and the README for this library appears to be out of date. I have built it as follows:

CFLAGS="-I${TASN1_DIR}/include -DHAVE_CLOCK_GETTIME=1" LDFLAGS="-L${TASN1_DIR}/lib -ltasn1 -Wl,-rpath,$COFIO_INSTALL/lib" \
	meson setup --prefix="${DSM_DIR}" --buildtype=release --pkg-config-path=${TASN1_DIR}/lib/pkgconfig ./build_release
if [ ! $? -eq 0 ]; then
	echo "Error, Meson release setup failed for DSM"
	exit 1
fi

cd ./build_release
CFLAGS="-I${TASN1_DIR}/include" LDFLAGS="-L${TASN1_DIR}/lib -ltasn1 -Wl,-rpath,$COFIO_INSTALL/lib" meson compile
if [ ! $? -eq 0 ]; then
	echo "Error, Meson compilation failed for DSM"
	exit 1
fi

meson install
if [ ! $? -eq 0 ]; then
	echo "Error, Meson install failed for DSM"
	exit 1
fi

Does this seem reasonable? I have attached a patch file for the code changes I made.
libdsm-0.4.3.patch

@jbkempf
Copy link
Contributor

jbkempf commented Feb 21, 2023

Thanks for the feedback. I’m not sure this is a perfect patch, since you should not be compiling this file, tbh, but we’ll have a look soon.

🙏

@pcaswell
Copy link
Author

Thank you. I agree that that file shouldn't be being compiled but I couldn't work out why/where it was failing. Hopefully the patch is a start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants