diff mbox

Building URCU in a Cygwin 64 environment

Message ID 574EEACE.2060207@gydle.com
State Superseded, archived
Headers show

Commit Message

Sebastien Boisvert June 1, 2016, 2:01 p.m. UTC
Hey Mathieu,

At home (in Cygwin 64), I have a patch for urcu 0.9.2 to fix compilation issues.
This patch is however unrelated to building shared libraries (.dll files) in Cygwin.

Here is a patch (inline and attached) to build shared libraries on Cygwin (the one that you
requested). This patch is based on userspace-rcu 613086f69b4c8e6cc1b73b4e93d6d0497825d1ee.

I tested it on Ubuntu 14.04 ("behavior on non-cygwin builds"), but not on Cygwin as I don't have a Cygwin system at work.

Commands used to test the patch:

git clone https://github.com/urcu/userspace-rcu.git
cd userspace-rcu/
patch -p1 < ~/patches/0001-Port-build-shared-libraries-in-Cygwin.patch 
./bootstrap 
./configure --prefix=$HOME/builds/userspace-rcu/613086f69b4c8e6cc1b73b4e93d6d0497825d1ee/`date -Iseconds`
make -j 4
cd tests/
make check
cd ..
make install

Output of the test:

./run.sh unit_tests
./test_uatomic ................... ok     
./test_urcu_multiflavor .......... ok   
./test_urcu_multiflavor_dynlink .. ok   
All tests successful.
Files=3, Tests=78,  0 wallclock secs ( 0.03 usr  0.00 sys +  0.03 cusr  0.01 csys =  0.07 CPU)
Result: PASS


So, the Result is PASS, which is good.

Tonight, I will combine my 2 patches (the one that enables shared libraries in Cygwin, and the one that fixes various compilation issues in Cygwin)
and send it to the mailing list for review (along with the output of unit tests in Cygwin).

Z1$ cat ~/patches/0001-Port-build-shared-libraries-in-Cygwin.patch 
>From 1b4f39afc781c1a431b9f52adf25aa0856c86142 Mon Sep 17 00:00:00 2001
From: Sebastien Boisvert <sboisvert at gydle.com>
Date: Wed, 1 Jun 2016 09:53:36 -0400
Subject: [PATCH] Port: build shared libraries in Cygwin

Link: https://lists.lttng.org/pipermail/lttng-dev/2016-May/026081.html
Signed-off-by: Sebastien Boisvert <sboisvert at gydle.com>
---
 Makefile.am  | 3 +++
 configure.ac | 5 +++++
 2 files changed, 8 insertions(+)
diff mbox

Patch

diff --git a/Makefile.am b/Makefile.am
index 672beec..8e25fd9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,6 +8,9 @@  AM_LDFLAGS=-version-info $(URCU_LIBRARY_VERSION)
 if !LIBC_INCLUDES_PTHREAD
 AM_LDFLAGS+=-lpthread
 endif
+if USE_CYGWIN
+AM_LDFLAGS+=-no-undefined
+endif
 AM_CFLAGS=-Wall
 
 SUBDIRS = . doc tests
diff --git a/configure.ac b/configure.ac
index fe1c55d..b3096c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,6 +134,11 @@  AS_CASE([$host],[*-*-linux-androideabi],
 	[AM_CONDITIONAL(TARGET_IS_ANDROID, false)]
 )
 
+AS_CASE([$host],[*-cygwin*],
+	[AM_CONDITIONAL(USE_CYGWIN, true)],
+	[AM_CONDITIONAL(USE_CYGWIN, false)]
+)
+
 AC_SUBST(ARCHTYPE)
 AC_SUBST(SUBARCHTYPE)