Bug 642999

Summary: Static build (--enable-static_link) is completely broken with new gcc
Product: [Fedora] Fedora Reporter: Milan Broz <mbroz>
Component: lvm2Assignee: Zdenek Kabelac <zkabelac>
Status: CLOSED EOL QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: low Docs Contact:
Priority: low    
Version: 23CC: agk, bmarzins, bmr, dwysocha, heinzm, jonathan, jue, lvm-team, msnitzer, prajnoha, prockai, pvrabec, rworkman, shlomif
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-12-20 12:03:22 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
fix build with --enable-static none

Description Milan Broz 2010-10-14 12:47:23 UTC
Description of problem:

configuring lvm2 source with --enable-static_link no longer produces static binaries.

When compiling with recent gcc (4.4.5, 4.5.1) which, most distros already adopted, lvm2 static build is not working at all.

/usr/bin/ld: dynamic STT_GNU_IFUNC symbol `strcmp' with pointer equality in `/usr/lib/gcc/x86_64-redhat-linux/4.5.1/../../../../lib64/libc.a(strcmp.o)' can not be used when making an executable; recompile with -fPIE and relink with -pie
collect2: ld returned 1 exit status
make[1]: *** [dmsetup.static] Error 1

Version-Release number of selected component (if applicable):
Upstream, all versions.

How reproducible:
on system with new gcc just

./configure --enable-static_link
make

The build system must be fixed, this blocks other applications which depends on static cryptsetup library. (Namely cryptsetup.)

Static builds are still widely used in various situations (like initramfs).

Comment 2 Milan Broz 2010-10-14 12:50:47 UTC
(In reply to comment #0)
> Static builds are still widely used in various situations (like initramfs).

Read: in other distros not Fedora.

Comment 3 Juergen Daubert 2010-12-07 10:37:58 UTC
It's a linker problem, introduced with binutils 2.20. Would be nice to get this fixed, thanks.

I've attached the patch I'm using currently, though it's not a final solution, because the used "-Wl,--no-export-dynamic" doesn't work with older linker.

Comment 4 Juergen Daubert 2010-12-07 10:40:39 UTC
Created attachment 465213 [details]
fix build with --enable-static

Comment 5 Zdenek Kabelac 2010-12-07 10:49:13 UTC
Ok - this can be checked during configure and added only when gcc supports this option.

Comment 6 Milan Broz 2010-12-09 11:58:00 UTC
Can we fix this please?

Comment 7 Milan Broz 2010-12-22 21:29:32 UTC
Also static build must use pkgconfig - hardcoded -ludev is not sufficient (it requires -lrt now also).

See
http://connie.slackware.com/~rworkman/lvm2-build_with_udev_165.patch

Comment 8 Milan Broz 2011-01-12 12:34:28 UTC
Another downstream fix
https://bugs.gentoo.org/show_bug.cgi?id=332905

Comment 9 Shlomi Fish 2011-12-02 20:18:27 UTC
I can reproduce this bug on Mageia Linux Cauldron:

https://bugs.mageia.org/show_bug.cgi?id=3583

Though I'm trying to statically link against -lc_p and -lm_p (the profiling libraries).

Any fix, workaround or insight would be appreciated.

Regards,

-- Shlomi Fish

Comment 11 Fedora End Of Life 2013-04-03 18:10:58 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

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

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

Comment 12 Peter Rajnoha 2014-02-17 09:31:04 UTC
*** Bug 785399 has been marked as a duplicate of this bug. ***

Comment 13 Jan Kurik 2015-07-15 15:18:33 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 14 Fedora End Of Life 2016-11-24 10:28:13 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 15 Fedora End Of Life 2016-12-20 12:03:22 UTC
Fedora 23 changed to end-of-life (EOL) status on 2016-12-20. Fedora 23 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.