[Bug 621880] New: glibc: Support -lpthread static linking by building pthread.a with "ld -r"
http://bugzilla.novell.com/show_bug.cgi?id=621880 http://bugzilla.novell.com/show_bug.cgi?id=621880#c0 Summary: glibc: Support -lpthread static linking by building pthread.a with "ld -r" Classification: openSUSE Product: openSUSE 11.3 Version: Final Platform: Other OS/Version: Other Status: NEW Severity: Enhancement Priority: P5 - None Component: Basesystem AssignedTo: bnc-team-screening@forge.provo.novell.com ReportedBy: burnus@gmx.de QAContact: qa@suse.de Found By: --- Blocker: --- User-Agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.6) Gecko/20100625 Firefox/3.6.6 Currently, on can get all kind of segfaults, if one simply links a program statically with the POSIX thread library, e.g. via $(COMPILER) -static $(SOURCEFILES) -fopenmp one way is to link via $(COMPILER) -static $(SOURCEFILES) -lgomp -Wl,--whole-archive -lpthread -Wl,--no-whole-archive -lrt However, one can do the same as Red Hat does: * Wed Feb 18 2009 Jakub Jelinek <jakub@redhat.com> 2.9.90-7 [...] - ld -r the whole libpthread.a together to avoid endless issues with -static ... -lpthread Red Hat's patch can be found at: http://cvs.fedoraproject.org/viewvc/rpms/glibc/F-13/glibc.spec?r1=1.380&r2=1.376 But unless I misread the .spec, Jakub just added after the normal build a: pushd $RPM_BUILD_ROOT/usr/%{_lib}/ $GCC -Wl,-r -nostdlib -o libpthread.o -Wl,--whole-archive ./libpthread.a rm libpthread.a ar rcs libpthread.a libpthread.o rm libpthread.o popd Example for static pthread related bugreports in GCC: http://tinyurl.com/35wctls Reproducible: Always -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
http://bugzilla.novell.com/show_bug.cgi?id=621880 http://bugzilla.novell.com/show_bug.cgi?id=621880#c yang xiaoyu <xyyang@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |xyyang@novell.com AssignedTo|bnc-team-screening@forge.pr |pbaudis@novell.com |ovo.novell.com | -- Configure bugmail: http://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=621880 https://bugzilla.novell.com/show_bug.cgi?id=621880#c zj jia <zjjia@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |zjjia@novell.com AssignedTo|bnc-team-screening@forge.pr |matz@novell.com |ovo.novell.com | -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=621880 https://bugzilla.novell.com/show_bug.cgi?id=621880#c2 --- Comment #2 from Tobias Burnus <burnus@gmx.de> 2011-06-16 05:44:01 UTC --- For GCC's -fopenmp that seems to be solved in the mean time by a .spec file such as /usr/lib64/gcc/x86_64-suse-linux/4.5/libgomp.spec: # This spec file is read by gcc when linking. It is used to specify the # standard libraries we need in order to link with -fopenmp. *link_gomp: -lgomp %{static: -lrt } -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
https://bugzilla.novell.com/show_bug.cgi?id=621880 https://bugzilla.novell.com/show_bug.cgi?id=621880#c3 Michael Matz <matz@novell.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Priority|P5 - None |P4 - Low Status|NEW |ASSIGNED --- Comment #3 from Michael Matz <matz@novell.com> 2011-06-16 11:41:16 UTC --- Hmm, that ld -r thing is an interesting idea. A terrible hack, but interesting :) -- Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@novell.com