All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: Building URCU in a Cygwin 64 environment
       [not found] <574D93FE.7000703@gydle.com>
@ 2016-05-31 14:47 ` Jonathan Rajotte Julien
       [not found] ` <574DA411.3000603@efficios.com>
  1 sibling, 0 replies; 5+ messages in thread
From: Jonathan Rajotte Julien @ 2016-05-31 14:47 UTC (permalink / raw)
  To: lttng-dev

Hi Sebastien,

I'll simply move the conversation here (from IRC) to have an archive of it.

On 2016-05-31 09:39 AM, Sebastien Boisvert wrote:
> Hi,
>
> I am in the process of writing a blog article on the use of the LTTng-UST userspace event tracer on Windows.
>
> I am building urcu and LTTng-UST in a Cygwin 64 environment. Then, I plan to use LTTng in Visual Studio Community, so I mostly need headers (.h) and shared libraries (.dll).

Nice!

>
> When I am building urcu (0.9.2), I get this message:
>
> libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries

This seems related to a Windows restriction regarding inter-library 
dependencies [1], the relevant part:

"Some platforms, such as Windows, do not even allow you this 
flexibility. In order to build a shared library, it must be entirely 
self-contained or it must have dependencies known at link time (that is, 
have references only to symbols that are found in the .lo files or the 
specified ‘-l’ libraries), and you need to specify the -no-undefined 
flag. By default, libtool builds only static libraries on these kinds of 
platforms."

Looks like the -no-undefined might be a good start judging from this 
patch I found for the urcu cygwin port in yacp [2].

Cheers!

[1] 
https://www.gnu.org/software/libtool/manual/libtool.html#Inter_002dlibrary-dependencies
[2] 
https://github.com/fd00/yacp/blob/master/userspace-rcu/userspace-rcu-0.8.7-1bl1.src.patch
>
> The immediate consequence seems to be the absence of .dll files in the urcu build that I am generating. Otherwise, the build contains static library files and headers.
>
> However, I suppose that the .a static library files also have undefined symbols as I am getting linking issues when building LTTng-UST.
>
> Do you have a clue of what may be the issue here ? Otherwise, I will continue my investigation and get around the issue eventually.
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Jonathan R. Julien
Efficios

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building URCU in a Cygwin 64 environment
       [not found] ` <574DA411.3000603@efficios.com>
@ 2016-05-31 15:12   ` Sebastien Boisvert
  2016-05-31 21:52   ` Mathieu Desnoyers
       [not found]   ` <1907475198.24545.1464731555921.JavaMail.zimbra@efficios.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Sebastien Boisvert @ 2016-05-31 15:12 UTC (permalink / raw)
  To: lttng-dev

Hi Jonathan,

Thank you for looking into this. I appreciate.

It sounds like I have a solution in hand to continue. That's great.

I just read the text in the web page referenced by the link [1] that you kindly provided to me.
This is interesting. Now I know a little bit more about this.

So, Linux can have 'chains of dependencies of potentially infinite length' whereas Windows
is limited to shared library DLL files that can not depend on other DLL files; knowing the dependencies
is the job of a .exe file and these dependencies must be known at link time.

TIL

+1

On 05/31/2016 10:47 AM, Jonathan Rajotte Julien wrote:
> Hi Sebastien,
> 
> I'll simply move the conversation here (from IRC) to have an archive of it.
> 
> On 2016-05-31 09:39 AM, Sebastien Boisvert wrote:
>> Hi,
>>
>> I am in the process of writing a blog article on the use of the LTTng-UST userspace event tracer on Windows.
>>
>> I am building urcu and LTTng-UST in a Cygwin 64 environment. Then, I plan to use LTTng in Visual Studio Community, so I mostly need headers (.h) and shared libraries (.dll).
> 
> Nice!
> 
>>
>> When I am building urcu (0.9.2), I get this message:
>>
>> libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries
> 
> This seems related to a Windows restriction regarding inter-library dependencies [1], the relevant part:
> 
> "Some platforms, such as Windows, do not even allow you this flexibility. In order to build a shared library, it must be entirely self-contained or it must have dependencies known at link time (that is, have references only to symbols that are found in the .lo files or the specified ‘-l’ libraries), and you need to specify the -no-undefined flag. By default, libtool builds only static libraries on these kinds of platforms."
> 
> Looks like the -no-undefined might be a good start judging from this patch I found for the urcu cygwin port in yacp [2].
> 
> Cheers!
> 
> [1] https://www.gnu.org/software/libtool/manual/libtool.html#Inter_002dlibrary-dependencies
> [2] https://github.com/fd00/yacp/blob/master/userspace-rcu/userspace-rcu-0.8.7-1bl1.src.patch
>>
>> The immediate consequence seems to be the absence of .dll files in the urcu build that I am generating. Otherwise, the build contains static library files and headers.
>>
>> However, I suppose that the .a static library files also have undefined symbols as I am getting linking issues when building LTTng-UST.
>>
>> Do you have a clue of what may be the issue here ? Otherwise, I will continue my investigation and get around the issue eventually.
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building URCU in a Cygwin 64 environment
       [not found] ` <574DA411.3000603@efficios.com>
  2016-05-31 15:12   ` Sebastien Boisvert
@ 2016-05-31 21:52   ` Mathieu Desnoyers
       [not found]   ` <1907475198.24545.1464731555921.JavaMail.zimbra@efficios.com>
  2 siblings, 0 replies; 5+ messages in thread
From: Mathieu Desnoyers @ 2016-05-31 21:52 UTC (permalink / raw)
  To: Jonathan Rajotte Julien; +Cc: lttng-dev

----- On May 31, 2016, at 4:47 PM, Jonathan Rajotte Julien Jonathan.rajotte-julien@efficios.com wrote:

> Hi Sebastien,
> 
> I'll simply move the conversation here (from IRC) to have an archive of it.
> 
> On 2016-05-31 09:39 AM, Sebastien Boisvert wrote:
>> Hi,
>>
>> I am in the process of writing a blog article on the use of the LTTng-UST
>> userspace event tracer on Windows.
>>
>> I am building urcu and LTTng-UST in a Cygwin 64 environment. Then, I plan to use
>> LTTng in Visual Studio Community, so I mostly need headers (.h) and shared
>> libraries (.dll).
> 
> Nice!
> 
>>
>> When I am building urcu (0.9.2), I get this message:
>>
>> libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin
>> shared libraries
> 
> This seems related to a Windows restriction regarding inter-library
> dependencies [1], the relevant part:
> 
> "Some platforms, such as Windows, do not even allow you this
> flexibility. In order to build a shared library, it must be entirely
> self-contained or it must have dependencies known at link time (that is,
> have references only to symbols that are found in the .lo files or the
> specified ‘-l’ libraries), and you need to specify the -no-undefined
> flag. By default, libtool builds only static libraries on these kinds of
> platforms."
> 
> Looks like the -no-undefined might be a good start judging from this
> patch I found for the urcu cygwin port in yacp [2].
> 
> Cheers!
> 
> [1]
> https://www.gnu.org/software/libtool/manual/libtool.html#Inter_002dlibrary-dependencies
> [2]
> https://github.com/fd00/yacp/blob/master/userspace-rcu/userspace-rcu-0.8.7-1bl1.src.patch

Is there a way we could adapt this patch to urcu upstream without changing
the behavior on non-cygwin builds ?

Thanks,

Mathieu

>>
>> The immediate consequence seems to be the absence of .dll files in the urcu
>> build that I am generating. Otherwise, the build contains static library files
>> and headers.
>>
>> However, I suppose that the .a static library files also have undefined symbols
>> as I am getting linking issues when building LTTng-UST.
>>
>> Do you have a clue of what may be the issue here ? Otherwise, I will continue my
>> investigation and get around the issue eventually.
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 
> --
> Jonathan R. Julien
> Efficios
> 
> _______________________________________________
> lttng-dev mailing list
> lttng-dev@lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: Building URCU in a Cygwin 64 environment
       [not found]   ` <1907475198.24545.1464731555921.JavaMail.zimbra@efficios.com>
@ 2016-06-01 14:01     ` Sebastien Boisvert
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastien Boisvert @ 2016-06-01 14:01 UTC (permalink / raw)
  To: Mathieu Desnoyers, Jonathan Rajotte Julien; +Cc: lttng-dev

[-- Attachment #1: Type: text/plain, Size: 5519 bytes --]

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@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@gydle.com>
---
 Makefile.am  | 3 +++
 configure.ac | 5 +++++
 2 files changed, 8 insertions(+)

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)
 
-- 
1.9.1



On 05/31/2016 05:52 PM, Mathieu Desnoyers wrote:
> ----- On May 31, 2016, at 4:47 PM, Jonathan Rajotte Julien Jonathan.rajotte-julien@efficios.com wrote:
> 
>> Hi Sebastien,
>>
>> I'll simply move the conversation here (from IRC) to have an archive of it.
>>
>> On 2016-05-31 09:39 AM, Sebastien Boisvert wrote:
>>> Hi,
>>>
>>> I am in the process of writing a blog article on the use of the LTTng-UST
>>> userspace event tracer on Windows.
>>>
>>> I am building urcu and LTTng-UST in a Cygwin 64 environment. Then, I plan to use
>>> LTTng in Visual Studio Community, so I mostly need headers (.h) and shared
>>> libraries (.dll).
>>
>> Nice!
>>
>>>
>>> When I am building urcu (0.9.2), I get this message:
>>>
>>> libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin
>>> shared libraries
>>
>> This seems related to a Windows restriction regarding inter-library
>> dependencies [1], the relevant part:
>>
>> "Some platforms, such as Windows, do not even allow you this
>> flexibility. In order to build a shared library, it must be entirely
>> self-contained or it must have dependencies known at link time (that is,
>> have references only to symbols that are found in the .lo files or the
>> specified ‘-l’ libraries), and you need to specify the -no-undefined
>> flag. By default, libtool builds only static libraries on these kinds of
>> platforms."
>>
>> Looks like the -no-undefined might be a good start judging from this
>> patch I found for the urcu cygwin port in yacp [2].
>>
>> Cheers!
>>
>> [1]
>> https://www.gnu.org/software/libtool/manual/libtool.html#Inter_002dlibrary-dependencies
>> [2]
>> https://github.com/fd00/yacp/blob/master/userspace-rcu/userspace-rcu-0.8.7-1bl1.src.patch
> 
> Is there a way we could adapt this patch to urcu upstream without changing
> the behavior on non-cygwin builds ?
> 
> Thanks,
> 
> Mathieu
> 
>>>
>>> The immediate consequence seems to be the absence of .dll files in the urcu
>>> build that I am generating. Otherwise, the build contains static library files
>>> and headers.
>>>
>>> However, I suppose that the .a static library files also have undefined symbols
>>> as I am getting linking issues when building LTTng-UST.
>>>
>>> Do you have a clue of what may be the issue here ? Otherwise, I will continue my
>>> investigation and get around the issue eventually.
>>> _______________________________________________
>>> lttng-dev mailing list
>>> lttng-dev@lists.lttng.org
>>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
>>
>> --
>> Jonathan R. Julien
>> Efficios
>>
>> _______________________________________________
>> lttng-dev mailing list
>> lttng-dev@lists.lttng.org
>> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
> 

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Port-build-shared-libraries-in-Cygwin.patch --]
[-- Type: text/x-patch; name="0001-Port-build-shared-libraries-in-Cygwin.patch", Size: 1175 bytes --]

From 1b4f39afc781c1a431b9f52adf25aa0856c86142 Mon Sep 17 00:00:00 2001
From: Sebastien Boisvert <sboisvert@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@gydle.com>
---
 Makefile.am  | 3 +++
 configure.ac | 5 +++++
 2 files changed, 8 insertions(+)

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)
 
-- 
1.9.1


[-- Attachment #3: Type: text/plain, Size: 156 bytes --]

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Building URCU in a Cygwin 64 environment
@ 2016-05-31 13:39 Sebastien Boisvert
  0 siblings, 0 replies; 5+ messages in thread
From: Sebastien Boisvert @ 2016-05-31 13:39 UTC (permalink / raw)
  To: lttng-dev

Hi,

I am in the process of writing a blog article on the use of the LTTng-UST userspace event tracer on Windows.

I am building urcu and LTTng-UST in a Cygwin 64 environment. Then, I plan to use LTTng in Visual Studio Community, so I mostly need headers (.h) and shared libraries (.dll).

When I am building urcu (0.9.2), I get this message:

libtool: link: warning: undefined symbols not allowed in x86_64-unknown-cygwin shared libraries

The immediate consequence seems to be the absence of .dll files in the urcu build that I am generating. Otherwise, the build contains static library files and headers.

However, I suppose that the .a static library files also have undefined symbols as I am getting linking issues when building LTTng-UST.

Do you have a clue of what may be the issue here ? Otherwise, I will continue my investigation and get around the issue eventually.
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-06-01 14:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <574D93FE.7000703@gydle.com>
2016-05-31 14:47 ` Building URCU in a Cygwin 64 environment Jonathan Rajotte Julien
     [not found] ` <574DA411.3000603@efficios.com>
2016-05-31 15:12   ` Sebastien Boisvert
2016-05-31 21:52   ` Mathieu Desnoyers
     [not found]   ` <1907475198.24545.1464731555921.JavaMail.zimbra@efficios.com>
2016-06-01 14:01     ` Sebastien Boisvert
2016-05-31 13:39 Sebastien Boisvert

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.