[opensuse-packaging] Stack protector isues?
What causes this package to fail for 32-bit but build for 64-bit in Factory? https://build.opensuse.org/package/show/KDE:KDE3/kdelibs3 I receive the following error message: [ 666s] /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local': [ 666s] /home/abuild/rpmbuild/BUILD/glibc-2.18.90/debug/stack_chk_fail_local.c:45: undefined reference to `__stack_chk_fail' [ 666s] collect2: error: ld returned 1 exit status [ 666s] Error creating ./kdeprint/management/libkdeinit_kaddprinterwizard.la. Exit status 1. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sunday 2013-12-29 03:24, Ilya Chernykh wrote:
What causes this package to fail for 32-bit but build for 64-bit in Factory?
https://build.opensuse.org/package/show/KDE:KDE3/kdelibs3
I receive the following error message:
[ 666s] /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local': [ 666s] /home/abuild/rpmbuild/BUILD/glibc-2.18.90/debug/stack_chk_fail_local.c:45: undefined reference to `__stack_chk_fail' [ 666s] collect2: error: ld returned 1 exit status [ 666s] Error creating ./kdeprint/management/libkdeinit_kaddprinterwizard.la. Exit status 1.
__stack_chk_fail is only present in libc.a, but not libc_nonshared.a. -rw-r--r-- 1 root root 23502316 Dec 10 13:09 libc.a -rw-r--r-- 1 root root 72190 Dec 10 13:14 libc_nonshared.a Given the huge size difference would indicate to me that whenever you attempt to link in libc_nonshared.a (why would you do that on your own?), you must also link in libc.a — and do so in the proper order, which kdeprint might fail to do. (And it also raises the question why you are even building statically.) -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Sun, 29 Dec 2013, Jan Engelhardt wrote:
On Sunday 2013-12-29 03:24, Ilya Chernykh wrote:
What causes this package to fail for 32-bit but build for 64-bit in Factory?
https://build.opensuse.org/package/show/KDE:KDE3/kdelibs3
I receive the following error message:
[ 666s] /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local': [ 666s] /home/abuild/rpmbuild/BUILD/glibc-2.18.90/debug/stack_chk_fail_local.c:45: undefined reference to `__stack_chk_fail' [ 666s] collect2: error: ld returned 1 exit status [ 666s] Error creating ./kdeprint/management/libkdeinit_kaddprinterwizard.la. Exit status 1.
__stack_chk_fail is only present in libc.a, but not libc_nonshared.a.
-rw-r--r-- 1 root root 23502316 Dec 10 13:09 libc.a -rw-r--r-- 1 root root 72190 Dec 10 13:14 libc_nonshared.a
Given the huge size difference would indicate to me that whenever you attempt to link in libc_nonshared.a (why would you do that on your own?), you must also link in libc.a — and do so in the proper order, which kdeprint might fail to do.
(And it also raises the question why you are even building statically.)
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script: /* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) ) Richard.
Richard Biener <rguenther@suse.de> writes:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, 7 Jan 2014, Andreas Schwab wrote:
Richard Biener <rguenther@suse.de> writes:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
That means a workaround is to change the order of libc.so.6 and libc_nonshared.a in this group ... Note it also means your testcase doesn't need libc.so which is usually unlikely ;) Note that int main () {} rguenther@murzim:~> gcc t.c -fstack-protector-all works for me on 13.1. Richard. -- Richard Biener <rguenther@suse.de> SUSE / SUSE Labs SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Richard Biener <rguenther@suse.de> writes:
Note that
int main () {}
rguenther@murzim:~> gcc t.c -fstack-protector-all
Your testcase does not reference __stack_chk_fail_local. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tue, 7 Jan 2014, Andreas Schwab wrote:
Richard Biener <rguenther@suse.de> writes:
Note that
int main () {}
rguenther@murzim:~> gcc t.c -fstack-protector-all
Your testcase does not reference __stack_chk_fail_local.
It does when compiling with -m32 -fpie -fstack-protector-all. And it still links for me in that case. Richard. -- Richard Biener <rguenther@suse.de> SUSE / SUSE Labs SUSE LINUX Products GmbH - Nuernberg - AG Nuernberg - HRB 16746 GF: Jeff Hawn, Jennifer Guild, Felix Imend"orffer -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tuesday 07 January 2014 14:51:24 Andreas Schwab wrote:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
I doi not see --as-needed in the affected package from Factory. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Am 08.01.2014 01:09, schrieb Ilya Chernykh:
On Tuesday 07 January 2014 14:51:24 Andreas Schwab wrote:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
I doi not see --as-needed in the affected package from Factory.
It's default unless you set SUSE_ASNEEDED=0 Greetings, Stephan -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wednesday 08 January 2014 10:10:38 Stephan Kulow wrote:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
I doi not see --as-needed in the affected package from Factory.
It's default unless you set SUSE_ASNEEDED=0
I tried to add the -lc to the linker flags but it did not help :-( -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Wednesday 08 January 2014 10:10:38 Stephan Kulow wrote:
Am 08.01.2014 01:09, schrieb Ilya Chernykh:
On Tuesday 07 January 2014 14:51:24 Andreas Schwab wrote:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
I doi not see --as-needed in the affected package from Factory.
It's default unless you set SUSE_ASNEEDED=0
I did export SUSE_ASNEEDED=0 but still the option -Wl,--as-needed remains in the linker's command line -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
On Tuesday 07 January 2014 14:51:24 Andreas Schwab wrote:
The symbol is part of libc.so as well, given the name libc_nonshared.a is always linked statically - libc.so is a linker script:
/* GNU ld script Use the shared library, but some functions are only in the static library, so try that secondarily. */ OUTPUT_FORMAT(elf64-x86-64) GROUP ( /lib64/libc.so.6 /usr/lib64/libc_nonshared.a AS_NEEDED ( /lib64/ld-linux-x86-64.so.2 ) )
I think this is a bug in the linker in the logic for --as-needed in connection with GROUP. Apparently the linker does not go back and search libc.so.6 again for the undefined symbol __stack_chk_fail referenced by libc_nonshared.a. If I either remote --as-needed or add -lc a second time the link succeeds.
Adding -lc both to the beginning andf to the end of the linker line does not help. -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
Ilya Chernykh <anixxsus@gmail.com> writes:
[ 666s] /usr/lib/libc_nonshared.a(stack_chk_fail_local.oS): In function `__stack_chk_fail_local': [ 666s] /home/abuild/rpmbuild/BUILD/glibc-2.18.90/debug/stack_chk_fail_local.c:45: undefined reference to `__stack_chk_fail' [ 666s] collect2: error: ld returned 1 exit status [ 666s] Error creating ./kdeprint/management/libkdeinit_kaddprinterwizard.la. Exit status 1.
Looks like a bug in glibc. I'll take a look once I have managed to work through the backlog. Andreas. -- Andreas Schwab, SUSE Labs, schwab@suse.de GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7 "And now for something completely different." -- To unsubscribe, e-mail: opensuse-packaging+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse-packaging+owner@opensuse.org
participants (5)
-
Andreas Schwab
-
Ilya Chernykh
-
Jan Engelhardt
-
Richard Biener
-
Stephan Kulow