This is the mail archive of the crossgcc@sourceware.cygnus.com mailing list for the crossgcc project.
See the CrossGCC FAQ for lots more infromation.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Charles-Antoine Gauthier wrote: > > Takaya Ono wrote: > > > > Thank you very much for your thoughtful response. I will try to find the crt0.o and > > try it again. > > > > The reason for building a m68k-elf as a cross-ompiler is because I have m68k > > simulator on my Linux and I want to write c++ apps to run on the simulator. > > Eventually, I would like to run vxworks on the simulator, too. > > If you have a bare environment, you may get some help/insight by looking > into newlib/libgloss. This library supplies some of the missing bits for > bare environments. There is a newlib/libgloss/m68k/crt0.S file that you > can use as a good starting point. You should be able to run a > single-threaded C program in that environment, and most likely a C++ > one. You may need to understand a number of issues about how the C++ > environment is set up before it all works, but I took a very brief look > at crt0.S and its looks ok. Hopefully, your linking script will do the > right thing... > > Sorry I didn't think of it earlier. I got confused between libgloss and > libiberty when I went looking for a crt0 file and missed pointing you to > libgloss. > > > > > I will try to use the one tree approach, too. > > > > But, I think that ultimately, I will need libc that is in newlib and I need > > m68-elf-gcc to build the libc........ Do you think getting pre-compiled > > m68k-elf-gcc to compile newlib (libc) and using it will work? > > > > I don't think that you can succesfully build the compiler without newlib > being there. You must use --with-newlib when you configure, and you > should have a symbolic link to newlib/newlib in egcs. That way, when you > configure and build egcs in a separate build tree, newlib headers should > be used and newlib will be built along with the compiler. If I remember > correctly, libgcc needs a few C library functions, so you need access to > the C header files at build time. --with-newlib and the symlink causes > the additions of -I directives into the right places in your build tree > to be added during the build. In this configuration, you should get > libio and libstc++ built at the same time. Do not configure for C alone > and then try to make a C++ compiler; it won't work. You must build the C > and C++ compilers together, otherwise libgcc will be missing lots of > functions needed to support C++. > > If you want multithreading, you need to configure for that too with > --enable-threads=<thread_type>. Look in the configure file for the list > of supported thread packages. Multithreading support must be compiled > into libgcc to get thread-safe exception handling. Multithreading > requires that you get an OS, or roll your own. > > If you get into trouble, I highly recommend that you get a recent > snapshot of gcc. I know that 2000-02-14 and 2000-03-13 built for me for > the m68k. You do not need to use it, but look at the m68k-rtems target > in the config files to get an idea of how the configuration system is > put together. > > I have no experience with VxWorks. If you want to run VxWorks on the > simulator, you will need access to the headers, libraries and crt0.o for > VxWorks/gcc. There is the question of supplying a suitable BSP for use > on the simulator. Again, libgloss may contain some good ideas. > > P.S. We found ddd in combination with gdb to be a good source-level > debugger. gdb must be built for the m68k-elf target. ddd is the same > regarless of the target. ddd is available as an RPM for RH. > > > Again, thank you very much for your advice. I guess I will try harder. > > > > Best regards > > Takaya Ono > > > > Charles-Antoine Gauthier wrote: > > > > > The first problem is that you do not have any runtime libraries to link > > > against. You at least need a crt0.o file to satisfy the linker (ld is > > > the problem: it cannot create an executable). You are responsible for > > > providing crt0.o yourself. > > > > > > The more interesting question is why would you build m68k-elf as a > > > cross-compiler? What is the target OS? I ask because if you look at > > > m68k-rtemself (you need a recent snapshot of gcc to see this target), > > > you will see that it uses newlib as its C library, and that newlib > > > provides a dummy implementation of crt0.o to satisfy the stupid > > > configure test later on in the build process (this is a known > > > chicken-and-egg problem with autoconf/automake and cross-building, and > > > is addresses in most recent Makefile.am files. My recent builds of gcc > > > for m68k-rtemself no longer check to see if the compiler can build > > > executables). You must also provide the necessary header files. RTEMS > > > provides the ones needed during the build of gcc/newlib in newlib. You > > > MUST build gcc and newlib using the one-tree approach because the build > > > of gcc needs some of the files in the newlib source tree. > > > > > > I have no experience with m68k-vxworks. Presumably, it also builds using > > > a similar approach, but with the VxWorks header and library files in the > > > right magic places. > > > > > > Note that the first configure only creates some of the files that you > > > need. make will invoke configure again in subdirectories. Success at the > > > top level is no guarantee of success later on... > > > > > > Your second problem also looks like a configuration problem. > > > > > > I have no experience building the compiler for a standalone environment. > > > But I can tell you that libgcc.a does require some underlying > > > functionality from the runtime environment, and that you must provide > > > the right header files at build time. Which functionality is required > > > depends in part on the configuration parameters. > > > > > > Good luck. > > > > > > tono wrote: > > > > > > > > I have been trying to bulild cross compiler for target m68k-elf on my > > > > RedHat Linux (i686). I was able to build and install binutils. > > > > > > > > And, then I configured gcc-2.95.2 with the following command > > > > > > > > ../gcc-2.95.2/configure --target=$target --prefix=$prefix > > > > --with-headers=../../usr/include -v > > > > > > > > This seem to work. Then I started make with this command > > > > > > > > make all > > > > > > > > after a while I get this error while it is checking to see my C compiler > > > > works or not. > > > > > > > > checking how to run the C preprocessor... /root/build-gcc/gcc/xgcc > > > > -B/root/build-gcc/gcc/ -B/cross/m68k-elf/bin/ -E > > > > checking for sys/file.h... yes > > > > checking for sys/param.h... yes > > > > checking for stdlib.h... yes > > > > checking for string.h... yes > > > > checking for unistd.h... yes > > > > checking for strings.h... yes > > > > checking for sys/time.h... yes > > > > checking for sys/resource.h... yes > > > > checking for sys/wait.h that is POSIX.1 compatible... yes > > > > checking whether the C compiler (/root/build-gcc/gcc/xgcc > > > > -B/root/build-gcc/gcc/ -B/cross/m68k-elf/bin/ -g -O2 ) works... no > > > > configure: error: installation or configuration problem: C compiler > > > > cannot create executables. > > > > > > > > then, it fails as follows... > > > > > > > > make[1]: Entering directory `/root/build-gcc/m68k-elf/libio' > > > > test x"no" != xyes ||\ > > > > /root/build-gcc/gcc/xgcc -B/root/build-gcc/gcc/ -B/cross/m68k-elf/bin/ > > > > -c -g -O2 -I. -I../../../gcc-2.95.2/libio > > > > ../../../gcc-2.95.2/libio/filedoalloc.c -o pic/filedoalloc.o > > > > /root/build-gcc/gcc/xgcc -B/root/build-gcc/gcc/ -B/cross/m68k-elf/bin/ > > > > -c -g -O2 -I. -I../../../gcc-2.95.2/libio > > > > ../../../gcc-2.95.2/libio/filedoalloc.c > > > > In file included from ../../../gcc-2.95.2/libio/libio.h:30, > > > > from ../../../gcc-2.95.2/libio/iolibio.h:1, > > > > from ../../../gcc-2.95.2/libio/libioP.h:47, > > > > from ../../../gcc-2.95.2/libio/filedoalloc.c:45: > > > > _G_config.h:43: parse error before `_G_sigset_t' > > > > _G_config.h:43: warning: data definition has no type or storage class > > > > make[1]: *** [filedoalloc.o] Error 1 > > > > make[1]: Leaving directory `/root/build-gcc/m68k-elf/libio' > > > > make: *** [all-target-libio] Error 2 > > > > > > > > I've been trying for 3 nights trying to make the cross compiler, but > > > > every time I get > > > > > > > > checking whether the C compiler (/root/build-gcc/gcc/xgcc > > > > -B/root/build-gcc/gcc/ -B/cross/m68k-elf/bin/ -g -O2 ) works... no > > > > configure: error: installation or configuration problem: C compiler > > > > cannot create executables. > > > > > > > > I do not know why, since I already configured and it was > > > > successful....... But there seems to be 2 problems, one for xgcc and > > > > another for making filedoalloc.o...... > > > > Please help me out if you have encountered this kind of error before. > > > > I thank you very much for your attention and your time reading this > > > > message. > > > > > > > > Best regards > > > > Takaya Ono > > > > > > > > ------ > > > > Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ > > > > Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com > > > > > > -- > > > Charles-Antoine Gauthier > > > Institute for Information Technology Institut de technologie de > > > l'information > > > National Research Council of Canada Conseil national de recherches du > > > Canada > > -- > Charles-Antoine Gauthier > Institute for Information Technology Institut de technologie de > l'information > National Research Council of Canada Conseil national de recherches du > Canada -- Charles-Antoine Gauthier Institute for Information Technology Institut de technologie de l'information National Research Council of Canada Conseil national de recherches du Canada ------ Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/ Want to unsubscribe? Send a note to crossgcc-unsubscribe@sourceware.cygnus.com
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |