Skip to main content
replaced http://unix.stackexchange.com/ with https://unix.stackexchange.com/
Source Link

The correct way of doing this is using backports. See How can I install more recent versions of software than what Debian provides?How can I install more recent versions of software than what Debian provides? for background. Unfortunately, this is not "automagical", whatever that means.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot (see How do I run 32-bit programs on a 64-bit Debian/Ubuntu?How do I run 32-bit programs on a 64-bit Debian/Ubuntu?)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

The correct way of doing this is using backports. See How can I install more recent versions of software than what Debian provides? for background. Unfortunately, this is not "automagical", whatever that means.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot (see How do I run 32-bit programs on a 64-bit Debian/Ubuntu?)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

The correct way of doing this is using backports. See How can I install more recent versions of software than what Debian provides? for background. Unfortunately, this is not "automagical", whatever that means.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot (see How do I run 32-bit programs on a 64-bit Debian/Ubuntu?)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

added 1 character in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
  1. First, the build dependencies are for unstable, and are unnecessarily restrictive. The first thing is to weaken the retrictionsrestrictions so that the build dependencies are satisfied on wheezy. So, first try

    debuild -uc -us

  1. First, the build dependencies are for unstable, and are unnecessarily restrictive. The first thing is to weaken the retrictions so that the build dependencies are satisfied on wheezy. So, first try

    debuild -uc -us

  1. First, the build dependencies are for unstable, and are unnecessarily restrictive. The first thing is to weaken the restrictions so that the build dependencies are satisfied on wheezy. So, first try

    debuild -uc -us

added 167 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
  1. Download the gcc 4.9 sources in some subdirectory, say gcc-4.9gcc-4.9.

    cd gcc-4.9 apt-get source gcc-4.9

  2. Then

    cd gcc-4.9-4.9.0/debian

  3. Then put debianthe debian/ directory under version control. I use mercurialMercurial. This is an optional optional step, but is useful if something goes wrong.

  4. Clone this Mercurial repository containing a patch against the Debian packaging files repository. You can clone it in the debian/ directory. I.e.

    gcc-4.9/gcc-4.9-4.9.0/debian$ hg clone https://bitbucket.org/faheem/gcc-4.9-debian-mq gcc-4.9/gcc-4.9-4.9.0/debian$ patch -p1 < gcc-4.9-debian-mq/debian

    patching file control patching file rules.defs patching file source/format

  5. Now you can attempt a build. You'll need a few packages installed, like build-essentialbuild-essential, fakerootfakeroot and devscriptsdevscripts.

    debuild -uc -us

This will probably fail if you don't have the necessary build dependencies. So, install them; debuilddebuild will tell you what is missing. With the patch you should be able to successfully resolve all dependencies on wheezy.

NOTES: This patch may not continue to work for further updates of gcc-4.9gcc-4.9. For reference, here is the version I am patching against. This is the first Debian package following the gcc 4.9 release on 2014-04-22.

Therefore, I'm including some notes about how the patch was generated, so others can do this themselves. Please read through this. In particular, note (56) (Multiarch) may concern you even if you are not planning to make your own patch.

debuilddebuild will complain about build dependencies not being installed. Even after they are installed, debuilddebuild will complain about the versions not being sufficiently recent. So, the simplest thing to do is to remove the version numbers mentioned.

This is only strictly necessary if you are putting the debian/ directory under version control. For reasons I won't go into here, format 1 makes the build fail if debian/ is under version control.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot schroot (see How do I run 32-bit programs on a 64-bit Debian/Ubuntu?)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

  1. Download the gcc 4.9 sources in some subdirectory, say gcc-4.9.

    cd gcc-4.9 apt-get source gcc-4.9

  2. Then

    cd gcc-4.9-4.9.0/debian

  3. Then put debian under version control. I use mercurial. This is an optional step, but is useful if something goes wrong.

  4. Clone this Mercurial repository containing a patch against the Debian packaging files repository. You can clone it in the debian directory. I.e.

    gcc-4.9/gcc-4.9-4.9.0/debian$ hg clone https://bitbucket.org/faheem/gcc-4.9-debian-mq gcc-4.9/gcc-4.9-4.9.0/debian$ patch -p1 < gcc-4.9-debian-mq/debian

    patching file control patching file rules.defs patching file source/format

  5. Now you can attempt a build. You'll need a few packages installed, like build-essential, fakeroot and devscripts.

    debuild -uc -us

This will probably fail if you don't have the necessary build dependencies. So, install them; debuild will tell you what is missing. With the patch you should be able to successfully resolve all dependencies on wheezy.

NOTES: This patch may not continue to work for further updates of gcc-4.9. For reference, here is the version I am patching against. This is the first Debian package following the gcc 4.9 release on 2014-04-22.

Therefore, I'm including some notes about how the patch was generated, so others can do this themselves. Please read through this. In particular, note (5) may concern you even if you are not planning to make your own patch.

debuild will complain about build dependencies not being installed. Even after they are installed, debuild will complain about the versions not being sufficiently recent. So, the simplest thing to do is to remove the version numbers mentioned.

This is only strictly necessary if you are putting debian under version control. For reasons I won't go into here, format 1 makes the build fail if debian is under version control.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot (see)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

  1. Download the gcc 4.9 sources in some subdirectory, say gcc-4.9.

    cd gcc-4.9 apt-get source gcc-4.9

  2. Then

    cd gcc-4.9-4.9.0/debian

  3. Then put the debian/ directory under version control. I use Mercurial. This is an optional step, but is useful if something goes wrong.

  4. Clone this Mercurial repository containing a patch against the Debian packaging files repository. You can clone it in the debian/ directory. I.e.

    gcc-4.9/gcc-4.9-4.9.0/debian$ hg clone https://bitbucket.org/faheem/gcc-4.9-debian-mq gcc-4.9/gcc-4.9-4.9.0/debian$ patch -p1 < gcc-4.9-debian-mq/debian

    patching file control patching file rules.defs patching file source/format

  5. Now you can attempt a build. You'll need a few packages installed, like build-essential, fakeroot and devscripts.

    debuild -uc -us

This will probably fail if you don't have the necessary build dependencies. So, install them; debuild will tell you what is missing. With the patch you should be able to successfully resolve all dependencies on wheezy.

NOTES: This patch may not continue to work for further updates of gcc-4.9. For reference, here is the version I am patching against. This is the first Debian package following the gcc 4.9 release on 2014-04-22.

Therefore, I'm including some notes about how the patch was generated, so others can do this themselves. Please read through this. In particular, note (6) (Multiarch) may concern you even if you are not planning to make your own patch.

debuild will complain about build dependencies not being installed. Even after they are installed, debuild will complain about the versions not being sufficiently recent. So, the simplest thing to do is to remove the version numbers mentioned.

This is only strictly necessary if you are putting the debian/ directory under version control. For reasons I won't go into here, format 1 makes the build fail if debian/ is under version control.

UPDATE: Finally got around to building i386 debs for gcc 4.9 (in an i386 chroot using schroot (see How do I run 32-bit programs on a 64-bit Debian/Ubuntu?)), and installed those in tandem with the amd64 ones, because of the aforementioned multilib constraint. I'm still testing, but both g++ 4.7 and g++-4.9 compile the code I tested it with. The installation of gcc 4.9 debs isn't completely straightforward, because some of the common libraries for 4.7 and 4.9 need to be upgraded too, like libstdc++6.

added 119 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
added 452 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
added 29 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
added 423 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
added 186 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
added 135 characters in body
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading
Source Link
Faheem Mitha
  • 36.1k
  • 33
  • 129
  • 189
Loading