Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 527974 - sys-boot/yaboot-1.3.17-r2 - Missing stub functions from e2fsprogs libs
Summary: sys-boot/yaboot-1.3.17-r2 - Missing stub functions from e2fsprogs libs
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: PPC Linux
: Normal normal with 1 vote (vote)
Assignee: PPC Porters
URL:
Whiteboard:
Keywords:
: 531754 531756 544688 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-11-02 08:59 UTC by Agostino Sarubbo
Modified: 2015-05-17 07:48 UTC (History)
7 users (show)

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


Attachments
build.log (build.log,22.94 KB, text/plain)
2014-11-02 08:59 UTC, Agostino Sarubbo
Details
Updated stub function patch (yaboot-stubfuncs.patch,3.71 KB, patch)
2015-05-16 14:51 UTC, Joe Jezak (RETIRED)
Details | Diff
Updated the stub function patch again (yaboot-stubfuncs.patch,3.71 KB, patch)
2015-05-16 15:02 UTC, Joe Jezak (RETIRED)
Details | Diff
Fixed the stubfuncs patch (yaboot-stubfuncs.patch,3.71 KB, patch)
2015-05-16 15:07 UTC, Joe Jezak (RETIRED)
Details | Diff
Updated stub function patch (yaboot-stubfuncs.patch,3.71 KB, patch)
2015-05-16 18:19 UTC, Joe Jezak (RETIRED)
Details | Diff
Updated stub function patch (yaboot-stubfuncs.patch,4.20 KB, patch)
2015-05-16 18:20 UTC, Joe Jezak (RETIRED)
Details | Diff
Updated stub function patch (yaboot-stubfuncs.patch,4.20 KB, patch)
2015-05-16 18:22 UTC, Joe Jezak (RETIRED)
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Agostino Sarubbo gentoo-dev 2014-11-02 08:59:41 UTC
Created attachment 388308 [details]
build.log

This happens on timberdoodle main host.

Portage 2.2.8-r2 (default/linux/powerpc/ppc64/13.0/32bit-userland, gcc-4.8.3, glibc-2.19-r1, 3.12.20-gentoo ppc64)                             
=================================================================                                                                              
System uname: Linux-3.12.20-gentoo-ppc64-POWER7_-architected-with-gentoo-2.2                                                                   
KiB Mem:    16514732 total,   2575028 free                                                                                                     
KiB Swap:    7814548 total,   7805980 free                                                                                                     
Timestamp of tree: Sun, 02 Nov 2014 06:00:01 +0000                                                                                             
ld GNU ld (Gentoo 2.24 p1.4) 2.24                                                                                                              
app-shells/bash:          4.2_p53                                                                                                              
dev-lang/perl:            5.18.2-r2                                                                                                            
dev-lang/python:          2.7.7, 3.3.5-r1, 3.4.1                                                                                               
dev-util/cmake:           2.8.12.2-r1                                                                                                          
dev-util/pkgconfig:       0.28-r1                                                                                                              
sys-apps/baselayout:      2.2                                                                                                                  
sys-apps/openrc:          0.12.4                                                                                                               
sys-apps/sandbox:         2.6-r1                                                                                                               
sys-devel/autoconf:       2.69                                                                                                                 
sys-devel/automake:       1.13.4                                                                                                               
sys-devel/binutils:       2.24-r3                                                                                                              
sys-devel/gcc:            4.7.3-r1, 4.8.3                                                                                                      
sys-devel/gcc-config:     1.7.3                                                                                                                
sys-devel/libtool:        2.4.2-r1                                                                                                             
sys-devel/make:           3.82-r4                                                                                                              
sys-kernel/linux-headers: 3.13 (virtual/os-headers)
sys-libs/glibc:           2.19-r1
Repositories: gentoo
ACCEPT_KEYWORDS="ppc"
ACCEPT_LICENSE="* -@EULA"
CBUILD="powerpc-unknown-linux-gnu"
CFLAGS="-O2 -pipe"
CHOST="powerpc-unknown-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt /var/spool/munin-async/.ssh"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe"
DISTDIR="/usr/portage/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/ http://distfiles.gentoo.org"
LANG="it_IT.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j24"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY=""
SYNC="rsync://bobolink.gentoo.osuosl.org/gentoo-portage"
USE="acl berkdb bzip2 cli cracklib crypt cxx dri fortran gcc64 gdbm iconv ipv6 modules ncurses nptl openmp pam pcre ppc readline session ssl tcpd unicode zlib" ABI_PPC="32" ELIBC="glibc" KERNEL="linux" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7" USERLAND="GNU"
USE_PYTHON="2.7"
Comment 1 Patrick 2014-11-30 23:28:38 UTC
This occurred on a fresh install on a powerbook G4 for me.
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-05 17:31:36 UTC
*** Bug 531754 has been marked as a duplicate of this bug. ***
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-12-05 18:57:09 UTC
*** Bug 531756 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Haschka 2014-12-28 11:17:31 UTC
Actually this can be worked around by compiling and linking:

sys-fs/e2fsprogs 
sys-fs/e2fsprogs-libs
sys-boot/yaboot 

with:
CFLAGS="-fno-stack-protector"
LDFLAGS="-fno-stack-protector"

( as can be done using /usr/portage/env ... )

stack protection is the default in recent gcc and hence the bug. As yaboot is the only bootloader for this platform it should be disabled in these ebuilds by default i guess.
Comment 5 Agostino Sarubbo gentoo-dev 2014-12-28 14:23:05 UTC
(In reply to Thomas Haschka from comment #4)
> Actually this can be worked around by compiling and linking:
> 
> sys-fs/e2fsprogs 
> sys-fs/e2fsprogs-libs
> sys-boot/yaboot 
> 
> with:
> CFLAGS="-fno-stack-protector"
> LDFLAGS="-fno-stack-protector"
> 
> ( as can be done using /usr/portage/env ... )
> 
> stack protection is the default in recent gcc and hence the bug. As yaboot
> is the only bootloader for this platform it should be disabled in these
> ebuilds by default i guess.

It worked for me as a workaround, but I just don't need sys-fs/e2fsprogs-libs with -fno-stack-protector.
Comment 6 Agostino Sarubbo gentoo-dev 2014-12-28 14:25:04 UTC
Dear base-system,

to fix it we need sys-fs/e2fsprogs compiled without stack-protection. Apart make something like an IUSE nossp which compiles without stack-protection, do you have suggestions on how to handle it?
Comment 7 Thomas Haschka 2015-02-26 16:39:02 UTC
Maybe one should be just be pragmatic and just add the required cflags to the ebuilds. i.e. CFLAGS="{$CFLAGS} -fno-stack-protection" LDFLAGS... 

I don't see why this should hurt to much
Comment 8 Thomas Haschka 2015-02-26 16:44:11 UTC
-fno-stack-protector , my excuses
Comment 9 SpanKY gentoo-dev 2015-02-26 17:42:00 UTC
(In reply to Agostino Sarubbo from comment #6)

that won't really solve the problem, just push it down until the next failure.  if yaboot wants to use code compiled for Linux userland, then it should provide stubs for the pieces that code expects.  simply update yaboot to provide a __stack_chk_fail stub.
Comment 10 Thomas Haschka 2015-02-27 10:19:30 UTC
I'll see if i can file a bug upstream, I just think that a pragmatic solution should be found as yaboot is the "only" reasonable boot manager for newworld macs. In my opinion not being able to install a boot manager at the end of a successful gentoo install (without quirks), is probably a major bummer for any gentoo newcomer on PPC.
Comment 11 SpanKY gentoo-dev 2015-02-27 19:26:12 UTC
(In reply to Thomas Haschka from comment #10)

the pragmatic solution is to deploy my suggested stub into the yaboot package.  it's like one line of code in the right file.
Comment 12 Nils Holland 2015-03-27 15:20:35 UTC
I don't know if it's a good idea to add this here or if I should have opened a new bug instead, but when trying to install yaboot-1.3.17-r2 on a system that has sys-fs/e2fsprogs-1.42.12 and sys-libs/e2fsprogs-libs-1.42.12 (with -fno-stack-protector) installed, I get this:

gcc -Os  -fno-stack-protector  -Wall -I/usr/include -Wno-error -fdiagnostics-show-option -o util/addnote util/addnote.c
ld -Ttext 0x100000 -Bstatic -melf32ppclinux second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o second/iso_util.o lib/nonstd.o lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o second/md5.o second/fs_xfs.o second/fs_reiserfs.o -lext2fs `gcc -m32 -print-libgcc-file-name` -o second/yaboot
/usr/lib/libext2fs.a(unix_io.o): In function `raw_write_blk':
(.text+0x1a4): undefined reference to `pwrite64'
/usr/lib/libext2fs.a(unix_io.o): In function `raw_read_blk':
(.text+0x630): undefined reference to `pread64'
Makefile:112: recipe for target 'yaboot' failed
make: *** [yaboot] Error 1

Masking version 1.42.12 of the two e2fs packages and letting portage take version 1.42.11 instead works fine - yaboot will then build nicely.
Comment 13 SpanKY gentoo-dev 2015-03-27 16:43:42 UTC
(In reply to Nils Holland from comment #12)

file a new report please
Comment 14 Anthony Basile gentoo-dev 2015-03-27 21:11:28 UTC
(In reply to SpanKY from comment #9)
> (In reply to Agostino Sarubbo from comment #6)
> 
> that won't really solve the problem, just push it down until the next
> failure.  if yaboot wants to use code compiled for Linux userland, then it
> should provide stubs for the pieces that code expects.  simply update yaboot
> to provide a __stack_chk_fail stub.

i remember doing this long ago (when my g5 used to work ~2009) and it worked just fine.  i don't remember if i published it, but it was just a trivial function like

void __stack_chk_fail() {
}
Comment 15 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 14:51:17 UTC
Created attachment 403388 [details, diff]
Updated stub function patch

Here's an updated stub function patch that implements a stub for __stack_chk_fail and wraps pread64/pwrite64 to OF PROM functions. For testing, just copy this over the current stub function patch and re-build.

I got a "new" PB G4 to test this on, but it won't be ready to go for a little while, so a little help testing (beyond the compile testing I did) would be appreciated!
Comment 16 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 15:02:50 UTC
Created attachment 403390 [details, diff]
Updated the stub function patch again

Sorry, I forgot to include the malloc patch as well in the previous patch. This version should be okay!
Comment 17 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 15:07:30 UTC
Created attachment 403392 [details, diff]
Fixed the stubfuncs patch

Sorry, hopefully the last time. I had a malformed patch with the last submission.
Comment 18 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 15:27:50 UTC
*** Bug 544688 has been marked as a duplicate of this bug. ***
Comment 19 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 18:19:18 UTC
Created attachment 403416 [details, diff]
Updated stub function patch

Sorry, another change!
Comment 20 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 18:20:07 UTC
Created attachment 403418 [details, diff]
Updated stub function patch
Comment 21 Joe Jezak (RETIRED) gentoo-dev 2015-05-16 18:22:02 UTC
Created attachment 403420 [details, diff]
Updated stub function patch

Updated again for a typo.
Comment 22 Nuno Silva 2015-05-16 19:05:10 UTC
The patch works here for sys-boot/yaboot-1.3.17-r2 on ppc (PowerBook G4 867 MHz).
Comment 25 SpanKY gentoo-dev 2015-05-17 04:34:18 UTC
Comment on attachment 403420 [details, diff]
Updated stub function patch

the pwrite/pread stubs are wrong.  you have to handle the offset field.
Comment 26 SpanKY gentoo-dev 2015-05-17 05:02:06 UTC
should be all set now in the tree; thanks for the report!

Commit message: Add pread/pwrite stubs that newer ext2 libs use
http://sources.gentoo.org/sys-boot/yaboot/files/yaboot-stubfuncs.patch?r1=1.3&r2=1.4
http://sources.gentoo.org/sys-boot/yaboot/yaboot-1.3.17-r2.ebuild?r1=1.8&r2=1.9
Comment 27 Nuno Silva 2015-05-17 06:47:37 UTC
The fix in the tree does not compile.

powerpc-unknown-linux-gnu-ld -Ttext 0x100000 -Bstatic -melf32ppclinux second/crt0.o second/yaboot.o second/cache.o second/prom.o second/file.o second/partition.o second/fs.o second/cfg.o second/setjmp.o second/cmdline.o second/fs_of.o second/fs_ext2.o second/fs_iso.o second/fs_swap.o second/iso_util.o lib/nonstd.o lib/nosys.o lib/string.o lib/strtol.o lib/vsprintf.o lib/ctype.o lib/malloc.o lib/strstr.o lib/ssp.o second/md5.o second/fs_xfs.o second/fs_reiserfs.o -lext2fs `powerpc-unknown-linux-gnu-gcc -m32 -print-libgcc-file-name` -o second/yaboot
/usr/lib/libext2fs.a(unix_io.o): In function `unix_open':
(.text+0x1428): undefined reference to `fcntl'
Makefile:112: recipe for target 'yaboot' failed
make: *** [yaboot] Error 1
Comment 28 SpanKY gentoo-dev 2015-05-17 06:56:59 UTC
Commit message: Also stub out fcntl
http://sources.gentoo.org/sys-boot/yaboot/files/yaboot-stubfuncs.patch?r1=1.4&r2=1.5
Comment 29 Nuno Silva 2015-05-17 07:48:50 UTC
Thanks, now it compiles from the tree as well!