Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 97795

Summary: ksh gcc 4 build failure
Product: Gentoo Linux Reporter: Harald van Dijk (RETIRED) <truedfx>
Component: Current packagesAssignee: Tavis Ormandy (RETIRED) <taviso>
Status: RESOLVED TEST-REQUEST    
Severity: normal CC: cretin, dave, halcy0n
Priority: High    
Version: 2005.0   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Bug Depends on:    
Bug Blocks: 117482    
Attachments: ksh gcc4 patch
gcc-4 fix

Description Harald van Dijk (RETIRED) gentoo-dev 2005-07-03 02:36:32 UTC
When I tried to install ksh-93.20050202, it complained that the ast library could not be found. (And because it insists on building with -k, the error message for the failure while building libast was not initially shown. Any chance of ripping that out?) It's the usual problem - static definition in .c, extern declaration in .h. And as usual, removing the declaration in the header file makes it compile. Will attach a patch.
Comment 1 Harald van Dijk (RETIRED) gentoo-dev 2005-07-03 02:37:16 UTC
Created attachment 62529 [details, diff]
ksh gcc4 patch
Comment 2 Mark Loeser (RETIRED) gentoo-dev 2006-04-19 16:43:34 UTC
Created attachment 84986 [details, diff]
gcc-4 fix

This was the fix that Fedora and Debian used.  I run into another build problem though.

+ /bin/cp /mnt/ftp/temp/portage/ksh-93.20050202/work/src/lib/libast/misc/magic.tab /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/lib/file/magic
/bin/sh: -c: line 4: syntax error near unexpected token `win32.*'
/bin/sh: -c: line 4: `win32.*)proto -p -s -l /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' /mnt/ftp/temp/portage/ksh-93.20050202/work/src/lib/libast/comp/fmtmsg.h > 1.$$.x'
mamake [lib/libast]: *** exit code 2 making /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast/fmtmsg.h
/bin/sh: -c: line 4: syntax error near unexpected token `win32.*'
/bin/sh: -c: line 4: `win32.*)proto -p -s -l /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' /mnt/ftp/temp/portage/ksh-93.20050202/work/src/lib/libast/comp/libgen.h > 1.$$.x'
mamake [lib/libast]: *** exit code 2 making /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast/libgen.h
/bin/sh: -c: line 4: syntax error near unexpected token `win32.*'
/bin/sh: -c: line 4: `win32.*)proto -p -s -l /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/lib/package/ast.lic '-o since=1985,author=gsf+dgk+kpv' /mnt/ftp/temp/portage/ksh-93.20050202/work/src/lib/libast/comp/syslog.h > 1.$$.x'
mamake [lib/libast]: *** exit code 2 making /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast/syslog.h
+ echo '#include <../prototyped.h>'
+ cmp -s /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast/prototyped.h 1.9175.x
+ mv 1.9175.x /mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast/prototyped.h
mamake: *** exit code 1 making lib/libast


Which causes this failure later:

+ cc -march=athlon-xp -O2 -pipe -ggdb -Wl,-O1 -Wl,--sort-common -s -o shcomp shcomp.o -lshell -ldll -ldl -last -lcmd -last -last -lm -ldl -last
/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lshell
collect2: ld returned 1 exit status
mamake [cmd/ksh93]: *** exit code 1 making shcomp
+ cc -march=athlon-xp -O2 -pipe -ggdb -I. -I/mnt/ftp/temp/portage/ksh-93.20050202/work/src/cmd/ksh93 -I/mnt/ftp/temp/portage/ksh-93.20050202/work/arch/linux.i386/include/ast -D_PACKAGE_ast -c /mnt/ftp/temp/portage/ksh-93.20050202/work/src/cmd/ksh93/sh/suid_exec.c
+ cc -march=athlon-xp -O2 -pipe -ggdb -Wl,-O1 -Wl,--sort-common -s -o suid_exec suid_exec.o -last
/usr/lib/gcc/i686-pc-linux-gnu/4.1.0/../../../../i686-pc-linux-gnu/bin/ld: cannot find -last


gcc-4.1 is going to be unmasked relatively soon, so it would be nice to get a fix for this.

Thanks
Comment 3 Harald van Dijk (RETIRED) gentoo-dev 2006-04-19 22:36:04 UTC
> This was the fix that Fedora and Debian used.

The original patch is what went in official ksh (and a version bump would now be possible to fix this too). I haven't yet checked if the syntax errors are fixed in that newer version too though.
Comment 4 Stefan Jones (RETIRED) gentoo-dev 2006-05-11 20:12:47 UTC
Hi,

I put a gcc4 patch from fedora into ksh-93.20060214-r1.ebuild.
It builds fine on a gcc-3.4.6, does it work now on gcc4?
Could you test, thanks :-)
Comment 5 Harald van Dijk (RETIRED) gentoo-dev 2006-05-11 23:21:26 UTC
Thanks, but could you remove it again, please? As noted earlier, this was already fixed in the latest version; the bug simply wasn't closed when that version was added.
Comment 6 Stefan Jones (RETIRED) gentoo-dev 2006-05-12 07:28:49 UTC
Drat, sorry. I see the fix went in.

Removed the patch.