Skip to content

Allow static linkage with libsctp.a#45

Open
georgthegreat wants to merge 1 commit intosctp:masterfrom
georgthegreat:patch-1
Open

Allow static linkage with libsctp.a#45
georgthegreat wants to merge 1 commit intosctp:masterfrom
georgthegreat:patch-1

Conversation

@georgthegreat
Copy link
Copy Markdown

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
Copy Markdown
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
Copy Markdown
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