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

Add missing libcrypto for undefined references #2436

Merged
merged 1 commit into from
Nov 20, 2018

Conversation

ellert
Copy link
Contributor

@ellert ellert commented Aug 3, 2018

Missing linking to the libcrypto library causes undefined symbols:

/usr/bin/ld: ../../lib/librpdutil.a(globus.cxx.o): in function `ROOT::GlbsToolCheckProxy(char**)':
/builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:547: undefined reference to `PEM_read_X509'
/usr/bin/ld: /builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:552: undefined reference to `X509_get_issuer_name'
/usr/bin/ld: /builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:552: undefined reference to `X509_NAME_oneline'
/usr/bin/ld: ../../lib/librpdutil.a(globus.cxx.o): in function `ROOT::GlbsToolCheckCert(char**)':
/builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:187: undefined reference to `PEM_read_X509'
/usr/bin/ld: /builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:192: undefined reference to `X509_get_subject_name'
/usr/bin/ld: /builddir/build/BUILD/root-6.14.02/net/rpdutils/src/globus.cxx:192: undefined reference to `X509_NAME_oneline'
collect2: error: ld returned 1 exit status

@ellert ellert requested a review from amadio as a code owner August 3, 2018 20:40
@phsft-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@amadio amadio self-assigned this Aug 6, 2018
@amadio
Copy link
Member

amadio commented Aug 8, 2018

@phsft-bot build

@phsft-bot
Copy link
Collaborator

Starting build on slc6/gcc48, slc6-i686/gcc49, centos7/clang39, centos7/gcc62, centos7/gcc7, fedora28/native, ubuntu16/native, mac1013/native, windows10/vc15 with flags -Dccache=ON
How to customize builds

@@ -4,6 +4,7 @@
############################################################################

ROOT_EXECUTABLE(rootd *.cxx ${CMAKE_SOURCE_DIR}/core/clib/src/strlcpy.c
LIBRARIES rpdutil rsa ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES})
LIBRARIES rpdutil rsa ${GLOBUS_LIBRARIES} ${OPENSSL_LIBRARIES}
BUILTINS OPENSSL)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't understand, how does this add libcrypto?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was the only place where it said LIBRARIES ${OPENSSL_LIBRARIES} without BUILTINS OPENSSL. You should always have both. ${OPENSSL_LIBRARIES} provides libssl and libcrypto when the system libraries are used, BUILTINS OPENSSL provides libssl and libcrypto when the builtin openssl is used. Having {OPENSSL_LIBRARIES} without BUILTINS OPENSSL is inconsistent.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I updated the builtin for OpenSSL, so that having BUILTINS OPENSSL would not be necessary anymore. Is there a way I can reproduce the error you see? See, for example, commits 65bbb76 and 3787d16, and take a look at the log for builtins/openssl in ROOT for more details. If some configuration doesn't work for you, I'd like to fix the CMakeLists.txt for builtin OpenSSL. Eventually, I want the BUILTINS option to disappear from the build system. The dependencies should be there by default regardless if a package is builtin or not.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The change here was just for consistency.
The change needed to fix the link error was the change in the rule for compiling libSrvAuth.so in net/rpdutils/CMakeLists.txt. After the change that made the dependency on openssl in libNet private, this dependency is no longer inherited by SrvAuth by declaring DEPENDENCIES Net. And since SrvAuth uses openssl directly the linking started to fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The undefined references come from globus.cxx.o, so in order to reproduce you need to configure using -Dglobus:BOOL=ON.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I will try with this configuration and fix the problem. The BUILTINS option will gradually go away, so I don't want to add it back if it's not needed.

@amadio amadio merged commit e88d343 into root-project:master Nov 20, 2018
@amadio
Copy link
Member

amadio commented Nov 20, 2018

@ellert Thanks for the fix and sorry for the late merging!

@ellert ellert deleted the missing-libcrypto-link branch November 21, 2018 15:06
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.

None yet

3 participants