Package Details: lib32-sord 0.16.6-1

Git Clone URL: https://aur.archlinux.org/lib32-sord.git (read-only, click to copy)
Package Base: lib32-sord
Description: A lightweight C library for storing RDF data in memory (32-bit)
Upstream URL: https://drobilla.net/software/sord/
Licenses: custom:ISC
Submitter: rodrigo21
Maintainer: rodrigo21
Last Packager: rodrigo21
Votes: 1
Popularity: 0.000001
First Submitted: 2018-08-19 03:06
Last Updated: 2020-11-22 17:23

Latest Comments

DDoSolitary commented on 2020-11-24 16:03

I just made a patch that allows building this package with -march=native. I'll submit it to upstream when I have time.

diff --git a/src/zix/digest.c b/src/zix/digest.c
index 889cfde..fdf7929 100644
--- a/src/zix/digest.c
+++ b/src/zix/digest.c
@@ -38,6 +38,7 @@ zix_digest_add(uint32_t hash, const void* const buf, const size_t len)
 {
    const uint8_t* str = (const uint8_t*)buf;

+#if UINTPTR_MAX == UINT64_MAX
    for (size_t i = 0; i < (len / sizeof(uint64_t)); ++i) {
        hash = (uint32_t)_mm_crc32_u64(hash, *(const uint64_t*)str);
        str += sizeof(uint64_t);
@@ -46,6 +47,12 @@ zix_digest_add(uint32_t hash, const void* const buf, const size_t len)
        hash = _mm_crc32_u32(hash, *(const uint32_t*)str);
        str += sizeof(uint32_t);
    }
+#else
+   for (size_t i = 0; i < (len / sizeof(uint32_t)); ++i) {
+       hash = _mm_crc32_u32(hash, *(const uint32_t*)str);
+       str += sizeof(uint32_t);
+   }
+#endif
    if (len & sizeof(uint16_t)) {
        hash = _mm_crc32_u16(hash, *(const uint16_t*)str);
        str += sizeof(uint16_t);
@@ -63,6 +70,7 @@ zix_digest_add_64(uint32_t hash, const void* const buf, const size_t len)
    assert((uintptr_t)buf % sizeof(uint64_t) == 0);
    assert(len % sizeof(uint64_t) == 0);

+#if UINTPTR_MAX == UINT64_MAX
    const uint64_t* ptr = (const uint64_t*)buf;

    for (size_t i = 0; i < (len / sizeof(uint64_t)); ++i) {
@@ -71,6 +79,9 @@ zix_digest_add_64(uint32_t hash, const void* const buf, const size_t len)
    }

    return hash;
+#else
+   return zix_digest_add(hash, buf, len);
+#endif
 }

 ZIX_API uint32_t

Nocifer commented on 2020-11-24 15:48

@DDoSolitary Ah, very good catch, thanks very much for the assist. I have replaced that part in makepkg.conf with -march=native since years, and that's the first time I've ever had any problems with it.

@rodrigo21 Thanks for the advice, but the problem was with my system configuration after all. Btw, changing -march=native to -march=x86-64 also allowed me to build all 4 lib32 packages (sord, serd, lilv, sratom) without having to use a clean chroot.

DDoSolitary commented on 2020-11-24 15:25

@Nocifer Check your CFLAGS value in /etc/makepkg.conf. It seems that the code detected SSE4.2 support (#ifdef __SSE4_2__) and tries to use a 64-bit intrinsic (_mm_crc32_u64), but the compiler doesn't recognize it because we're building 32-bit packages here. With the default CFLAGS settings in makepkg.conf (-march=x86-64 -mtune=generic), SSE4.2 should have been disabled.

rodrigo21 commented on 2020-11-24 15:17

@Nocifer

Try building in a clean chroot.

I'm also getting errors without it.

Try rebuilding lib32-serd first, it was also updated.

I can only build lib32-serd, lib32-sord, lib32-sratom and lib32-lilv in a clean chroot.

Nocifer commented on 2020-11-24 10:29

Getting this when trying to build after the recent update:

[17/18] Linking build/sord_validate
/usr/bin/ld: ./libsord_profiled.a(sord.c.5.o): in function `sord_node_hash':
sord.c:(.text+0x124b): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x1389): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x13aa): undefined reference to `_mm_crc32_u64'
collect2: error: ld returned 1 exit status

/usr/bin/ld: ./libsord-0.so: undefined reference to `_mm_crc32_u64'
collect2: error: ld returned 1 exit status

/usr/bin/ld: ./libsord-0.so: undefined reference to `_mm_crc32_u64'
collect2: error: ld returned 1 exit status

/usr/bin/ld: ./libsord_profiled.a(sord.c.5.o): in function `sord_node_hash':
sord.c:(.text+0x124b): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x1389): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x13aa): undefined reference to `_mm_crc32_u64'
collect2: error: ld returned 1 exit status

/usr/bin/ld: ./libsord_profiled.a(sord.c.5.o): in function `sord_node_hash':
sord.c:(.text+0x124b): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x1389): undefined reference to `_mm_crc32_u64'
/usr/bin/ld: sord.c:(.text+0x13aa): undefined reference to `_mm_crc32_u64'
collect2: error: ld returned 1 exit status

Waf: Leaving directory `/tmp/makepkg/lib32-sord/src/sord-0.16.6/build'
Build failed
 -> task in 'sord_test' failed with exit status 1 (run with -v to display more information)
 -> task in 'sordi' failed with exit status 1 (run with -v to display more information)
 -> task in 'sord_validate' failed with exit status 1 (run with -v to display more information)
 -> task in 'sordi_static' failed with exit status 1 (run with -v to display more information)
 -> task in 'sordmm_test' failed with exit status 1 (run with -v to display more information)
==> ERROR: A failure occurred in build().
    Aborting...

DDoSolitary commented on 2020-08-23 07:47

Could you please add the following line in the build function:

export CFLAGS="$(echo "$CFLAGS" | sed 's/ -fno-plt//')"

It seems that the default CFLAGS in /etc/makepkg.conf which contains -O2 -fno-plt is causing segfaults: https://aur.archlinux.org/packages/lib32-sratom/#comment-762156

DDoSolitary commented on 2019-11-12 12:17

Dependency pcre should be lib32-pcre