Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-29 Thread João Valverde



On 29/08/18 08:11, Guy Harris wrote:

On Aug 28, 2018, at 10:03 PM, João Valverde  
wrote:


And if my plugin calls requires libfoozbar that's an automatic libwireshark 
dependency then?


If you're assuming that libwireshark uses libfoobar, you are making a mistake, unless "footer" is 
spelled "glib" or "c".


Or doesn't call C math functions,


Then your plugin doesn't need to be linked with libm.


Point is any library is already available to plugins.


If you link with it.  Don't assume libwireshark is guaranteed to be linked with any libraries other 
than "the system libraries" and "glib".


Naturally. Seems like we are in agreement then. By "external linkage 
requirement" I was talking about what CMake calls the library link 
interface (the library being libwireshark in this case). The required 
linker flags to load libwireshark without undefined symbols, in other words.


For a plugin using C math functions, yes, linking with libm may be a 
requirement, depending on the platform, as you said.

___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-29 Thread Anders Broman
Den ons 29 aug. 2018 kl 09:12 skrev Guy Harris :

> On Aug 28, 2018, at 10:03 PM, João Valverde <
> joao.valve...@tecnico.ulisboa.pt> wrote:
>
> > And if my plugin calls requires libfoozbar that's an automatic
> libwireshark dependency then?
>
> If you're assuming that libwireshark uses libfoobar, you are making a
> mistake, unless "footer" is spelled "glib" or "c".
>
> > Or doesn't call C math functions,
>
> Then your plugin doesn't need to be linked with libm.
>
> > Point is any library is already available to plugins.
>
> If you link with it.  Don't assume libwireshark is guaranteed to be linked
> with any libraries other than "the system libraries" and "glib".
>

Just for the record adding
target_link_libraries("plugin" epan ${M_LIBRARIES})
in the plugin CMake file solved the problem.
Thanks

Regards
Anders




> ___
> Sent via:Wireshark-dev mailing list 
> Archives:https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>  mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-29 Thread Guy Harris
On Aug 28, 2018, at 10:03 PM, João Valverde  
wrote:

> And if my plugin calls requires libfoozbar that's an automatic libwireshark 
> dependency then?

If you're assuming that libwireshark uses libfoobar, you are making a mistake, 
unless "footer" is spelled "glib" or "c".

> Or doesn't call C math functions,

Then your plugin doesn't need to be linked with libm.

> Point is any library is already available to plugins.

If you link with it.  Don't assume libwireshark is guaranteed to be linked with 
any libraries other than "the system libraries" and "glib".
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 29/08/18 06:09, Anders Broman wrote:



Den ons 29 aug. 2018 07:03João Valverde 
> skrev:




On 29/08/18 05:53, Guy Harris wrote:
 > On Aug 28, 2018, at 9:27 PM, João Valverde
mailto:joao.valve...@tecnico.ulisboa.pt>> wrote:
 >
 >> On 29/08/18 05:15, Anders Broman wrote:
 >>
 >>> If indeed that is the problem (very likely) the decision to
make these libraries PRIVATE was intentional because the only
external linkage requirement that I saw was glib.
 >>> Yes this was the problem as I suspected yesterday, it just took
a while to verify as I had to delete the build directory to have the
cmake changes take effect. Another question
 >>
 >> It's not a bug in Wireshark, it's a bug in your build, IMO.
 >
 > If your plugin calls C math functions, the "math library" is an
external linkage requirement; some platforms have a separate "math
library", some don't.  M_LIBRARIES should be set as necessary by the
CMake module for libm.

And if my plugin calls requires libfoozbar that's an automatic
libwireshark dependency then? Or doesn't call C math functions, why
should my plugin be force to link with libm? Point is any library is
already available to plugins.



Not sure what you are saying, where should what be done to make the 
build work?


Assuming you are using CMake your plugin should use:
  target_link_libraries(myplugin epan ${M_LIBRARIES})
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Anders Broman
Den ons 29 aug. 2018 07:03João Valverde 
skrev:

>
>
> On 29/08/18 05:53, Guy Harris wrote:
> > On Aug 28, 2018, at 9:27 PM, João Valverde <
> joao.valve...@tecnico.ulisboa.pt> wrote:
> >
> >> On 29/08/18 05:15, Anders Broman wrote:
> >>
> >>> If indeed that is the problem (very likely) the decision to make these
> libraries PRIVATE was intentional because the only external linkage
> requirement that I saw was glib.
> >>> Yes this was the problem as I suspected yesterday, it just took a
> while to verify as I had to delete the build directory to have the cmake
> changes take effect. Another question
> >>
> >> It's not a bug in Wireshark, it's a bug in your build, IMO.
> >
> > If your plugin calls C math functions, the "math library" is an external
> linkage requirement; some platforms have a separate "math library", some
> don't.  M_LIBRARIES should be set as necessary by the CMake module for libm.
>
> And if my plugin calls requires libfoozbar that's an automatic
> libwireshark dependency then? Or doesn't call C math functions, why
> should my plugin be force to link with libm? Point is any library is
> already available to plugins.
>


Not sure what you are saying, where should what be done to make the build
work?
Anders


___
> Sent via:Wireshark-dev mailing list 
> Archives:https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>  mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 29/08/18 05:53, Guy Harris wrote:

On Aug 28, 2018, at 9:27 PM, João Valverde  
wrote:


On 29/08/18 05:15, Anders Broman wrote:


If indeed that is the problem (very likely) the decision to make these 
libraries PRIVATE was intentional because the only external linkage requirement 
that I saw was glib.
Yes this was the problem as I suspected yesterday, it just took a while to 
verify as I had to delete the build directory to have the cmake changes take 
effect. Another question


It's not a bug in Wireshark, it's a bug in your build, IMO.


If your plugin calls C math functions, the "math library" is an external linkage 
requirement; some platforms have a separate "math library", some don't.  M_LIBRARIES 
should be set as necessary by the CMake module for libm.


And if my plugin calls requires libfoozbar that's an automatic 
libwireshark dependency then? Or doesn't call C math functions, why 
should my plugin be force to link with libm? Point is any library is 
already available to plugins.

___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Guy Harris
On Aug 28, 2018, at 9:27 PM, João Valverde  
wrote:

> On 29/08/18 05:15, Anders Broman wrote:
> 
>> If indeed that is the problem (very likely) the decision to make these 
>> libraries PRIVATE was intentional because the only external linkage 
>> requirement that I saw was glib.
>> Yes this was the problem as I suspected yesterday, it just took a while to 
>> verify as I had to delete the build directory to have the cmake changes take 
>> effect. Another question
> 
> It's not a bug in Wireshark, it's a bug in your build, IMO.

If your plugin calls C math functions, the "math library" is an external 
linkage requirement; some platforms have a separate "math library", some don't. 
 M_LIBRARIES should be set as necessary by the CMake module for libm.
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 29/08/18 05:15, Anders Broman wrote:



-Original Message-
From: Wireshark-dev  On Behalf Of João 
Valverde
Sent: den 29 augusti 2018 01:40
To: wireshark-dev@wireshark.org
Subject: Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h 
fails



On 29/08/18 00:30, João Valverde wrote:



On 28/08/18 19:39, João Valverde wrote:



On 28/08/18 16:59, Anders Broman wrote:



Den tis 28 aug. 2018 16:25Ed Beroset mailto:bero...@mindspring.com>> skrev:

     On 08/28/2018 09:35 AM, Anders Broman wrote:
  > Hi,
  >
  > tfo/packet-tfo.c:3754: undefined reference to `pow'
  >
  > collect2: error: ld returned 1 exit status
  >
  > when running make-rpm-package

     That's the symptom of missing the math library on the linker
command
     line.  You'd need to add '-lm' to the linker line, if that's
what
     you're
     asking about.

     Ed


Sure but somthing changed recently in the cmake files and broke it,
as it has worked before.
I'm trying a fix in the cmake file in epan.
Anders



You could try using PUBLIC with M_LIBRARIES.

https://code.wireshark.org/review/#/c/29208/16/epan/CMakeLists.txt

Is this your own custom build or not?


I see now that you said proprietary plugin in the subject. Just add
M_LIBRARIES to your build?


If indeed that is the problem (very likely) the decision to make these 
libraries PRIVATE was intentional because the only external linkage requirement 
that I saw was glib.

Yes this was the problem as I suspected yesterday, it just took a while to 
verify as I had to delete the build directory to have the cmake changes take 
effect. Another question


It's not a bug in Wireshark, it's a bug in your build, IMO.


Is this bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15084 also 
related to the cmake changes?


I'll look into it.


Regards
Anders


___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Anders Broman


-Original Message-
From: Wireshark-dev  On Behalf Of João 
Valverde
Sent: den 29 augusti 2018 01:40
To: wireshark-dev@wireshark.org
Subject: Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h 
fails



On 29/08/18 00:30, João Valverde wrote:
> 
> 
> On 28/08/18 19:39, João Valverde wrote:
>>
>>
>> On 28/08/18 16:59, Anders Broman wrote:
>>>
>>>
>>> Den tis 28 aug. 2018 16:25Ed Beroset >> <mailto:bero...@mindspring.com>> skrev:
>>>
>>>     On 08/28/2018 09:35 AM, Anders Broman wrote:
>>>  > Hi,
>>>  >
>>>  > tfo/packet-tfo.c:3754: undefined reference to `pow'
>>>  >
>>>  > collect2: error: ld returned 1 exit status
>>>  >
>>>  > when running make-rpm-package
>>>
>>>     That's the symptom of missing the math library on the linker 
>>> command
>>>     line.  You'd need to add '-lm' to the linker line, if that's 
>>> what
>>>     you're
>>>     asking about.
>>>
>>>     Ed
>>>
>>>
>>> Sure but somthing changed recently in the cmake files and broke it, 
>>> as it has worked before.
>>> I'm trying a fix in the cmake file in epan.
>>> Anders
>>>
>>
>> You could try using PUBLIC with M_LIBRARIES.
>>
>> https://code.wireshark.org/review/#/c/29208/16/epan/CMakeLists.txt
>>
>> Is this your own custom build or not?
> 
> I see now that you said proprietary plugin in the subject. Just add 
> M_LIBRARIES to your build?

If indeed that is the problem (very likely) the decision to make these 
libraries PRIVATE was intentional because the only external linkage requirement 
that I saw was glib.

Yes this was the problem as I suspected yesterday, it just took a while to 
verify as I had to delete the build directory to have the cmake changes take 
effect. Another question
Is this bug https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=15084 also 
related to the cmake changes?
Regards
Anders
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 29/08/18 00:30, João Valverde wrote:



On 28/08/18 19:39, João Valverde wrote:



On 28/08/18 16:59, Anders Broman wrote:



Den tis 28 aug. 2018 16:25Ed Beroset > skrev:


    On 08/28/2018 09:35 AM, Anders Broman wrote:
 > Hi,
 >
 > tfo/packet-tfo.c:3754: undefined reference to `pow'
 >
 > collect2: error: ld returned 1 exit status
 >
 > when running make-rpm-package

    That's the symptom of missing the math library on the linker command
    line.  You'd need to add '-lm' to the linker line, if that's what
    you're
    asking about.

    Ed


Sure but somthing changed recently in the cmake files and broke it, 
as it has worked before.

I'm trying a fix in the cmake file in epan.
Anders



You could try using PUBLIC with M_LIBRARIES.

https://code.wireshark.org/review/#/c/29208/16/epan/CMakeLists.txt

Is this your own custom build or not?


I see now that you said proprietary plugin in the subject. Just add 
M_LIBRARIES to your build?


If indeed that is the problem (very likely) the decision to make these 
libraries PRIVATE was intentional because the only external linkage 
requirement that I saw was glib.

___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 28/08/18 19:39, João Valverde wrote:



On 28/08/18 16:59, Anders Broman wrote:



Den tis 28 aug. 2018 16:25Ed Beroset > skrev:


    On 08/28/2018 09:35 AM, Anders Broman wrote:
 > Hi,
 >
 > tfo/packet-tfo.c:3754: undefined reference to `pow'
 >
 > collect2: error: ld returned 1 exit status
 >
 > when running make-rpm-package

    That's the symptom of missing the math library on the linker command
    line.  You'd need to add '-lm' to the linker line, if that's what
    you're
    asking about.

    Ed


Sure but somthing changed recently in the cmake files and broke it, as 
it has worked before.

I'm trying a fix in the cmake file in epan.
Anders



You could try using PUBLIC with M_LIBRARIES.

https://code.wireshark.org/review/#/c/29208/16/epan/CMakeLists.txt

Is this your own custom build or not?


I see now that you said proprietary plugin in the subject. Just add 
M_LIBRARIES to your build?

___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread João Valverde



On 28/08/18 16:59, Anders Broman wrote:



Den tis 28 aug. 2018 16:25Ed Beroset > skrev:


On 08/28/2018 09:35 AM, Anders Broman wrote:
 > Hi,
 >
 > tfo/packet-tfo.c:3754: undefined reference to `pow'
 >
 > collect2: error: ld returned 1 exit status
 >
 > when running make-rpm-package

That's the symptom of missing the math library on the linker command
line.  You'd need to add '-lm' to the linker line, if that's what
you're
asking about.

Ed


Sure but somthing changed recently in the cmake files and broke it, as 
it has worked before.

I'm trying a fix in the cmake file in epan.
Anders



You could try using PUBLIC with M_LIBRARIES.

https://code.wireshark.org/review/#/c/29208/16/epan/CMakeLists.txt

Is this your own custom build or not?
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Anders Broman
Den tis 28 aug. 2018 16:25Ed Beroset  skrev:

> On 08/28/2018 09:35 AM, Anders Broman wrote:
> > Hi,
> >
> > tfo/packet-tfo.c:3754: undefined reference to `pow'
> >
> > collect2: error: ld returned 1 exit status
> >
> > when running make-rpm-package
>
> That's the symptom of missing the math library on the linker command
> line.  You'd need to add '-lm' to the linker line, if that's what you're
> asking about.
>
> Ed
>

Sure but somthing changed recently in the cmake files and broke it, as it
has worked before.
I'm trying a fix in the cmake file in epan.
Anders

__
> Sent via:Wireshark-dev mailing list 
> Archives:https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
>  mailto:wireshark-dev-requ...@wireshark.org
> ?subject=unsubscribe
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

Re: [Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Ed Beroset

On 08/28/2018 09:35 AM, Anders Broman wrote:

Hi,

tfo/packet-tfo.c:3754: undefined reference to `pow'

collect2: error: ld returned 1 exit status

when running make-rpm-package


That's the symptom of missing the math library on the linker command 
line.  You'd need to add '-lm' to the linker line, if that's what you're 
asking about.


Ed
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe

[Wireshark-dev] Building RPM proprietarry plugin including math.h fails

2018-08-28 Thread Anders Broman
Hi,
tfo/packet-tfo.c:3754: undefined reference to `pow'
collect2: error: ld returned 1 exit status

when running make-rpm-package
___
Sent via:Wireshark-dev mailing list 
Archives:https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
 mailto:wireshark-dev-requ...@wireshark.org?subject=unsubscribe