http://redmine.audacious-media-player.org/http://redmine.audacious-media-player.org/welcome/favicon.ico?15159353402014-12-15T23:37:35ZRedmineAudacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18512014-12-15T23:37:35ZJohn Lindgrenjohn@jlindgren.net
<ul></ul><p>An undefined reference in libc doesn't seem like a bug in Audacious. Do you have any reason for supposing it to be one, or a proposed fix?</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18522014-12-16T11:25:49ZMichael Schwendt
<ul></ul><p>The error.txt is truncated. What are the preceeding lines that show how the compiler was invoked?</p>
<p>-fstack-protector-strong is also used by Fedora builds, and the build of 3.6-alpha1 succeeds for i686.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18532014-12-16T19:13:35ZThomas Langethomas-lange2@gmx.de
<ul><li><strong>File</strong> <a href="/attachments/434/makepkg.log">makepkg.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/434/makepkg.log">makepkg.log</a> added</li></ul><p>@Michael:<br />The compiler was invoked by the tool "makepkg" of Arch Linux, its complete log file is attached.</p>
<p>The flags are the defaults for Arch Linux:<br /><pre>
CPPFLAGS="-D_FORTIFY_SOURCE=2"
CFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
CXXFLAGS="-march=i686 -mtune=generic -O2 -pipe -fstack-protector-strong --param=ssp-buffer-size=4"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro"
</pre></p>
<p>@John:<br />If "-lc" is added to LDFLAGS it links successfully.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18542014-12-16T19:40:03ZJohn Lindgrenjohn@jlindgren.net
<ul></ul><p>Thomas Lange wrote:</p>
<blockquote>
<p>If "-lc" is added to LDFLAGS it links successfully.</p>
</blockquote>
<p>"-lc" shouldn't be necessary since we use "g++" for the link command. It should link in the C and C++ runtime libraries automatically, I would think.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18552014-12-17T00:17:17ZMichael Schwendt
<ul></ul><p>The default build output is "silent". When the configure script doesn't handle --disable-silent-rules option, something like<br /><code><br />sed -i '\,^.SILENT:,d' buildsys.mk.in<br /></code><br />to get verbose build output. Only in verbose build output one gets to see compiler/linker warnings which may be relevant.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18562014-12-17T00:47:01ZThomas Langethomas-lange2@gmx.de
<ul><li><strong>File</strong> <a href="/attachments/435/verbose.log">verbose.log</a> <a class="icon-only icon-download" title="Download" href="/attachments/download/435/verbose.log">verbose.log</a> added</li></ul><p>Thanks, new verbose output file is attached.</p>
<p>glibc on Arch is compiled without fstack-protector-strong.<br /><a class="external" href="https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/glibc#n59">https://projects.archlinux.org/svntogit/packages.git/tree/trunk/PKGBUILD?h=packages/glibc#n59</a><br />Could this be related? How does Fedora compile it?</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18572014-12-17T01:45:03ZJohn Lindgrenjohn@jlindgren.net
<ul></ul><p>Maybe -fstack-protector-strong needs to be in LDFLAGS as well as CFLAGS?</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18582014-12-17T11:51:02ZMichael Schwendt
<ul></ul><p>It doesn't need to be present in LDFLAGS.</p>
<pre>
$ objdump -tT /usr/lib64/libc.so.6 |grep stack_chk
0000000000000000 l df *ABS* 0000000000000000 stack_chk_fail.c
00000000001122c0 g F .text 0000000000000010 __stack_chk_fail
00000000001122c0 g DF .text 0000000000000010 GLIBC_2.4 __stack_chk_fail
</pre>
<blockquote>
<p>How does Fedora compile it?</p>
</blockquote>
<p>glibc build logs: <a class="external" href="http://koji.fedoraproject.org/koji/buildinfo?buildID=581316">http://koji.fedoraproject.org/koji/buildinfo?buildID=581316</a></p>
<p>Audacious 3.6-alpha1 i686 build log for a private Fedora 21 build:<br /><a class="external" href="https://copr-be.cloud.fedoraproject.org/results/mschwendt/audacious-next/fedora-21-i386/audacious-plugins-3.6-0.3.alpha1.fc21/build.log">https://copr-be.cloud.fedoraproject.org/results/mschwendt/audacious-next/fedora-21-i386/audacious-plugins-3.6-0.3.alpha1.fc21/build.log</a></p>
<pre>
$ rpm -E %configure
CFLAGS="${CFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" ; export CFLAGS ;
CXXFLAGS="${CXXFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic}" ; export CXXFLAGS ;
FFLAGS="${FFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FFLAGS ;
FCFLAGS="${FCFLAGS:--O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -I/usr/lib64/gfortran/modules}" ; export FCFLAGS ;
LDFLAGS="${LDFLAGS:--Wl,-z,relro }"; export LDFLAGS;
[ "1" = 1 ] && for i in $(find . -name config.guess -o -name config.sub) ; do
[ -f /usr/lib/rpm/redhat/$(basename $i) ] && /usr/bin/rm -f $i && /usr/bin/cp -fv /usr/lib/rpm/redhat/$(basename $i) $i ;
done ;
[ "1" = 1 ] && [ x != "x" ] &&
for i in $(find . -name ltmain.sh) ; do
/usr/bin/sed -i.backup -e 's~compiler_flags=$~compiler_flags=""~' $i
done ;
./configure --build=x86_64-redhat-linux-gnu --host=x86_64-redhat-linux-gnu \
--program-prefix= \
--disable-dependency-tracking \
--prefix=/usr \
--exec-prefix=/usr \
--bindir=/usr/bin \
--sbindir=/usr/sbin \
--sysconfdir=/etc \
--datadir=/usr/share \
--includedir=/usr/include \
--libdir=/usr/lib64 \
--libexecdir=/usr/libexec \
--localstatedir=/var \
--sharedstatedir=/var/lib \
--mandir=/usr/share/man \
--infodir=/usr/share/info
</pre> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18592014-12-17T17:45:24ZJohn Lindgrenjohn@jlindgren.net
<ul></ul><p>So can we say:<br />1. Compiling with -fstack-protector-strong works fine on Fedora, so there's something different about the Arch Linux makepkg environment that is (directly or indirectly) causing the problem.<br />2. A workaround for makepkg is to link with "-lc", but this is only a workaround, not a proper fix, since libc ought to be linked in automatically.</p>
<p>... and close this report?</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18602014-12-18T12:06:28ZMichael Schwendt
<ul></ul><p>1. Agreed. It seems the toolchain is broken with Arch Linux.<br />2. True. It's g++'s responsibility to link with the C/C++/GCC/Math libs as needed, not Audacious'.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18612014-12-18T20:21:33ZThomas Langethomas-lange2@gmx.de
<ul><li><strong>Status</strong> changed from <i>New</i> to <i>Closed</i></li></ul><p>All right, marking as closed.</p> Audacious - Bug #492: Linking fails on i686 with -fstack-protector-stronghttp://redmine.audacious-media-player.org/issues/492?journal_id=18722014-12-28T17:08:33ZThomas Langethomas-lange2@gmx.de
<ul></ul><p>The issue was solved by the lastest updates.<br />binutils 2.25 and GCC 4.9.2 20141224 now link successfully.</p>