Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 493166

Summary: net-libs/gnutls: please add abi_x86_32 support
Product: Gentoo Linux Reporter: Austin English (RETIRED) <wizardedit>
Component: Current packagesAssignee: Crypto team [DISABLED] <crypto+disabled>
Status: RESOLVED FIXED    
Severity: normal CC: alonbl, ansla80, asturm, carlphilippreh, idarktemplar, jrittenh, me, multilib+disabled, tetromino, wizardedit
Priority: Normal Keywords: NeedPatch
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on: 493974, 499376, 499380, 499392    
Bug Blocks: 454644, 493172, 501556    
Attachments: diff against 2.7.1
gnutls-3.2.9.ebuild.patch
gnutls-3.2.9.ebuild.patch, v2
diff against 3.2.10
gnutls-3.2.11.ebuild.diff
gnutls-3.2.11-r1.ebuild.diff
patch improving the state of out-of-tree builds
gnutls-3.2.12.1.ebuild.patch
gnutls-3.2.12.1.ebuild.patch
gnutls-3.3.1.ebuild.patch

Description Austin English (RETIRED) gentoo-dev 2013-12-02 22:29:44 UTC
It is needed by 32-bit wine.
Comment 1 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-02 22:38:47 UTC
Please don't CC random people without explaining why you did so. This results in needless bug spam and confusion.

I'm sorry if I'm removing someone who explicitly requested the poster to CC him.
Comment 2 Austin English (RETIRED) gentoo-dev 2013-12-03 20:08:29 UTC
(In reply to Michał Górny from comment #1)
> Please don't CC random people without explaining why you did so. This
> results in needless bug spam and confusion.

Not intentional, side effect from cloning a previous bug. Sorry about that.
Comment 3 Austin English (RETIRED) gentoo-dev 2013-12-11 22:07:59 UTC
Created attachment 365116 [details]
diff against 2.7.1
Comment 4 Austin English (RETIRED) gentoo-dev 2013-12-11 22:08:21 UTC
Comment on attachment 365116 [details]
diff against 2.7.1

Wrong bug, ignore please.
Comment 5 Michael Mair-Keimberger (iamnr3) 2014-01-26 19:34:11 UTC
Created attachment 368810 [details, diff]
gnutls-3.2.9.ebuild.patch

This is my take on gnutls - please review.
I've decided to disabled doc on non-native archs as we only need it to build it once.

The ebuild still isn't working correctly, there are following open issues:
* building gnutls with USE=guile fails. Somehow guile in gnutls (x86) tries to link against the 64bit guile version (see below). I couldn't fix it till now.
* x86 tests fail at "pkcs1-padding". Test passes if 32 isn't enabled.

Except for USE=guile all use-falgs are building!


guile fail:
libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC  .libs/guile_gnutls_v_2_la-core.o .libs/guile_gnutls_v_2_la-errors.o .libs/guile_gnutls_v_2_la-utils.o  -Wl,--whole-archive ../../gl/.libs/libgnu.a -Wl,--no-whole-archive  -Wl,-rpath -Wl,/var/tmp/portage/net-libs/gnutls-3.2.9/work/gnutls-3.2.9-x86/lib/.libs -Wl,--as-needed ../../lib/.libs/libgnutls.so -L/usr/lib32 -lz -ltasn1 -lnettle -lhogweed -L/usr/lib64 /usr/lib64/libguile.so /usr/lib32/libltdl.so -lgmp -lcrypt -lm /usr/lib64/libltdl.so -ldl  -m32 -pthread -O2 -Wl,-O1 -Wl,--hash-style=gnu -pthread   -pthread -Wl,-soname -Wl,guile-gnutls-v-2.so.0 -o .libs/guile-gnutls-v-2.so.0.0.0
/usr/lib64/libguile.so: error adding symbols: File in wrong format
Comment 6 Austin English (RETIRED) gentoo-dev 2014-01-28 00:52:00 UTC
(In reply to Michael Mair-Keimberger (iamnr3) from comment #5)
> Created attachment 368810 [details, diff] [details, diff]
> gnutls-3.2.9.ebuild.patch
> 
> This is my take on gnutls - please review.
> I've decided to disabled doc on non-native archs as we only need it to build
> it once.
> 
> The ebuild still isn't working correctly, there are following open issues:
> * building gnutls with USE=guile fails. Somehow guile in gnutls (x86) tries
> to link against the 64bit guile version (see below). I couldn't fix it till
> now.
> * x86 tests fail at "pkcs1-padding". Test passes if 32 isn't enabled.
> 
> Except for USE=guile all use-falgs are building!
> 
> 
> guile fail:
> libtool: link: x86_64-pc-linux-gnu-gcc -m32 -shared  -fPIC -DPIC 
> .libs/guile_gnutls_v_2_la-core.o .libs/guile_gnutls_v_2_la-errors.o
> .libs/guile_gnutls_v_2_la-utils.o  -Wl,--whole-archive
> ../../gl/.libs/libgnu.a -Wl,--no-whole-archive  -Wl,-rpath
> -Wl,/var/tmp/portage/net-libs/gnutls-3.2.9/work/gnutls-3.2.9-x86/lib/.libs
> -Wl,--as-needed ../../lib/.libs/libgnutls.so -L/usr/lib32 -lz -ltasn1
> -lnettle -lhogweed -L/usr/lib64 /usr/lib64/libguile.so /usr/lib32/libltdl.so
> -lgmp -lcrypt -lm /usr/lib64/libltdl.so -ldl  -m32 -pthread -O2 -Wl,-O1
> -Wl,--hash-style=gnu -pthread   -pthread -Wl,-soname
> -Wl,guile-gnutls-v-2.so.0 -o .libs/guile-gnutls-v-2.so.0.0.0
> /usr/lib64/libguile.so: error adding symbols: File in wrong format

I tested your ebuild (along with the required dependencies). Works for my system (and wine's secur32/wininet tests pass).

Thanks for your work!
Comment 7 Michael Mair-Keimberger (iamnr3) 2014-01-28 21:13:13 UTC
Created attachment 369002 [details, diff]
gnutls-3.2.9.ebuild.patch, v2

> I tested your ebuild (along with the required dependencies). Works for my
> system (and wine's secur32/wininet tests pass).
> 
> Thanks for your work!

You're welcome, and thx for testing :)

I've also fixed the guile issue now and fixed a typo in the ebuild.
I didn't run tests again, but except those tests everything should work now.
Comment 8 Michael Mair-Keimberger (iamnr3) 2014-02-09 20:02:52 UTC
(In reply to Michael Mair-Keimberger (iamnr3) from comment #7)
> Created attachment 369002 [details, diff] [details, diff]
> gnutls-3.2.9.ebuild.patch, v2
> 
> > I tested your ebuild (along with the required dependencies). Works for my
> > system (and wine's secur32/wininet tests pass).
> > 
> > Thanks for your work!
> 
> You're welcome, and thx for testing :)
> 
> I've also fixed the guile issue now and fixed a typo in the ebuild.
> I didn't run tests again, but except those tests everything should work now.

Ok, i didn't fix it really..
My latest changes just disables guile at all so it still doesn't work.

As far as i could find out gnutls get it's linker flags for guile from "guile-config link", which always returns the native (64bit) flags. Sadly it's impossible to pass guile's libdir via the configure script.

Actually i don't really know how to fix this. However, i though about to keep a 32bit guile-config (needs change to the guile ebuild) and export the correct guile-config for the correct arch in the gnutls configure script? Any opinions about that. I would be glad to get some other suggestions. :)
Comment 9 Austin English (RETIRED) gentoo-dev 2014-02-12 23:55:35 UTC
Created attachment 370260 [details, diff]
diff against 3.2.10

Updated patch to gnutls-3.2.10
Comment 10 Alon Bar-Lev (RETIRED) gentoo-dev 2014-02-15 21:35:35 UTC
Created attachment 370522 [details, diff]
gnutls-3.2.11.ebuild.diff

slightly modified
Comment 11 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-02-21 18:22:12 UTC
Do we actually need multilib guile here?

$ grep -l guile $(qlist gnutls)
/usr/lib64/guile/1.8/guile-gnutls-v-2.so.0.0.0
/usr/share/guile/site/gnutls.scm
/usr/lib64/guile/1.8/guile-gnutls-v-2.so
/usr/lib64/guile/1.8/guile-gnutls-v-2.so.0

It seems that it's much like other language bindings that we disable for multilib.
Comment 12 Andreas Sturmlechner gentoo-dev 2014-03-02 20:11:54 UTC
Created attachment 371580 [details, diff]
gnutls-3.2.11-r1.ebuild.diff

- patch didn't apply cleanly after recent bump-
- noticed libtasn1-2.14 was not detected by configure, raised dep to >=3.2
- guile disabled if non-native abi

so let's test the waters of that multilib business
Comment 13 Rafał Mużyło 2014-03-08 05:37:02 UTC
Created attachment 372040 [details, diff]
patch improving the state of out-of-tree builds

While I'm not certain it's complete, as it's been tested only with a limited number of useflags, this patch just *might* remove the need for multilib_copy_sources.

Also, a minor note: most likely you *don't* want to build docs for 32bit - it would get overwritten on install anyway.
Comment 14 Michael Mair-Keimberger (iamnr3) 2014-03-10 21:03:08 UTC
Created attachment 372326 [details, diff]
gnutls-3.2.12.1.ebuild.patch

I've updated the ebuild for latest gnutls. Some notes:

* I've merged the DOCS variable into the already present dodoc line in multilib_src_install_all. Using DOCS wouldn't work btw.
* In use_enable_binaries() the first "if false && multilib_build_binaries;" didn't worked as expected and always disabled those flags for both native and non-native arch. I've removed "false" - now it works as expected.
* I've also removed the additional "${EPREFIX}/usr/$(get_libdir)" in use_enable for guile as it was a mistake by me which i didn't reverted with my last patch. Sorry about that - that didn't worked at all and just disabled guile at all.

Please have a look at it :)


(In reply to Rafał Mużyło from comment #13)
> Also, a minor note: most likely you *don't* want to build docs for 32bit -
> it would get overwritten on install anyway.

Don't know if i understand you correct but the doc useflag was already disabled for non-native arch's thus they should be build only for native arch?
Comment 15 Rafał Mużyło 2014-03-12 10:34:13 UTC
(In reply to Michael Mair-Keimberger (iamnr3) from comment #14)
> 
> * I've merged the DOCS variable into the already present dodoc line in
> multilib_src_install_all. Using DOCS wouldn't work btw.
> 
That's likely cause with multilib classes (well, those ABI_X86 ones) DOCS need to be defined in src_prepare, not global scope and einstalldocs needs to be called if multilib_src_install_all is defined

> (In reply to Rafał Mużyło from comment #13)
> > Also, a minor note: most likely you *don't* want to build docs for 32bit -
> > it would get overwritten on install anyway.
> 
> Don't know if i understand you correct but the doc useflag was already
> disabled for non-native arch's thus they should be build only for native
> arch?

Right, misread that part of your (?) changes.
Comment 16 Michael Mair-Keimberger (iamnr3) 2014-03-14 07:12:20 UTC
Created attachment 372636 [details, diff]
gnutls-3.2.12.1.ebuild.patch

(In reply to Rafał Mużyło from comment #13)
> Created attachment 372040 [details, diff] [details, diff]
> patch improving the state of out-of-tree builds
> 
> While I'm not certain it's complete, as it's been tested only with a limited
> number of useflags, this patch just *might* remove the need for
> multilib_copy_sources.
> 
Great work :)
I've tested your changes with all flags except the "test" flag enabled and it builds fine.

# ABI_X86="32" USE="guile doc dane examples pkcs11 static-libs" LINGUAS="cs de en fi fr it ms nl pl sv uk vi zh_CN" emerge -pv1 gnutls                                                                                

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] net-libs/gnutls-3.2.12.1::testing  USE="crywrap cxx dane doc examples guile nls pkcs11 static-libs zlib {-test}" ABI_X86="32 (64) (-x32)" LINGUAS="cs de en fi fr it ms nl pl sv uk vi zh_CN" 0 kB



(In reply to Rafał Mużyło from comment #15)
> (In reply to Michael Mair-Keimberger (iamnr3) from comment #14)
> > 
> > * I've merged the DOCS variable into the already present dodoc line in
> > multilib_src_install_all. Using DOCS wouldn't work btw.
> > 
> That's likely cause with multilib classes (well, those ABI_X86 ones) DOCS
> need to be defined in src_prepare, not global scope and einstalldocs needs
> to be called if multilib_src_install_all is defined
> 
Ahh, i was thinking about it was because of the multilib eclass, but didn't look further into it. However, i guess using a single dodoc instead of DOCS+einstalldocs doesn't matter much in this case. Though, thanks for the clarification :)

I've also updated my patch. It uses your patch now and doesn't have to copy the sources. Please review.
Comment 17 Austin English (RETIRED) gentoo-dev 2014-03-25 20:04:37 UTC
attachment 372636 [details, diff] works for wine as well.
Comment 18 Michael Mair-Keimberger (iamnr3) 2014-05-04 11:05:46 UTC
Created attachment 376320 [details, diff]
gnutls-3.3.1.ebuild.patch

Updated patch.
This uses multilib_native_use_enable and also removes the out-of-tree patch as this was fixed upstream.
Comment 19 Andreas Sturmlechner gentoo-dev 2014-05-04 18:18:16 UTC
Comment on attachment 371580 [details, diff]
gnutls-3.2.11-r1.ebuild.diff

3.3.1 patch works fine :)
Comment 20 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-13 20:18:00 UTC
libopts is used for daemon only, and guile is for guile stuff :).
Comment 21 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2014-05-13 21:58:19 UTC
+*gnutls-3.3.1-r1 (13 May 2014)
+
+  13 May 2014; Michał Górny <mgorny@gentoo.org> +gnutls-3.3.1-r1.ebuild:
+  Enable multilib support, bug #493166.

p.masked as usual, awaiting extra review. I will commit updated emul-linux tomorrow, possibly after converting a few more packages.