Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 7 Mar 2002 00:51:21 -0500 (EST)
From:      <joeo@cracktown.com>
To:        <sparc@FreeBSD.ORG>
Subject:   Re: hosted toolchain!
Message-ID:  <Pine.LNX.4.30.0203070040580.12867-100000@asmodean-ssn.nks.net>
In-Reply-To: <20020226203332.A67463@dragon.nuxi.com>

next in thread | previous in thread | raw e-mail | index | archive | help
I went ahead and installed this on the recent dist image that went onto
the recent bootable iso image.

I'm guessing some additional stuff is missing from the bindist...

%gcc -o hello hello.c
/usr/gcc/lib/gcc-lib/sparc64-unknown-elf/3.1/../../../../sparc64-unknown-elf/bin/ld:
cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status
%

Additionally it doesn't seem willing to pass the "static" flag to ld;

%gcc hello.c -o hello -static
%./hello
%gcc -o hello hello.c -static
/usr/gcc/lib/gcc-lib/sparc64-unknown-elf/3.1/../../../../sparc64-unknown-elf/bin/ld:
cannot open crt0.o: No such file or directory
collect2: ld returned 1 exit status
%

finally...

%gcc hello.c -o hello.o -c
%ld -Bstatic hello.o -o hello
ld: warning: cannot find entry symbol _start; defaulting to
00000000001000b0
hello.o: In function `main':
hello.o(.text+0x10): undefined reference to `printf'

%ld -Bstatic hello.o -o hello -lc
ld: warning: cannot find entry symbol _start; defaulting to
00000000001000b0
/usr/lib/libc.a(malloc.o)(.text+0x88): undefined reference to `__progname'
/usr/lib/libc.a(malloc.o)(.text+0x8c): undefined reference to `__progname'
/usr/lib/libc.a(malloc.o)(.text+0xd4): undefined reference to `__progname'
/usr/lib/libc.a(malloc.o)(.text+0xd8): undefined reference to `__progname'
/usr/lib/libc.a(getenv.o): In function `getenv':
getenv.o(.text+0xc): undefined reference to `environ'
getenv.o(.text+0x10): undefined reference to `environ'
getenv.o(.text+0x24): undefined reference to `environ'
getenv.o(.text+0x28): undefined reference to `environ'
getenv.o(.text+0x54): undefined reference to `environ'
/usr/lib/libc.a(getenv.o)(.text+0x58): more undefined references to
`environ' follow


%ld -Bstatic /usr/lib/crt1.o hello.o -o hello -lc
%./hello
hello
%


Very cool that it generates working code though...



On Tue, 26 Feb 2002, David O'Brien wrote:

> I have posted a working hosted[*] toolchain.
> I and tmm are able to boot kernels built with it.  Pick it up as
> http://people.freebsd.org/~obrien/sparc64/native-uberbaum_20020224.tar.bz2
> , untar it in / .
>
> If you want to give this a spin, `doperl5.sh' (run on x86 or Alpha box),
> `kern.mk.diff' and `nawk.bz2' may be helpful.  All these are also at
> http://people.freebsd.org/~obrien/sparc64/.
>
>
> [*] I am using "hosted" to mean runs on sparc64, and produces sparc64
> binaries.  I am purposefully not using the term "native" as I think that
> implies built from /usr/src.
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-sparc" in the body of the message
>


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-sparc" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.30.0203070040580.12867-100000>