link problem solved!

acrux acrux_it at libero.it
Sun Jul 17 01:05:50 EST 2011


On Sat, 16 Jul 2011 00:32:50 +0400
Douglas Mencken <dougmencken at gmail.com> wrote:

> Finally, I found a workaround for "undefined reference to `getenv',
> `stdout', `printf', `fputs', ..." problem.
> 
> The solution is to link with libc too (it's not auto-linked in the
> case of static linking, unlike dyn-linking; and e2fsprogs static lib
> doesn't include all the libc stuff in it, even in .a ar, i.e. static
> lib).
> sed -i 's/LLIBS.*=.*-lext2fs/LLIBS = -lext2fs -lc/' ./Makefile
> 
> The next problem was symbol dupes, because yaboot implements some of
> them. But I discovered "-z muldefs: allow multiple symbol definitions;
> the first definition - in our case yaboot's one - will be used" option
> for ld.
> 
> sed -i 's/-Ttext $(TEXTADDR) -Bstatic -melf32ppclinux/-Ttext
> $(TEXTADDR) -Bstatic -melf32ppclinux -z muldefs/' ./Makefile
> 
> After these patch commands, yaboot builds and links successfully. It
> is tested and works well.
> 
> For these and even more patches, see also:
> http://ftp.osuosl.org/pub/manulix/scripts/build-scripts/PATCHCMDS/patchcmds-yaboot
> 

...but,
can you provide distro and toolchain?
I don't have these kind of problems on CRUX PPC 2.7.
Here my (full 32bit) build log if you are interested:
http://cruxppc.org/~acrux/yaboot.log


cheers,
-- 
acrux <acrux_it at libero.it>


More information about the Yaboot-devel mailing list