Overview
- GCC 4.3 will be the first release where libgcc is not built from inside the GCC subdirectory. Instead, it is built from the libgcc subdirectory. The libgcc build system lives in this directory; but most of the source files and machine-specific configuration still come from gcc. Here's how you can help improve that. What's the point? Well, when libgcc no longer requires configuration data recorded during the gcc build process, it will be possible to build it separately from gcc. That's convenient especially during system bringup.
Migrating Startfiles
- The first step in fixing this problem is to migrate configuration information to the libgcc directory, one target or small group of targets at a time. This focuses on which startfiles (crtbegin.o, et cetera) will be built and how they will be built. Some targets have already been migrated. Configuration information comes from two places: gcc/config.gcc and the makefile fragments specified in gcc/config.gcc. As long as there is no information about startfiles in libgcc for the current target, the information in the gcc subdirectory will be used. If there is any information in libgcc at all, though, the information in gcc will not be used - it will only be compared to the information in libgcc as a safety check. So all startfiles for a target must switch to being built in the libgcc directory at once. To migrate a target's startfiles to the libgcc subdirectory, add an appropriate setting of extra_parts to libgcc/config.host. This should generally go under the target, but for widely ported OS's, it is better to add it under the OS pattern in the previous case statement. Note that this requires migrating all targets using that OS at once, as a group! Then, any rules for building custom startfiles must be moved to makefile fragments in libgcc. The rules can usually be simplified when doing this - for instance they only need to use $(crt_compile) in many cases. And most dependencies are no longer needed because libgcc has automatic dependency generation. If the source files are staying in gcc/config, be sure to use $(gcc_srcdir) instead of $(srcdir). When this is done, the custom rules can be deleted from the GCC subdirectory.
Source Files
- Source files still live usually in the GCC subdirectory. It's easy to migrate them to libgcc once all references are in libgcc; just update references in the libgcc configure fragments to use $(srcdir) instead of $(gcc_srcdir).
None: Top-Level_Libgcc_Migration (last edited 2008-01-10 19:38:43 by localhost)