On 09/22/2014 10:45 PM, Michael Eager wrote: > On 09/21/14 21:10, Chen Gang wrote: >> On 9/22/14 2:09, Michael Eager wrote: >>> >>> Generally, you should use "gcc" to link programs, not "ld". gcc is >>> a driver which will select the appropriate libraries and support routines >>> (such as crt0.o, which contains _start) and pass them to the linker. >>> >> >> OK, thanks. >> >> When gcc, it misses the root directory for "crt1.o" and "crtn.o": e.g. >> "/lib/ld.so.1", "crt1.o", "crtn.o" when gcc -v, but we need "/upstream/ >> release/lib/ld.so.1", "/upstream/lib/crt1.o", "/upstream/libcrtn.o". > > You likely need to build mb-gcc with --sysroot=/upstream. >
OK, thanks! I guess it will solve all issues which I met, and I shall try next. > How are you building gcc? What are your configuration options? > The related information is below, please help check when you have time, thanks. [root@localhost ~]# /upstream/release/bin/microblaze-gchen-linux-gcc -v Using built-in specs. COLLECT_GCC=/upstream/release/bin/microblaze-gchen-linux-gcc COLLECT_LTO_WRAPPER=/upstream/release/libexec/gcc/microblaze-gchen-linux/5.0.0/lto-wrapper Target: microblaze-gchen-linux Configured with: ../gcc/configure --target=microblaze-gchen-linux --disable-nls --enable-languages=c --disable-threads --disable-shared --without-headers --disable-libssp --disable-libquadmath --disable-libgomp --disable-libatomic --prefix=/upstream/release Thread model: single gcc version 5.0.0 20140920 (experimental) (GCC) [root@localhost ~]# Thanks. -- Chen Gang Open share and attitude like air water and life which God blessed