Bug 1573086

Summary: dos2unix: Partial build flags injection
Product: [Fedora] Fedora Reporter: Florian Weimer <fweimer>
Component: dos2unixAssignee: Tim Waugh <twaugh>
Status: CLOSED ERRATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 28CC: twaugh, waterlan
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: dos2unix-7.4.0-3.fc28 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2018-05-11 21:13:42 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1539083    

Description Florian Weimer 2018-04-30 07:43:53 UTC
dos2unix-7.4.0-2.fc28.x86_64 has not been not linked with the standard Fedora linker flags (LDFLAGS) from redhat-rpm-config.  Specifically, the build log contains:

cc dos2unix.o querycp.o common.o -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    -o dos2unix
cc unix2dos.o querycp.o common.o -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    -o unix2dos

So CFLAGS are there, but LDFLAGS are not.

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 Erwin Waterlander 2018-05-02 21:41:56 UTC
The Makefile adds environment variable RPM_OPT_FLAGS to CFLAGS. It also adds RPM_OPT_FLAGS to LDFLAGS, while it should add RPM_LD_FLAGS to LDFLAGS.
See Makefile line 361.

I will fix this in the next release of dos2unix.

In the meantime the correct LDFLAGS can be set via dos2unix.spec by changing the build command to:

make %{?_smp_mflags} LDFLAGS=%{build_ldflags}

Comment 2 Tim Waugh 2018-05-08 11:43:55 UTC
Thanks for the hint. In fact it needed double-quotes around the macro, but it seems to work fine.

Comment 3 Fedora Update System 2018-05-08 12:45:45 UTC
dos2unix-7.4.0-3.fc28 has been submitted as an update to Fedora 28. https://bodhi.fedoraproject.org/updates/FEDORA-2018-5d927eef64

Comment 4 Fedora Update System 2018-05-10 01:29:08 UTC
dos2unix-7.4.0-3.fc28 has been pushed to the Fedora 28 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2018-5d927eef64

Comment 5 Fedora Update System 2018-05-11 21:13:42 UTC
dos2unix-7.4.0-3.fc28 has been pushed to the Fedora 28 stable repository. If problems still persist, please make note of it in this bug report.