Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1548823 - libtalloc: Missing annobin annotations in Python 3 module on x86-64
Summary: libtalloc: Missing annobin annotations in Python 3 module on x86-64
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: libtalloc
Version: rawhide
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Simo Sorce
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1217376 PYFLAGS
Blocks: Fedora28BuildFlags
TreeView+ depends on / blocked
 
Reported: 2018-02-25 10:10 UTC by Florian Weimer
Modified: 2019-01-21 22:19 UTC (History)
8 users (show)

Fixed In Version: libtalloc-2.1.11-6.fc28,libtalloc-2.1.11-6.fc29
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-03-02 07:49:08 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1548821 0 unspecified CLOSED annobin: Annotations and LTO 2022-05-16 11:32:56 UTC
Red Hat Bugzilla 1548822 0 unspecified CLOSED libldb: Missing annobin annotations in Python 3 module on x86-64 2022-05-16 11:32:56 UTC

Internal Links: 1548821 1548822

Description Florian Weimer 2018-02-25 10:10:36 UTC
/usr/lib64/libpytalloc-util.cpython-36m-x86-64-linux-gnu.so.2.1.11 in python3-talloc-2.1.11-4.fc28.x86_64 lacks annobin annotations.

This is probably due the use of LTO (bug 1548821).  libldb seems to have a very similar issue (bug 1548822).

Comment 1 Lukas Slebodnik 2018-02-26 09:30:02 UTC
I checked latest build.log
https://kojipkgs.fedoraproject.org//packages/libtalloc/2.1.11/4.fc28/data/logs/x86_64/build.log

and I can see flto when building with python3 (-flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none)

[22/34] Compiling pytalloc_util.c
09:14:03 runner /usr/bin/gcc -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -Wp,-D_GLIBCXX_ASSERTIONS -fexceptions -fstack-protector-strong -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection -mcet -fcf-protection -fPIC -fstack-protector -fvisibility=hidden -MD -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none -fno-strict-aliasing -Idefault -I.. -Idefault -I.. -Idefault/lib/replace -I../lib/replace -I/usr/local/include -I/usr/include/python3.6m -D_GNU_SOURCE=1 -D_XOPEN_SOURCE_EXTENDED=1 ../pytalloc_util.c -c -o default/pytalloc_util_18.o

Comment 2 Florian Weimer 2018-02-26 09:35:48 UTC
You could specify CLFAGS/%{optflags} when *linking* with LTO, too.  I expect that should fix the issue.

See https://src.fedoraproject.org/rpms/redhat-rpm-config/blob/master/f/buildflags.md for information on RPM macros and environment variables provided by the build environment.

Comment 3 Lukas Slebodnik 2018-02-26 09:54:57 UTC
I would say it is an issue in python3

sh$rpm -q python3
python3-3.6.4-14.fc28.x86_64

sh$ python3
Python 3.6.4 (default, Feb 16 2018, 15:09:49) 
[GCC 8.0.1 20180210 (Red Hat 8.0.1-0.13)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from distutils.sysconfig import get_config_var
>>> get_config_var('LDFLAGS')
'-Wl,-z,relro  -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g -Wl,-z,relro  -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -g  -flto -fuse-linker-plugin -ffat-lto-objects -flto-partition=none'

Maybe talloc, ldb, and samba use wrong way how to get linked flags for python

Comment 4 Lukas Slebodnik 2018-02-26 15:41:12 UTC
I found a workaround for lto injected by python LDFLAGS.

Samba build system can override with env variable.

diff --git a/libldb.spec b/libldb.spec
index cd72a91..42c03cf 100644
--- a/libtalloc.spec
+++ b/liblalloc.spec
@@ -144,6 +144,9 @@ PY3_CONFIG_FLAGS=--extra-python=%{__python3}
 PY3_CONFIG_FLAGS=""
 %endif
 
+# workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1217376
+export python_LDFLAGS=""
+
 %configure --disable-rpath \
            --disable-rpath-install \
            --bundled-libraries=NONE \

Florian,
I you want I can such workaround for libtalloc an libldb.
I do not have permission in samba and I was not able to find similar BZ for samba. But I assume there might be the same issue.

Comment 5 Lukas Slebodnik 2018-03-01 20:17:01 UTC
Florian,

I did not intentionally applied workaround from previous comment in libldb. Would you like to apply workaround also for libtalloc?

Comment 6 Florian Weimer 2018-03-02 06:00:25 UTC
(In reply to Lukas Slebodnik from comment #5)
> I did not intentionally applied workaround from previous comment in libldb.
> Would you like to apply workaround also for libtalloc?

That would make sense, yes please.  Would you please apply it to Fedora 28 as well?

Comment 7 Lukas Slebodnik 2018-03-02 07:49:08 UTC
Done


Note You need to log in before you can comment on or make changes to this bug.