2011/8/15 Marc Glisse <marc.glisse@xxxxxxxx>: > On Mon, 15 Aug 2011, Maciej Bliziński wrote: > >> I'm working on a bootstrap of gcc-4.6.1 using Sun Studio on Solaris 9. >> I'm currently stuck at a liblto_plugin.so linking issue[1], but I'd >> first like to verify whether my general approach is correct. > > libtool doesn't seem to have noticed you are not using gcc/linux. Is there a standard way to tell it that? There already was a hardcoded AM_CFLAGS bit, which was incompatible with Sun Studio, so I made a provisional patch to push the build forward. http://gar.svn.sourceforge.net/svnroot/gar/csw/mgar/pkg/gcc4/branches/bootstrap-4.6/files/0001-clear-AM_CFLAGS-in-lto-plugin.patch Perhaps there are more hardcoded assumptions about the build environment? I think I saw tests for -Wall passing by in other parts of the build, perhaps they could be reused. I also saw that revision 177614 addresses some of these issues, but I guess these changes haven't made it into a release yet. >> There is a mutual incompatibility between flags accepted by Sun Studio >> and GCC. Therefore, 2 sets of CFLAGS are needed: one for the host >> compiler (here: Sun Studio), and one gcc for the subsequent stages. >> The first one is set via CFLAGS, and the second one is set via >> CFLAGS_FOR_TARGET. Is this approach correct? (I also saw references >> to the TARGET_CFLAGS variable, so I'm not sure which one to use.) > > http://gcc.gnu.org/install/build.html > (BOOT_CFLAGS) > But you should probably leave alone the flags used by gcc and only touch the > flags used by suncc (although the default ones worked well enough last I > tried). There are some flags I need to pass to the last stage of the compilation, namely -march=v8, because of the policy at OpenCSW to build sparcv8 and not sparcv8+ (default for gcc) binaries. Looks like BOOT_CFLAGS work for that purpose. The current point where I'm stuck is the lto-plugin linking problem, any advice is appreciated. Maciej [1] http://gcc.gnu.org/viewcvs?view=revision&revision=177614