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 1202091 - supermin fails to build with hardening flags
Summary: supermin fails to build with hardening flags
Keywords:
Status: CLOSED DUPLICATE of bug 1287743
Alias: None
Product: Fedora
Classification: Fedora
Component: supermin
Version: 23
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Richard W.M. Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On: 1204162 1287743 1343892
Blocks: harden-failure
TreeView+ depends on / blocked
 
Reported: 2015-03-15 10:17 UTC by Richard W.M. Jones
Modified: 2016-11-24 11:55 UTC (History)
4 users (show)

Fixed In Version: supermin-5.1.12-5.fc23
Doc Type: Bug Fix
Doc Text:
Clone Of:
: 1204162 (view as bug list)
Environment:
Last Closed: 2016-11-24 11:55:01 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
build.log (66.23 KB, text/plain)
2015-03-15 10:32 UTC, Richard W.M. Jones
no flags Details

Description Richard W.M. Jones 2015-03-15 10:17:22 UTC
Description of problem:

Supermin is a short-lived process so it's not really a problem, but
it fails to build anyway with hardening flags because there is a small
statically linked C binary in the build:

The error is peculiar ...  The static binary is compiled and linked
fine, and then stripped, but there is a test (in supermin src/Makefile.am)
that the final binary is statically linked, but that fails:

    *** error: init is not statically linked

The test that fails is:

        @file $< | grep -isq static || \
          (echo "*** error: init is not statically linked"; exit 1)

Possibly this test is wrong.

Complete build failure:
http://koji.fedoraproject.org/koji/taskinfo?taskID=9179157

Comment 1 Richard W.M. Jones 2015-03-15 10:32:02 UTC
Created attachment 1001905 [details]
build.log

Sorry, I was looking at the wrong error.  The actual error is:

gcc -static -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -m64 -mtune=generic -static -Wl,-z,relro -specs=/usr/lib/rpm/redhat/redhat-hardened-ld -o init init-init.o
/usr/bin/ld: /usr/lib/gcc/x86_64-redhat-linux/5.0.0/../../../../lib64/libc.a(libc-start.o): relocation R_X86_64_32 against `_dl_starting_up' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-redhat-linux/5.0.0/../../../../lib64/libc.a: error adding symbols: Bad value

Note that we are compiling statically, so the error is bogus.

See attached complete build log.

Comment 2 Prabhjyot Sodhi[:psd] 2015-03-16 09:36:53 UTC
Hi Richard,
I would like to help fix this.
Can you please help me understand how should I proceed on this?

Comment 3 Richard W.M. Jones 2015-03-16 09:48:51 UTC
(In reply to Prabhjyot Sodhi[:psd] from comment #2)
> Hi Richard,
> I would like to help fix this.
> Can you please help me understand how should I proceed on this?

I don't understand the question.

Comment 4 Prabhjyot Sodhi[:psd] 2015-03-16 10:20:05 UTC
can we not compile to the lib with -fPIC?

Comment 5 Richard W.M. Jones 2015-03-16 12:58:35 UTC
Fixed by:
http://pkgs.fedoraproject.org/cgit/supermin.git/commit/

Comment 7 Moez Roy 2015-06-06 03:49:13 UTC
What happens when you put this in under %build section:

CFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"
CXXFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"

export CFLAGS
export CXXFLAGS

Comment 8 Jan Kurik 2015-07-15 14:24:20 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 23 development cycle.
Changing version to '23'.

(As we did not run this process for some time, it could affect also pre-Fedora 23 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 23 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora23

Comment 9 Richard W.M. Jones 2015-09-03 16:51:47 UTC
(In reply to Moez Roy from comment #7)
> What happens when you put this in under %build section:
> 
> CFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"
> CXXFLAGS="$RPM_OPT_FLAGS -fPIC -pie -Wl,-z,relro -Wl,-z,now"
> 
> export CFLAGS
> export CXXFLAGS

The answer is the same error.

Note that init is a *static linked binary*.

Comment 10 Fedora End Of Life 2016-11-24 11:33:57 UTC
This message is a reminder that Fedora 23 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 23. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '23'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not 
able to fix it before Fedora 23 is end of life. If you would still like 
to see this bug fixed and are able to reproduce it against a later version 
of Fedora, you are encouraged  change the 'version' to a later Fedora 
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.

Comment 11 Richard W.M. Jones 2016-11-24 11:55:01 UTC

*** This bug has been marked as a duplicate of bug 1287743 ***


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