Hi!

2019-01-07 23:15 Faidon Liambotis:
reopen 892295
tags 892295 + help - fixed-upstream patch
thanks

[...]

I uploaded 5.1.0-2 to unstable moments ago, which includes the
aforementioned commit.

Unfortunately, it seems like the build fails due to atomics-related
complications, which judging from similar bug reports, could be fixed by
passing -pthread instead of -lpthread. I filed this upstream[1] and that
seemed like a good idea to them.

1: https://github.com/jemalloc/jemalloc/issues/1401

I then experimented with building with that option on a riscv64
qemu-user-static container locally, but I came across random issues when
running the test suite, like some allocation issues, or processes
hanging etc. The build with the same option on amd64 seems to have
worked fine. I wonder if this has something to do with jemalloc or my
(weirdly emulated) environment, bug regardless... I would love your
help, if you have a spare moment :)

First of all, thanks for taking care.

I am not sure what are your modifications, but I tried with the
patch/debdiff attached, compared to 5.1.0-1 (-2 is/was not yet in
snapshot or deb.debian.org) and everything went fine:

 Test suite summary: pass: 43/52, skip: 9/52, fail: 0/52

More info about the build, which I'll proceed to upload to unreleased:

 Build Architecture: riscv64
 Build Type: full
 Build-Space: 763036
 Build-Time: 2051
 Distribution: unreleased
 Host Architecture: riscv64
 Install-Time: 40
 Job: .../jemalloc/jemalloc_5.1.0-1+0.riscv64.1.dsc
 Machine Architecture: riscv64
 Package: jemalloc
 Package-Time: 2122
 Source-Version: 5.1.0-1+0.riscv64.1
 Space: 763036
 Status: successful
 Version: 5.1.0-1+0.riscv64.1

This is on real hardware, I trust that it will also work fine in the
buildds (qemu-system), but if not we can take another look.

Not sure if the patch is correct or it's better to fix it in another
way, I hope that you or upstream can figure that out, or if not we can
iterate over it and try different things.

Hope that helps.  Thanks again!

--
Manuel A. Fernandez Montecelo <manuel.montez...@gmail.com>
Index: jemalloc-5.1.0/Makefile.in
===================================================================
--- jemalloc-5.1.0.orig/Makefile.in
+++ jemalloc-5.1.0/Makefile.in
@@ -400,7 +400,7 @@ $(objroot)test/unit/%$(EXE): $(objroot)t
 
 $(objroot)test/integration/%$(EXE): $(objroot)test/integration/%.$(O) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
 	@mkdir -p $(@D)
-	$(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(LJEMALLOC) $(LDFLAGS) $(filter-out -lm,$(filter -lrt -lpthread -lstdc++,$(LIBS))) $(LM) $(EXTRA_LDFLAGS)
+	$(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call RPATH,$(objroot)lib) $(LJEMALLOC) $(LDFLAGS) $(filter-out -lm,$(filter -lrt -pthread -lstdc++,$(LIBS))) $(LM) $(EXTRA_LDFLAGS)
 
 $(objroot)test/integration/cpp/%$(EXE): $(objroot)test/integration/cpp/%.$(O) $(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) $(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
 	@mkdir -p $(@D)
Index: jemalloc-5.1.0/configure.ac
===================================================================
--- jemalloc-5.1.0.orig/configure.ac
+++ jemalloc-5.1.0/configure.ac
@@ -1503,7 +1503,7 @@ if test "x$abi" != "xpecoff" ; then
   AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
   dnl Some systems may embed pthreads functionality in libc; check for libpthread
   dnl first, but try libc too before failing.
-  AC_CHECK_LIB([pthread], [pthread_create], [JE_APPEND_VS(LIBS, -lpthread)],
+  AC_CHECK_LIB([pthread], [pthread_create], [JE_APPEND_VS(LIBS, -pthread)],
                [AC_SEARCH_LIBS([pthread_create], , ,
                                AC_MSG_ERROR([libpthread is missing]))])
   wrap_syms="${wrap_syms} pthread_create"
diff -Nru jemalloc-5.1.0/debian/changelog jemalloc-5.1.0/debian/changelog
--- jemalloc-5.1.0/debian/changelog     2018-05-26 23:36:03.000000000 +0200
+++ jemalloc-5.1.0/debian/changelog     2019-01-07 23:28:11.000000000 +0100
@@ -1,3 +1,10 @@
+jemalloc (5.1.0-1+0.riscv64.1) unreleased; urgency=medium
+
+  * Non-maintainer upload.
+  * riscv64: use -pthread
+
+ -- Manuel A. Fernandez Montecelo <m...@debian.org>  Mon, 07 Jan 2019 22:28:11 
+0000
+
 jemalloc (5.1.0-1) experimental; urgency=medium
 
   * New upstream release.
diff -Nru jemalloc-5.1.0/debian/patches/riscv64-support.dch 
jemalloc-5.1.0/debian/patches/riscv64-support.dch
--- jemalloc-5.1.0/debian/patches/riscv64-support.dch   1970-01-01 
01:00:00.000000000 +0100
+++ jemalloc-5.1.0/debian/patches/riscv64-support.dch   2019-01-07 
23:28:11.000000000 +0100
@@ -0,0 +1,26 @@
+Index: jemalloc-5.1.0/Makefile.in
+===================================================================
+--- jemalloc-5.1.0.orig/Makefile.in
++++ jemalloc-5.1.0/Makefile.in
+@@ -400,7 +400,7 @@ $(objroot)test/unit/%$(EXE): $(objroot)t
+ 
+ $(objroot)test/integration/%$(EXE): $(objroot)test/integration/%.$(O) 
$(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) 
$(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
+       @mkdir -p $(@D)
+-      $(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call 
RPATH,$(objroot)lib) $(LJEMALLOC) $(LDFLAGS) $(filter-out -lm,$(filter -lrt 
-lpthread -lstdc++,$(LIBS))) $(LM) $(EXTRA_LDFLAGS)
++      $(CC) $(TEST_LD_MODE) $(LDTARGET) $(filter %.$(O),$^) $(call 
RPATH,$(objroot)lib) $(LJEMALLOC) $(LDFLAGS) $(filter-out -lm,$(filter -lrt 
-pthread -lstdc++,$(LIBS))) $(LM) $(EXTRA_LDFLAGS)
+ 
+ $(objroot)test/integration/cpp/%$(EXE): $(objroot)test/integration/cpp/%.$(O) 
$(C_TESTLIB_INTEGRATION_OBJS) $(C_UTIL_INTEGRATION_OBJS) 
$(objroot)lib/$(LIBJEMALLOC).$(IMPORTLIB)
+       @mkdir -p $(@D)
+Index: jemalloc-5.1.0/configure.ac
+===================================================================
+--- jemalloc-5.1.0.orig/configure.ac
++++ jemalloc-5.1.0/configure.ac
+@@ -1503,7 +1503,7 @@ if test "x$abi" != "xpecoff" ; then
+   AC_CHECK_HEADERS([pthread.h], , [AC_MSG_ERROR([pthread.h is missing])])
+   dnl Some systems may embed pthreads functionality in libc; check for 
libpthread
+   dnl first, but try libc too before failing.
+-  AC_CHECK_LIB([pthread], [pthread_create], [JE_APPEND_VS(LIBS, -lpthread)],
++  AC_CHECK_LIB([pthread], [pthread_create], [JE_APPEND_VS(LIBS, -pthread)],
+                [AC_SEARCH_LIBS([pthread_create], , ,
+                                AC_MSG_ERROR([libpthread is missing]))])
+   wrap_syms="${wrap_syms} pthread_create"
diff -Nru jemalloc-5.1.0/debian/patches/series 
jemalloc-5.1.0/debian/patches/series
--- jemalloc-5.1.0/debian/patches/series        1970-01-01 01:00:00.000000000 
+0100
+++ jemalloc-5.1.0/debian/patches/series        2019-01-07 23:28:11.000000000 
+0100
@@ -0,0 +1 @@
+riscv64-support.dch

Attachment: jemalloc_5.1.0-1+0.riscv64.1_riscv64.build.xz
Description: application/xz

Reply via email to