Bug 1547522 - autogen: Partial injection of Fedora build flags
Summary: autogen: Partial injection of Fedora build flags
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: autogen
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Anthony Green
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: Fedora28BuildFlags
TreeView+ depends on / blocked
 
Reported: 2018-02-21 13:30 UTC by Florian Weimer
Modified: 2018-02-21 18:06 UTC (History)
3 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-02-21 18:06:23 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Florian Weimer 2018-02-21 13:30:06 UTC
/usr/lib64/libopts.so.25.16.1 in autogen-libopts-5.18.12-6.fc28.x86_64 has not been linked with the standard Fedora linker flags (LDFLAGS) from redhat-rpm-config:

libtool: link: gcc -Wl,--as-needed -shared  -fPIC -DPIC  .libs/libopts_la-libopts.o  -Wl,--whole-archive ../snprintfv/.libs/libsnprintfv.a -Wl,--no-whole-archive  -lm -ldl  -O2 -g -fstack-protector-strong -grecord-gcc-switches -m64 -mtune=generic -mcet -Wl,-z -Wl,relro   -Wl,-soname -Wl,libopts.so.25 -o .libs/libopts.so.25.16.1

This is a bit odd because we do start out with the correct flags:

+ LDFLAGS='-Wl,-z,relro  -specs=/usr/lib/rpm/redhat/redhat-hardened-ld'

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 1 Miroslav Lichvar 2018-02-21 18:06:23 UTC
Thanks for the report. The problem was in the RPATH fix. It replaced the generated libtool with /usr/bin/libtool, which doesn't seem to include the hardening hack.

It should be fixed in autogen-5.18.12-7.

From the build log:
libtool: link: gcc -Wl,--as-needed -shared  -fPIC -DPIC  .libs/libopts_la-libopts.o  -Wl,--whole-archive ../snprintfv/.libs/libsnprintfv.a -Wl,--no-whole-archive  -lm -ldl -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -O2 -m64 -mtune=generic -mcet -Wl,-z -Wl,relro   -Wl,-soname -Wl,libopts.so.25 -o .libs/libopts.so.25.16.1


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