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

fails to build when tox-core was built with nacl instead of libsodium #31

Closed
hasufell opened this issue Sep 10, 2013 · 16 comments
Closed

Comments

@hasufell
Copy link

build log https://gist.github.com/hasufell/46aa2b38052955452a86

@hasufell
Copy link
Author

@stqism
Copy link
Contributor

stqism commented Sep 13, 2013

Mind trying this again, but compile toxcore as a static library?

@devurandom
Copy link
Contributor

Could this be an issue similar to #47?

@stqism
Copy link
Contributor

stqism commented Oct 6, 2013

Mind testing this again? So I know if it can be closed.

@ghost
Copy link

ghost commented Mar 6, 2014

Is this solved?

@thierry-FreeBSD
Copy link
Contributor

FYI, I use the following patch in Tox to build venom correctly with NaCl in FreeBSD:

--- patch-libtoxcore.pc.in begins here ---
--- libtoxcore.pc.in.orig 2014-02-22 23:52:26.000000000 +0100
+++ libtoxcore.pc.in 2014-02-25 09:32:35.000000000 +0100
@@ -7,6 +7,6 @@
Description: Tox protocol library
Requires:
Version: @PACKAGE_VERSION@
-Libs: -L${libdir} -ltoxcore @libs@
+Libs: -L${libdir} -ltoxcore @NACL_LIBS@ @libs@
Cflags: -I${includedir}

--- patch-libtoxcore.pc.in ends here ---

But this does'nt work with Toxic.

@jin-eld
Copy link
Contributor

jin-eld commented Mar 18, 2014

I did some tuning to the core, basically I was told that when core is built vs nacl, the shared version of core should be disabled. I fixed pkg-config (i.e. also added NACL_LIBS) and set up core's configure in a way that it will automatically disable shared-library build if nacl is enabled.

Does it still fail with today's combination of core/toxic? I was trying to set up a BSD vm so I could have a look but did not succeed at getting BSD running properly/setting up a dev environment, if you have a shell for me where I could test, I'd appreciate it.

@jin-eld
Copy link
Contributor

jin-eld commented Mar 19, 2014

On Wed, Mar 19, 2014 at 02:20:24PM -0700, Thierry Thomas wrote:

Thanks for this update. I have to tried to check it, but it's not buildable
ATM, too many errors: log available at https://gist.github.com/thierry-FreeBSD/
9651558 if needed.

Uhm.. this gist is empty... are you sure you got the correct link?

@thierry-FreeBSD
Copy link
Contributor

I removed it with my answer - but too late since you got it!

I found the reason: Tox-Core's API changed, and it must rebuilt too.

@thierry-FreeBSD
Copy link
Contributor

Sorry for the delay... Here are the results of my tests.

With `pkg-config --libs libtoxcore' returning:

-L/usr/local/lib -ltoxcore -lnacl /usr/local/lib/cpucycles.o /usr/local/lib/randombytes.o

Venom links fine, but toxic fails with the message:

--- toxic ---
CCLD toxic
/usr/local/lib/randombytes.o: In function randombytes': randombytes-impl.c:(.text+0x0): multiple definition ofrandombytes'
/usr/local/lib/libnacl.a(randombytes.o):randombytes-impl.c:(.text+0x0): first defined here
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** [toxic] Error code 1

When `pkg-config --libs libtoxcore' only returns:

-L/usr/local/lib -ltoxcore -lnacl

toxic builds fine, and Venom still builds!

@jin-eld
Copy link
Contributor

jin-eld commented Mar 20, 2014

Thanks, I think I now know what the problem is, those static files should not appear in the .pc file at all, I'll submit a PR to toxcore to fix that.

@jin-eld
Copy link
Contributor

jin-eld commented Mar 23, 2014

I did a few more tests, basically it seems that on linux the object files are needed when linking applications vs. a nacl-based toxcore, at the same time this seems to cause linking errors on freebsd systems.

Toxcore configure script will be tuned in the way that it will add the object files to the .pc on linux but not do so on freebsd, this should hopefully resolve this issue. Pleae test as soon as the toxcore PR gets merged: irungentoo/toxcore#815
Thanks.

@thierry-FreeBSD
Copy link
Contributor

It's OK.

But I have a question: why did you disable the shared lib in tox when NaCl is enabled?

@jin-eld
Copy link
Contributor

jin-eld commented Mar 25, 2014

On Tue, Mar 25, 2014 at 03:12:36PM -0700, Thierry Thomas wrote:

It's OK.

But I have a question: why did you disable the shared lib in tox when NaCl is
enabled?

Actually I had errors when building shared toxcore libs vs. a static NaCl
library, after consulting with #tox-dev it was explained to me that the
correct way is to disable the shared lib build of toxcore when using NaCl.

My tests and observations confirmed that. Correct me if I'm wrong...

@thierry-FreeBSD
Copy link
Contributor

During my previous tests on FreeBSD, I've been building a shared lib for tox, and venom was OK.

@jin-eld
Copy link
Contributor

jin-eld commented Mar 25, 2014

On Tue, Mar 25, 2014 at 03:43:17PM -0700, Thierry Thomas wrote:

During my previous tests on FreeBSD, I've been building a shared lib for tox,
and venom was OK.

I'll try again, but I mainly followed the suggestion in the channel since I
was not familiar with NaCl myself.

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

No branches or pull requests

6 participants