Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow static linkage with libsctp.a #45

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

georgthegreat
Copy link

At the time libsctp.a does not provide sctp_connectx symbol which is forward-declared in its interface.

This PR suggests renaming sctp_connectx3 to sctp_connectx to workaround this.

We don't use pull requests anymore. Please follow Linux netdev community patch
posting standard instead. Post your patches to linux-sctp@vger.kernel.org and
they will be very welcomed. Thanks!

At the time libsctp.a does not provide sctp_connectx symbol which is forward-declared in its interface.

This PR suggests renaming sctp_connectx3 to sctp_connectx to workaround this.
@marceloleitner
Copy link
Contributor

If I hack the tests Makefile.am with this:

--- a/src/func_tests/Makefile.am
+++ b/src/func_tests/Makefile.am
@@ -8,7 +8,7 @@ AM_CPPFLAGS = -I. -I$(top_builddir)/src/include -I$(top_srcdir)/src/testlib \
               -g -O2 -fno-strict-aliasing -Wall -Wstrict-prototypes \
               -Wimplicit-function-declaration

-AM_LDFLAGS = -lpthread
+AM_LDFLAGS = -lpthread -static

It works without your patch and fails with it, with this error:

  CCLD     test_connectx
/usr/bin/ld: ../../src/lib/.libs/libsctp.a(connectx.o): in function `__connectx':
/home/mrl/eng/lksctp-tools/src/lib/connectx.c:98: multiple definition of `sctp_connectx'; ../../src/lib/.libs/libsctp.a(connectx.o):/home/mrl/eng/lksctp-tools/src/lib/connectx.c:146: first defined here
collect2: error: ld returned 1 exit status
make: *** [Makefile:1015: test_connectx] Erro 1

What am I missing? How did you test this?

@georgthegreat
Copy link
Author

Well, it looks like there is no way (meaning that I know no way) to combine all off

  1. Static linkage
  2. Dynamic linkage
  3. Versioned symbols

One should either pick (1) + (2) or (2) + (3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants