Questions on problems encountered building gcc cross-toolchain for armel in Jessie
Recently I decided to try to build a cross-toolchain in Jessie for armel. I managed to succeed, but I ran into several problems and I wanted to get some feedback before submitting proposed patches. As background in my use case, I am attempting to build a cross-toolchain targeting armel to be run on i386. Additionally, I build this toolchain statically and with a custom prefix so that I can relocate the resulting binaries easily to work in a stand alone make environment (e.g. not a standard Debian installation).
I want to talk specifically about two of the problems I ran into compiling GCC. I also ran into a problem statically compiling binutils, but this was just a simple breakage of the install-static-cross-stamp target, for which I have already filed a bug 766485. There are full details below along with my patches, as well as a full outline of my build steps are at the end of this message.
When statically compiling GCC, I ran into a problem in that a static compilation seems to be incompatible with GCC plugins. This seems logical I guess, since plugins by their nature are dynamic. I had to disable plugins to get the static build to work. I have a patch below that makes this modification based on a deb build option 'static' already present in the Debian GCC makefiles. So the question I have is does this make sense?
The next problem I ran into that I want to discuss, regards libssp. I found when building that /debian/control.m4 excludes control information for libssp when TARGET is defined. I had earlier found a problem in the Debian makefiles regarding libssp when building libgcc. I worked around both problems by setting 'with_libssp' to 'no' when DEB_CROSS is defined. I am left wondering if it makes sense to have libssp in a cross toolchain. The control file would seem to indicate that it does not. Is this correct?
I found one additional problem when building libstdcxx. There was a missing call to shlibdirs_to_search preventing the build from locating dependencies. This could have been stimulated by the use of a custom prefix.
So with respect to the plugin and libssp questions, I would like to know from the community if my changes make sense before I open bugs against GCC.
Detailed build information and patches follow:
Problems building gcc statically as a crosscompiler for armel
1. Static build is not compatible with plugins, which I think makes sense, since these require dynamic loading. Fixed this with a modification to debian/rules.defs and debian/rules.d/binary-cpp.mk
4. Ran into problems with missing control information for installation of libssp. Looking at debain/control.m4 it looks like libssp doesn't get included in the control file if TARGET is defined. Should this library be included for a cross compiler toolchain?
ifdef(`TARGET', `', `
ifdef(`MULTIARCH', `Multi-Arch: same
!!!!! The build error was
dpkg-gencontrol: error: package libssp0 not in control info