Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 Mar 2018 03:42:57 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r331115 - in head: lib/libzstd sys/contrib/zstd/lib/freebsd
Message-ID:  <201803180342.w2I3gvlQ075656@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: cem
Date: Sun Mar 18 03:42:57 2018
New Revision: 331115
URL: https://svnweb.freebsd.org/changeset/base/331115

Log:
  lib(private)zstd: Fix riscv build
  
  Link __bswap[ds]i2() intrinsics in to libzstd for riscv, where the C runtime
  apparently lacks such intrinsics.
  
  Broken in r330894.
  
  Reported by:	asomers
  Sponsored by:	Dell EMC Isilon

Modified:
  head/lib/libzstd/Makefile
  head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c

Modified: head/lib/libzstd/Makefile
==============================================================================
--- head/lib/libzstd/Makefile	Sun Mar 18 02:59:14 2018	(r331114)
+++ head/lib/libzstd/Makefile	Sun Mar 18 03:42:57 2018	(r331115)
@@ -43,4 +43,11 @@ ZSTDDIR=	${SRCTOP}/sys/contrib/zstd
 CFLAGS.zstd_compress.c+= -O0
 .endif
 
+# Work around lack of __bswap[sd]i2() intrinsics on riscv.  Probably should be
+# added to one of the runtime C libraries instead.
+.if ${MACHINE_CPUARCH} == "riscv"
+.PATH:	${ZSTDDIR}/lib/freebsd
+SRCS+=	zstd_kfreebsd.c
+.endif
+
 .include <bsd.lib.mk>

Modified: head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c
==============================================================================
--- head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c	Sun Mar 18 02:59:14 2018	(r331114)
+++ head/sys/contrib/zstd/lib/freebsd/zstd_kfreebsd.c	Sun Mar 18 03:42:57 2018	(r331115)
@@ -27,7 +27,12 @@
  */
 
 #include "zstd_kfreebsd.h"
+#include <sys/param.h>
 #include <sys/endian.h>
+
+#ifndef _KERNEL
+#include <strings.h>
+#endif
 
 /*
  * The kernel as a standalone target does not link against libgcc or



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201803180342.w2I3gvlQ075656>