1

Debian "stretch" has built-in cross compilers for gcc versions 5 and 6, but apparently only includes the native architecture in its gcc-4.x packages. Unfortunately I need to compile software that depends on older Linux kernel headers that fail to build with gcc versions later than 4.x (they end up trying to include a file include/compiler-gcc<major-version>.h that doesn't exist for later version numbers), so these are no use to me.

I tried using the "embedian" repository, but it only had version branches for "wheezy", "jessie" and "unstable", so assuming "unstable" was an out-of-date reference to stretch I tried that, but I don't seem to be able to persuade it to install anything useful. The error I get is:

The following packages have unmet dependencies:
 gcc-4.9-arm-linux-gnueabihf : Depends: cpp-4.9-arm-linux-gnueabihf (= 4.9.2-16) but it is not going to be installed
                               Depends: libgcc-4.9-dev:armhf (= 4.9.2-16)
                               Depends: libisl13 (>= 0.10) but it is not installable
                               Recommends: libc6-dev:armhf (>= 2.13-5)
E: Unable to correct problems, you have held broken packages.

I believe the first two failed packages are available to be installed, so I could do those manually if necessary, but the third does not seem to exist anywhere I look.

Any suggestions how I can get a working gcc-4.9 (or earlier) cross compiler for arm-linux-gnueabihf on this system?

0

Emdebian stopped being maintained in November 2014. You might be able to get the packages you've found to work using libisl13 from snapshots.

Otherwise, you can build a cross-compiler using the gcc-4.9 package and possibly dpkg-cross; see README.cross for details. Basically, you need cross-binutils, and the appropriate library packages (the multiarch packages in Jessie or Stretch should do, hopefully without converting them using dpkg-cross); then

apt-get source gcc-4.9
cd gcc-4.9-4.9.4
GCC_TARGET=armhf dpkg-buildpackage -us -uc

The gcc-4.9 packages are part-way through the transition to plain multiarch instead of dpkg-cross, so you might run into some issues. (The transition was completed in the gcc-5 and gcc-6 packages.)

  • Hmm. That worked, but then the libgcc package needed other dependencies that conflicted with existing ones, and so on. Would have taken hours to get the correct versions of everything by hand, so am just wiping my VM and reinstalling with Jessie, which will hopefully be easier... – Jules Aug 12 '16 at 11:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.