link problem solved!

Douglas Mencken dougmencken at gmail.com
Sat Jul 16 06:32:50 EST 2011


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

-- doug


More information about the Yaboot-devel mailing list