DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] ABI versioning in Windows
@ 2020-05-27 10:41 Fady Bader
  2020-05-27 12:50 ` Thomas Monjalon
  0 siblings, 1 reply; 8+ messages in thread
From: Fady Bader @ 2020-05-27 10:41 UTC (permalink / raw)
  To: dev; +Cc: ocardona, Anand Rawat, Stephen Hemminger

What should we do with the ABI versioning in Windows ?

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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 10:41 [dpdk-dev] ABI versioning in Windows Fady Bader
@ 2020-05-27 12:50 ` Thomas Monjalon
  2020-05-27 14:32   ` Ray Kinsella
  2020-05-27 20:35   ` Neil Horman
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-05-27 12:50 UTC (permalink / raw)
  To: Fady Bader
  Cc: dev, Harini Ramakrishnan, Omar Cardona, Pallavi Kadam,
	Ranjit Menon, dmitry.kozliuk, mdr, nhorman

+Cc more people

27/05/2020 12:41, Fady Bader:
> What should we do with the ABI versioning in Windows ?

I think there are 2 questions here:

1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
The decision must be clearly documented.

2/ How do we implement the macros in rte_function_versioning.h for Windows?
Something needs to be done, otherwise we cannot compile libraries having some function versioning.



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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 12:50 ` Thomas Monjalon
@ 2020-05-27 14:32   ` Ray Kinsella
  2020-05-27 20:35   ` Neil Horman
  1 sibling, 0 replies; 8+ messages in thread
From: Ray Kinsella @ 2020-05-27 14:32 UTC (permalink / raw)
  To: Thomas Monjalon, Fady Bader
  Cc: dev, Harini Ramakrishnan, Omar Cardona, Pallavi Kadam,
	Ranjit Menon, dmitry.kozliuk, nhorman


Is my impression is the the Windows build is nascent, a fair one? 
Would we consider the entire build experimental for the moment?

Thanks,

Ray K

On 27/05/2020 13:50, Thomas Monjalon wrote:
> +Cc more people
> 
> 27/05/2020 12:41, Fady Bader:
>> What should we do with the ABI versioning in Windows ?
> 
> I think there are 2 questions here:
> 
> 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> The decision must be clearly documented.
> 
> 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> 
> 

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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 12:50 ` Thomas Monjalon
  2020-05-27 14:32   ` Ray Kinsella
@ 2020-05-27 20:35   ` Neil Horman
  2020-05-27 21:27     ` Thomas Monjalon
  1 sibling, 1 reply; 8+ messages in thread
From: Neil Horman @ 2020-05-27 20:35 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Fady Bader, dev, Harini Ramakrishnan, Omar Cardona,
	Pallavi Kadam, Ranjit Menon, dmitry.kozliuk, mdr

On Wed, May 27, 2020 at 02:50:07PM +0200, Thomas Monjalon wrote:
> +Cc more people
> 
> 27/05/2020 12:41, Fady Bader:
> > What should we do with the ABI versioning in Windows ?
> 
> I think there are 2 questions here:
> 
> 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> The decision must be clearly documented.
> 
My first notion, without any greater thought is "why wouldn't we".  ABI
stability is OS agnostic.  If a symbol is considered stable, theres no reason
that I can think of that it wouldn't be stable for each OS.

> 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> 
Can you elaborate on what exactly the issue is here?  I presume by your comment
above that visual studio either doesn't support symbol level versioning or
doesn't support versioning at all?

If thats the case, and there is a commitment to make dpdk buildable on windows,
I suppose the only choice is to make a ifdef WINDOWS section of the
rte_function_versioning.h file, and effectively turn all the macros into no-ops.
The BIND_DEFAULT_SYMBOL macro looks like it could still work, as MSVC has an
alias linker command thats implementable via __pragma, but thats probably all we
can do, unless there is some more robust versioning support that I can't find.
Note we will also likely need to agument the makefiles/meson files so that the
link stage doesn't pass the version script to the linker 

Neil

> 
> 

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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 20:35   ` Neil Horman
@ 2020-05-27 21:27     ` Thomas Monjalon
  2020-05-27 21:43       ` Thomas Monjalon
  2020-05-28  0:21       ` Neil Horman
  0 siblings, 2 replies; 8+ messages in thread
From: Thomas Monjalon @ 2020-05-27 21:27 UTC (permalink / raw)
  To: Neil Horman, Harini Ramakrishnan
  Cc: Fady Bader, dev, Omar Cardona, Pallavi Kadam, Ranjit Menon,
	dmitry.kozliuk, mdr

27/05/2020 22:35, Neil Horman:
> On Wed, May 27, 2020 at 02:50:07PM +0200, Thomas Monjalon wrote:
> > +Cc more people
> > 
> > 27/05/2020 12:41, Fady Bader:
> > > What should we do with the ABI versioning in Windows ?
> > 
> > I think there are 2 questions here:
> > 
> > 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> > The decision must be clearly documented.
> > 
> My first notion, without any greater thought is "why wouldn't we".  ABI
> stability is OS agnostic.  If a symbol is considered stable, theres no reason
> that I can think of that it wouldn't be stable for each OS.

Technical reason + no need so far.


> > 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> > Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> > 
> Can you elaborate on what exactly the issue is here?  I presume by your comment
> above that visual studio either doesn't support symbol level versioning or
> doesn't support versioning at all?

I don't know how to implement the macros in rte_function_versioning.h for Windows.


> If thats the case, and there is a commitment to make dpdk buildable on windows,
> I suppose the only choice is to make a ifdef WINDOWS section of the
> rte_function_versioning.h file, and effectively turn all the macros into no-ops.

Yes that's the idea.
But we still need to implement either BIND_DEFAULT_SYMBOL or MAP_STATIC_SYMBOL
to alias the latest function version to the actual function symbol.

> The BIND_DEFAULT_SYMBOL macro looks like it could still work, as MSVC has an
> alias linker command thats implementable via __pragma, but thats probably all we
> can do, unless there is some more robust versioning support that I can't find.

What is this pragma?


> Note we will also likely need to agument the makefiles/meson files so that the
> link stage doesn't pass the version script to the linker

Why not using the version script for exported symbols?
We are already doing it (.def file generated from .map).



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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 21:27     ` Thomas Monjalon
@ 2020-05-27 21:43       ` Thomas Monjalon
  2020-05-28  0:28         ` Neil Horman
  2020-05-28  0:21       ` Neil Horman
  1 sibling, 1 reply; 8+ messages in thread
From: Thomas Monjalon @ 2020-05-27 21:43 UTC (permalink / raw)
  To: Neil Horman, Harini Ramakrishnan, Fady Bader
  Cc: dev, Omar Cardona, Pallavi Kadam, Ranjit Menon, dmitry.kozliuk, mdr

27/05/2020 23:27, Thomas Monjalon:
> 27/05/2020 22:35, Neil Horman:
> > On Wed, May 27, 2020 at 02:50:07PM +0200, Thomas Monjalon wrote:
> > > +Cc more people
> > > 
> > > 27/05/2020 12:41, Fady Bader:
> > > > What should we do with the ABI versioning in Windows ?
> > > 
> > > I think there are 2 questions here:
> > > 
> > > 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> > > The decision must be clearly documented.
> > > 
> > My first notion, without any greater thought is "why wouldn't we".  ABI
> > stability is OS agnostic.  If a symbol is considered stable, theres no reason
> > that I can think of that it wouldn't be stable for each OS.
> 
> Technical reason + no need so far.
> 
> 
> > > 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> > > Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> > > 
> > Can you elaborate on what exactly the issue is here?  I presume by your comment
> > above that visual studio either doesn't support symbol level versioning or
> > doesn't support versioning at all?
> 
> I don't know how to implement the macros in rte_function_versioning.h for Windows.
> 
> 
> > If thats the case, and there is a commitment to make dpdk buildable on windows,
> > I suppose the only choice is to make a ifdef WINDOWS section of the
> > rte_function_versioning.h file, and effectively turn all the macros into no-ops.
> 
> Yes that's the idea.
> But we still need to implement either BIND_DEFAULT_SYMBOL or MAP_STATIC_SYMBOL
> to alias the latest function version to the actual function symbol.

I've just found a tip in https://sourceware.org/binutils/docs/ld/WIN32.html
It suggests to create a weak symbol:
void foo() __attribute__((weak, alias ("foo_latestversion")));


> > The BIND_DEFAULT_SYMBOL macro looks like it could still work, as MSVC has an
> > alias linker command thats implementable via __pragma, but thats probably all we
> > can do, unless there is some more robust versioning support that I can't find.
> 
> What is this pragma?
> 
> 
> > Note we will also likely need to agument the makefiles/meson files so that the
> > link stage doesn't pass the version script to the linker
> 
> Why not using the version script for exported symbols?
> We are already doing it (.def file generated from .map).




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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 21:27     ` Thomas Monjalon
  2020-05-27 21:43       ` Thomas Monjalon
@ 2020-05-28  0:21       ` Neil Horman
  1 sibling, 0 replies; 8+ messages in thread
From: Neil Horman @ 2020-05-28  0:21 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Harini Ramakrishnan, Fady Bader, dev, Omar Cardona,
	Pallavi Kadam, Ranjit Menon, dmitry.kozliuk, mdr

On Wed, May 27, 2020 at 11:27:12PM +0200, Thomas Monjalon wrote:
> 27/05/2020 22:35, Neil Horman:
> > On Wed, May 27, 2020 at 02:50:07PM +0200, Thomas Monjalon wrote:
> > > +Cc more people
> > > 
> > > 27/05/2020 12:41, Fady Bader:
> > > > What should we do with the ABI versioning in Windows ?
> > > 
> > > I think there are 2 questions here:
> > > 
> > > 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> > > The decision must be clearly documented.
> > > 
> > My first notion, without any greater thought is "why wouldn't we".  ABI
> > stability is OS agnostic.  If a symbol is considered stable, theres no reason
> > that I can think of that it wouldn't be stable for each OS.
> 
> Technical reason + no need so far.
> 
I'm not sure what you mean by technical reason.  As for need, I'd be careful of
that.  We already have the infrastructure, so if symbol versioning can be
implemented, we should.  We should only rip it out for windows if the
compiler/linker/loader doesn't support symbol versioning.  And I honestly don't
have a definitive answer on that

> 
> > > 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> > > Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> > > 
> > Can you elaborate on what exactly the issue is here?  I presume by your comment
> > above that visual studio either doesn't support symbol level versioning or
> > doesn't support versioning at all?
> 
> I don't know how to implement the macros in rte_function_versioning.h for Windows.
> 
Thats a question beyond my skill, especially given that I don't have a windows
compiler available

> 
> > If thats the case, and there is a commitment to make dpdk buildable on windows,
> > I suppose the only choice is to make a ifdef WINDOWS section of the
> > rte_function_versioning.h file, and effectively turn all the macros into no-ops.
> 
> Yes that's the idea.
> But we still need to implement either BIND_DEFAULT_SYMBOL or MAP_STATIC_SYMBOL
> to alias the latest function version to the actual function symbol.
> 
You can use alternate names, which is equivalent to clang/gccs
__attribute__((alias)):
https://stackoverflow.com/questions/53381461/does-visual-c-provide-a-language-construct-with-the-same-functionality-as-a

> > The BIND_DEFAULT_SYMBOL macro looks like it could still work, as MSVC has an
> > alias linker command thats implementable via __pragma, but thats probably all we
> > can do, unless there is some more robust versioning support that I can't find.
> 
> What is this pragma?
> 
See the link above

> 
> > Note we will also likely need to agument the makefiles/meson files so that the
> > link stage doesn't pass the version script to the linker
> 
> Why not using the version script for exported symbols?
> We are already doing it (.def file generated from .map).
> 
Well, if msvc doesn't support symbol versioning, I expect their linker won't
accept a linker version script, or are you using another compiler?
Neil

> 
> 

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

* Re: [dpdk-dev] ABI versioning in Windows
  2020-05-27 21:43       ` Thomas Monjalon
@ 2020-05-28  0:28         ` Neil Horman
  0 siblings, 0 replies; 8+ messages in thread
From: Neil Horman @ 2020-05-28  0:28 UTC (permalink / raw)
  To: Thomas Monjalon
  Cc: Harini Ramakrishnan, Fady Bader, dev, Omar Cardona,
	Pallavi Kadam, Ranjit Menon, dmitry.kozliuk, mdr

On Wed, May 27, 2020 at 11:43:49PM +0200, Thomas Monjalon wrote:
> 27/05/2020 23:27, Thomas Monjalon:
> > 27/05/2020 22:35, Neil Horman:
> > > On Wed, May 27, 2020 at 02:50:07PM +0200, Thomas Monjalon wrote:
> > > > +Cc more people
> > > > 
> > > > 27/05/2020 12:41, Fady Bader:
> > > > > What should we do with the ABI versioning in Windows ?
> > > > 
> > > > I think there are 2 questions here:
> > > > 
> > > > 1/ Do we want to maintain ABI compatibility on Windows like we do for Linux and FreeBSD?
> > > > The decision must be clearly documented.
> > > > 
> > > My first notion, without any greater thought is "why wouldn't we".  ABI
> > > stability is OS agnostic.  If a symbol is considered stable, theres no reason
> > > that I can think of that it wouldn't be stable for each OS.
> > 
> > Technical reason + no need so far.
> > 
> > 
> > > > 2/ How do we implement the macros in rte_function_versioning.h for Windows?
> > > > Something needs to be done, otherwise we cannot compile libraries having some function versioning.
> > > > 
> > > Can you elaborate on what exactly the issue is here?  I presume by your comment
> > > above that visual studio either doesn't support symbol level versioning or
> > > doesn't support versioning at all?
> > 
> > I don't know how to implement the macros in rte_function_versioning.h for Windows.
> > 
> > 
> > > If thats the case, and there is a commitment to make dpdk buildable on windows,
> > > I suppose the only choice is to make a ifdef WINDOWS section of the
> > > rte_function_versioning.h file, and effectively turn all the macros into no-ops.
> > 
> > Yes that's the idea.
> > But we still need to implement either BIND_DEFAULT_SYMBOL or MAP_STATIC_SYMBOL
> > to alias the latest function version to the actual function symbol.
> 
> I've just found a tip in https://sourceware.org/binutils/docs/ld/WIN32.html
> It suggests to create a weak symbol:
> void foo() __attribute__((weak, alias ("foo_latestversion")));
> 
Ahh, you're using mingw, which appears to support versioning.  If the windows
equivalent of ld.so honors those versions, I would think the versioning bits
should almost just work (assuming that mingw supports all the used
__attirbutes__)

Neil

> 
> > > The BIND_DEFAULT_SYMBOL macro looks like it could still work, as MSVC has an
> > > alias linker command thats implementable via __pragma, but thats probably all we
> > > can do, unless there is some more robust versioning support that I can't find.
> > 
> > What is this pragma?
> > 
> > 
> > > Note we will also likely need to agument the makefiles/meson files so that the
> > > link stage doesn't pass the version script to the linker
> > 
> > Why not using the version script for exported symbols?
> > We are already doing it (.def file generated from .map).
> 
> 
> 
> 

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

end of thread, other threads:[~2020-05-28  0:28 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27 10:41 [dpdk-dev] ABI versioning in Windows Fady Bader
2020-05-27 12:50 ` Thomas Monjalon
2020-05-27 14:32   ` Ray Kinsella
2020-05-27 20:35   ` Neil Horman
2020-05-27 21:27     ` Thomas Monjalon
2020-05-27 21:43       ` Thomas Monjalon
2020-05-28  0:28         ` Neil Horman
2020-05-28  0:21       ` Neil Horman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).