Update-alternatives in OBS for newer GCC version

I have several packages that require a newer GCC version than the default 4.3 with SLES 11.

I’ve added the build requirements for GCC 4.6 from the SDK but the packages still build with version 4.3

Typically I think this is accomplished by using the Update-alternatives to change the default GCC version but I’m not positive the best way to do this in OBS.

Any ideas how to do this per package or better yet, per project?


just a shot in the dark…add the gcc46 repo in the meta-description of the project, or branch the gcc46 into your project

No, that doesn’t work. gcc46 gets installed. But so doesn’t gcc43 which becomes the default link to gcc.

If I use a BuildIgnore for gcc43, then the gcc46 rpm via the SDK doesn’t actually link to the gcc command but to gcc-46.

I tried to just use the update-alterantives in the spec file but this requires sudo to work and fails in OBS.

Any other thoughts?