Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

Can I build packages for Debian 5.0 using Debian 6.0 or Debian Wheezy?

I assume that I could do a complete chroot'ed installation of Debian 5.0 and do my builds there, but it might be nice to have something lighter-weight.

For bonus points - can I build packages for Debian 5.0 using the version of g++ from Debian 6.0 or Debian Wheezy? I'm responsible for developing some Debian 5.0 software, but I'd like to start using C++11 features that aren't available in Debian 5.0's g++.

share|improve this question
    
A chroot is exactly what Debian developers use in this circumstance. Debian comes with several tools to make this very easy. –  Gilles Mar 2 '12 at 0:48
1  
Here is a patch for backporting 4.7 to stable. It isn't what you were asking, but will give you an idea what is involved. See Get newest gcc for debian –  Faheem Mitha May 26 '12 at 3:42
add comment

1 Answer

up vote 2 down vote accepted

You might find the schroot or pbuilder packages convenient for this, since they are designed to maintain a build environment for multiple versions of Debian.

That said, a basic chroot is a couple of hundred MB in size; you could have thousands of them on most modern systems without really noticing. debootstrap is a great tool for getting those working swiftly.

Building with a newer version of G++ is traditionally exciting, because the support libraries also need to change - and so the older glibc release may not support your newer binary code well.

You should be able to backport the appropriate version of G++ and have it work, but directly using the newer version might cause problems. The release notes should help understand that.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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