This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: crt0.o is missing with --target=i686-pc-linux-gnu


Thanks for reply very much. with "--target=i586-linux-elf --prefix=",
it generates "cygmon-crt0.o and "cygmon.ld". But I can't use the cross
tool chain to build any program.
The run command I use is according to the newlib/README.(line 506).

/opt/newlib-0504/bin/i586-linux-elf-gcc -nostdlib -static
/opt/newlib-0504/i586-linux-elf/lib/cygmon-crt0.o  hello.c -L
/opt/newlib-0504/lib -lc -lm
/opt/newlib-0504/lib/gcc/i586-linux-elf/4.8.4/../../../../i586-linux-elf/bin/ld:
warning: cannot find entry symbol _start; defaulting to
0000000008048080
/opt/newlib-0504/i586-linux-elf/lib/cygmon-crt0.o: In function `__start':
../../../../newlib-2.2.0.20150323/libgloss/i386/cygmon-crt0.S:37:
undefined reference to `__stack'
../../../../newlib-2.2.0.20150323/libgloss/i386/cygmon-crt0.S:45:
undefined reference to `__bss_end'
../../../../newlib-2.2.0.20150323/libgloss/i386/cygmon-crt0.S:52:
undefined reference to `__install_signal_handler'

what is the correct way to create a static binary linked against newlib.

Best Regards
junfeng

On Mon, May 4, 2015 at 8:02 PM, Mike Frysinger <vapier@gentoo.org> wrote:
> On 04 May 2015 18:06, Junfeng Dong wrote:
>> I build newlib with "--target=i686-pc-linux-gnu --prefix=", no ctr0.o
>> is compiled and installed. what is the problem?
>> My build machine is 64 bit ubuntu 14.04.
>
> your tuple is invalid.  "xxx-linux-gnu" means "the OS is Linux" and "the
> userland is GNU (i.e. glibc)".  you need to use something like i686-elf.
> -mike


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]