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

gnutls not building on OpenSolaris (x86) #7387

Closed
sagetrac-drkirkby mannequin opened this issue Nov 4, 2009 · 8 comments
Closed

gnutls not building on OpenSolaris (x86) #7387

sagetrac-drkirkby mannequin opened this issue Nov 4, 2009 · 8 comments

Comments

@sagetrac-drkirkby
Copy link
Mannequin

sagetrac-drkirkby mannequin commented Nov 4, 2009

There is an issue with the gnutls when trying to build 2
.2.1.p4 on OpenSolaris. Strangely, the same problem does not occur on Solaris 10 on SPARC. The linker is finding two copies of the gcrypt and gpg-error libraries. One set are from Sun and reside in /usr/lib and the second set are in the SAGE_LOCAL/lib, and are included in Sage.

== What does work - building gnutils independent of Sage ==

It's important to note that if that .spkg file is built outside of Sage directory structure, with none of the Sage environment variables set, so it builds fine except SAGE_LOCAL to something that is not empty (just to stop the spkg-install script exiting). The following will work:

$ cp gnutls-2.2.1.p4.spkg /tmp
$ cd /tmp
$ gtar xfj gnutls-2.2.1.p4.spkg
$ cd gnutls-2.2.1.p4
$ export SAGE_LOCAL=/tmp
$ ./spkg-install
$ ls /tmp/lib
libgnutls-extra.la           libgnutls-openssl.so.26
libgnutls-extra.so           libgnutls-openssl.so.26.1.2
libgnutls-extra.so.26        libgnutls.so
libgnutls-extra.so.26.1.2    libgnutls.so.26
libgnutls.la                 libgnutls.so.26.1.2
libgnutls-openssl.la         pkgconfig
libgnutls-openssl.so

In this case, gnutls is using all the libraries supplied by Sun, and none included in Sage. If 'ldd' is used to find the dependances of the libraries built in /tmp/lib, one finds many libraries, but which include these two:

  • /usr/lib/libgcrypt.so.11
  • /usr/lib/libgpg-error.so.0

The gcrypt and gpg-error libraries are included in Sage too, but are not used in this in the above example.

== What will not work (building as part of Sage) ==

When one attempts to build gnutls inside the Sage source tree, with all the environment variables set, so it all goes wrong. The lines in bold show the most important hint as to what is wrong.

ld: fatal: recording name conflict: file /export/home/drkirkby/sage-4.2/local/lib/libgpg-error.so' and file /usr/lib/libgpg-error.so' provide identical dependency names: libgpg-error.so.0 (possible multiple inclusion of the same file)

Here is a larger section of the error message. I've attached 'config.log'

gcc -std=gnu99 -shared -Wl,-h -Wl,libgnutls.so.26 -o .libs/libgnutls.so.26.1.2
  .libs/gnutls_record.o .libs/gnutls_compress.o .libs/debug.o .libs/gnutls_cip
her.o .libs/gnutls_buffers.o .libs/gnutls_handshake.o .libs/gnutls_num.o .libs
/gnutls_errors.o .libs/gnutls_algorithms.o .libs/gnutls_dh.o .libs/gnutls_kx.o
 .libs/gnutls_priority.o .libs/gnutls_hash_int.o .libs/gnutls_cipher_int.o .li
bs/gnutls_compress_int.o .libs/gnutls_session.o .libs/gnutls_db.o .libs/x509_b
64.o .libs/auth_anon.o .libs/gnutls_extensions.o .libs/gnutls_auth.o .libs/gnu
tls_v2_compat.o .libs/gnutls_datum.o .libs/auth_rsa.o .libs/gnutls_session_pac
k.o .libs/gnutls_mpi.o .libs/gnutls_pk.o .libs/gnutls_cert.o .libs/gnutls_glob
al.o .libs/gnutls_constate.o .libs/gnutls_anon_cred.o .libs/pkix_asn1_tab.o .l
ibs/gnutls_asn1_tab.o .libs/gnutls_mem.o .libs/auth_cert.o .libs/gnutls_ui.o .
libs/gnutls_sig.o .libs/auth_dhe.o .libs/gnutls_dh_primes.o .libs/ext_max_reco
rd.o .libs/gnutls_alert.o .libs/gnutls_str.o .libs/gnutls_state.o .libs/gnutls
_x509.o .libs/ext_cert_type.o .libs/gnutls_rsa_export.o .libs/auth_rsa_export.
o .libs/ext_server_name.o .libs/auth_dh_common.o .libs/gnutls_helper.o .libs/e
xt_inner_application.o .libs/gnutls_extra_hooks.o .libs/gnutls_supplemental.o 
.libs/ext_srp.o .libs/gnutls_srp.o .libs/auth_srp.o .libs/auth_srp_passwd.o .l
ibs/auth_srp_sb64.o .libs/auth_srp_rsa.o .libs/auth_psk.o .libs/auth_psk_passw
d.o .libs/gnutls_psk.o .libs/auth_dhe_psk.o -Wl,-z -Wl,allextract ../lgl/.libs
/liblgnu.a x509/.libs/libgnutls_x509.a -Wl,-z -Wl,defaultextract  -R/export/ho
me/drkirkby/sage-4.2/local/lib -R/export/home/drkirkby/sage-4.2/local/lib -L/u
sr/lib -ltasn1 -L/export/home/drkirkby/sage-4.2/local/lib /export/home/drkirkb
y/sage-4.2/local/lib/libgcrypt.so /export/home/drkirkby/sage-4.2/local/lib/lib
gpg-error.so -lz -lgcrypt -lgpg-error -lnsl -lsocket -lc 
ld: fatal: recording name conflict: file `/export/home/drkirkby/sage-4.2/local
/lib/libgcrypt.so' and file `/usr/lib/libgcrypt.so' provide identical dependen
cy names: libgcrypt.so.11  (possible multiple inclusion of the same file)
ld: fatal: recording name conflict: file `/export/home/drkirkby/sage-4.2/local
/lib/libgpg-error.so' and file `/usr/lib/libgpg-error.so' provide identical de
pendency names: libgpg-error.so.0  (possible multiple inclusion of the same fi
le)
ld: fatal: file processing errors. No output written to .libs/libgnutls.so.26.
1.2
collect2: ld returned 1 exit status
make[5]: *** [libgnutls.la] Error 1
make[5]: Leaving directory `/export/home/drkirkby/sage-4.2/spkg/build/gnutls-2
.2.1.p4/src/lib'

== A hack that will work ==

I expect this would cause other problems, and is certainly not the right way to address this, but if the following files are removed

  • SAGE_LOCAL/include/gcrypt-module.h
  • SAGE_LOCAL/include/gpg-error.h
  • SAGE_LOCAL/include/gcrypt.h
  • SAGE_LOCAL/lib/libgcrypt*
  • SAGE_LOCAL/lib/libgpg*

before one attempts to build gnutls, so the build will work.

CC: @sagetrac-drkirkby

Component: porting: Solaris

Author: Jaap Spies

Reviewer: David Kirkby

Merged: sage-4.3.1.alpha2

Issue created by migration from https://trac.sagemath.org/ticket/7387

@sagetrac-drkirkby sagetrac-drkirkby mannequin added this to the sage-4.3.1 milestone Nov 4, 2009
@sagetrac-drkirkby sagetrac-drkirkby mannequin self-assigned this Nov 4, 2009
@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Nov 4, 2009

Attachment: config.log

config.log file generated by the 'configure' script.

@jaapspies
Copy link
Member

comment:1

Working on Open Solaris 09/06 x86 in VirtualBox the build of gnutls
succeeded after a rebuild of libgpg and libcrypt in 64 bit mode.

I had to change the spkg-install files accordingly.

Jaap

@jaapspies
Copy link
Member

comment:2

I made a new spkg such that it builds on Open Solaris with SAGE64="yes"

libgpg and libcrypt built with 64 bit.

See: http://boxen.math.washington.edu/home/jsp/ports/gnutls-2.2.1.p5.spkg

real	1m46.089s
user	0m49.128s
sys	1m12.507s
Successfully installed gnutls-2.2.1.p5
Now cleaning up tmp files.
rm: cannot remove directory `/export/home/jaap/Downloads/sage-4.3.1.alpha0/spkg/build/gnutls-2.2.1.p5': Invalid argument
Making Sage/Python scripts relocatable...
Making script relocatable
Finished installing gnutls-2.2.1.p5.spkg
jaap@opensolaris:~/Downloads/sage-4.3.1.alpha0$ 

Jaap

@jaapspies
Copy link
Member

Author: Jaap Spies

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 4, 2010

Reviewer: David Kirkby

@sagetrac-drkirkby
Copy link
Mannequin Author

sagetrac-drkirkby mannequin commented Jan 4, 2010

comment:3

That fixes the problem.

It probably worth saying in future that the change will add the compiler option -m64 on any platform - it is not just Solaris. The problem with the original implementation is someone decided to limit it to OSX. The change makes it work on any platform.

But I'm not going to ask you to change it - just a minor point for the future.

Dave

@rlmill
Copy link
Mannequin

rlmill mannequin commented Jan 13, 2010

Merged: 4.3.1.alpha2

@rlmill rlmill mannequin removed the s: positive review label Jan 13, 2010
@rlmill rlmill mannequin closed this as completed Jan 13, 2010
@sagetrac-mvngu
Copy link
Mannequin

sagetrac-mvngu mannequin commented Jan 13, 2010

Changed merged from 4.3.1.alpha2 to sage-4.3.1.alpha2

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

No branches or pull requests

1 participant