Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 445464 - freebsd-lib-9.1_rc3: Link to libraries built by itself and changes to LDADD+= from LDADD= automatically
Summary: freebsd-lib-9.1_rc3: Link to libraries built by itself and changes to LDADD+=...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: FreeBSD (show other bugs)
Hardware: All FreeBSD
: Normal enhancement (vote)
Assignee: Gentoo/BSD Team
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-01 11:38 UTC by Yuta SATOH
Modified: 2013-01-27 15:23 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
patch for freebsd-lib-9.1_rc3-r1.ebuild (445464.patch,897 bytes, patch)
2012-12-01 11:50 UTC, Yuta SATOH
Details | Diff
minimum patch for freebsd-lib-9.1_rc3 (sys-freebsd_freebsd-lib_freebsd-lib-9.1_rc3-r1.ebuild.patch,1.06 KB, patch)
2012-12-02 12:26 UTC, Yuta SATOH
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuta SATOH 2012-12-01 11:38:07 UTC
When I was updating the upgrade guide, I noticed that a failure to upgrade from 7.1.

1)
The error undefined reference to `__stack_chk_fail_local' is caused by LDADD="-lssp_nonshared" is not included in LDADD.
Includes LDADD= in some Makefile. will not apply LDADD that is set by ebuild.

2)
In addition, I think better to link to new library itself has created as much as possible.

I'll attach a sample patch.


Error messages or  Steps to reproduce
1)
i486-gentoo-freebsd7.1-gcc -fpic -DPIC  -O2 -pipe -fno-strict-aliasing -fno-strict-overflow -isystem /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/include_proper_default -B /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/i486-gentoo-freebsd7.1//var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/lib/csu/i386-elf  -I. -I/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/lib/libprocstat -D_KVM_VNODE -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -c /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/lib/libprocstat/udf.c -o udf.So
cat /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/lib/libprocstat/Symbol.map | cpp - -  | awk -v vfile=/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3-r1/work/lib/libprocstat/Versions.def -f /usr/share/mk/version_gen.awk > Version.map
building static procstat library
i486-gentoo-freebsd7.1-ranlib libprocstat.a
building shared library libprocstat.so.1
libprocstat.So: In function `procstat_get_socket_info_kvm':
libprocstat.c:(.text+0x3bf): undefined reference to `__stack_chk_fail_local'
libprocstat.So: In function `procstat_get_pts_info_kvm':
libprocstat.c:(.text+0x5e3): undefined reference to `__stack_chk_fail_local'
libprocstat.So: In function `procstat_get_vnode_info_kvm':
libprocstat.c:(.text+0xa11): undefined reference to `__stack_chk_fail_local'
libprocstat.So: In function `procstat_get_vnode_info_sysctl':
libprocstat.c:(.text+0xe0e): undefined reference to `__stack_chk_fail_local'
libprocstat.So: In function `.L189':
libprocstat.c:(.text+0x181e): undefined reference to `__stack_chk_fail_local'
libprocstat.So:libprocstat.c:(.text+0x19d7): more undefined references to `__stack_chk_fail_local' follow
collect2: ld returned 1 exit status
*** Error code 1
1 error
*** Error code 2
1 error
 * ERROR: sys-freebsd/freebsd-lib-9.1_rc3-r1 failed (compile phase):
 *   make failed


2)
1. equery f freebsd-lib | grep libkvm | xargs
/lib/libkvm.so.5 /usr/lib/libkvm.a /usr/lib/libkvm.so
2. rm /lib/libkvm.so.5 /usr/lib/libkvm.a /usr/lib/libkvm.so
3. ebuild freebsd-lib-9.1_rc3.ebuild compile
===> libdevstat (all)
x86_64-gentoo-freebsd9.1-gcc  -O2 -pipe -mtune=generic -fno-strict-aliasing -fno-strict-overflow  -I/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c -o devstat.o
x86_64-gentoo-freebsd9.1-gcc -fpic -DPIC  -O2 -pipe -mtune=generic -fno-strict-aliasing -fno-strict-overflow  -I/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat -std=gnu99 -fstack-protector -Wsystem-headers -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wno-uninitialized -Wno-pointer-sign -c /var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c -o devstat.So
/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c: In function 'devstat_getdevs':
/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c:329:6: warning: variable 'oldnumdevs' set but not used [-Wunused-but-set-variable]
/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c: In function 'devstat_getdevs':
/var/tmp/portage/sys-freebsd/freebsd-lib-9.1_rc3/work/lib/libdevstat/devstat.c:329:6: warning: variable 'oldnumdevs' set but not used [-Wunused-but-set-variable]
building shared library libdevstat.so.7
building static devstat library
/usr/lib/gcc/x86_64-gentoo-freebsd9.1/4.6.3/../../../../x86_64-gentoo-freebsd9.1/bin/ld: cannot find -lkvm
collect2: ld returned 1 exit status
*** [libdevstat.so.7] Error code 1
ranlib libdevstat.a
1 error
*** [all] Error code 2
1 error
Comment 1 Yuta SATOH 2012-12-01 11:50:42 UTC
Created attachment 331128 [details, diff]
patch for freebsd-lib-9.1_rc3-r1.ebuild
Comment 2 Yuta SATOH 2012-12-01 13:15:57 UTC
(In reply to comment #1)
> Created attachment 331128 [details, diff] [details, diff]
> patch for freebsd-lib-9.1_rc3-r1.ebuild

+		sed -i.bak -e 's:LDADD=:LDADD+=:g' "${file}" ||

It is my mistake.
Please add \ at the end of the line.
Comment 3 Yuta SATOH 2012-12-02 12:26:25 UTC
Created attachment 331192 [details, diff]
minimum patch for freebsd-lib-9.1_rc3

I found the steps to reproduce easily on Gentoo/FreeBSD 9.1 x86.

1. gsed -i 's: /usr/lib/libssp_nonshared.a::g' /usr/lib/libc.so
2. rm /usr/lib/libssp_nonshared.a
3. emerge freebsd-lib

If you want to change the minimum, please apply the patch I'll attach a new one.
I have confirmed that it has successfully compiled on Gentoo/FreeBSD 7.2.
Comment 4 Alexis Ballier gentoo-dev 2013-01-27 15:23:24 UTC
(In reply to comment #3)
> Created attachment 331192 [details, diff] [details, diff]
> minimum patch for freebsd-lib-9.1_rc3

applied, thanks!