Hello,
is there a simple way to force the GCC version used to build a package? openSUSE Leap 42.2 for example uses GCC 4.8 as default compiler, but also provides packages for GCC 5.3. Simply using BuildRequires gcc5 pulls gcc5 in but still uses gcc48 to build the package (especially in Build Service).
So is there maybe some Buid Service or spec file switch (bcond) to select the used GCC version?
Best greetings
Matthias Fehring
P.S. Not sure if it is a problem with my browser settings, but when I try to search lists.opensuse.org, it is not possible for me to limit the results to a specific list. Even if I set one, I get results from all lists, what makes searching almost impossible, because most results are commit messages.
On Thursday 2017-03-30 12:51, Matthias Fehring wrote:
So is there maybe some Buid Service or spec file switch (bcond) to select the used GCC version?
%build export CC=gcc-5 %configure ... ?
Am 30.03.2017 um 13:18 schrieb Jan Engelhardt:
On Thursday 2017-03-30 12:51, Matthias Fehring wrote:
So is there maybe some Buid Service or spec file switch (bcond) to select the used GCC version?
%build export CC=gcc-5 %configure ... ?
Arrrrgh, not seeing the wood for the trees....
Thank you :)
Hello,
Am Donnerstag, 30. März 2017, 12:51:00 CEST schrieb Matthias Fehring:
Simply using BuildRequires gcc5 pulls gcc5 in but still uses gcc48 to build the package (especially in Build Service).
Besides Jan's way, using a BuiltIgnore could be another option.
P.S. Not sure if it is a problem with my browser settings, but when I try to search lists.opensuse.org, it is not possible for me to limit the results to a specific list. Even if I set one, I get results from all lists, what makes searching almost impossible, because most results are commit messages.
Please report such issues to admin@opensuse.org ;-)
That said - this is a known issue: https://progress.opensuse.org/issues/4314
Regards,
Christian Boltz
Hi Jan, Christian, all,
On Donnerstag, 30. März 2017 22:08:40 Christian Boltz wrote:
Hello,
Am Donnerstag, 30. März 2017, 12:51:00 CEST schrieb Matthias Fehring:
Simply using BuildRequires gcc5 pulls gcc5 in but still uses gcc48 to build the package (especially in Build Service).
Besides Jan's way, using a BuiltIgnore could be another option.
Both ways, exyporting CC and defining #BuildIgnore are spec based. Any idea, how to select another compiler for a whole project in prjconf?
TIA, Pete
On Saturday 2018-03-31 14:29, Hans-Peter Jansen wrote:
Hi Jan, Christian, all,
On Donnerstag, 30. März 2017 22:08:40 Christian Boltz wrote:
Hello,
Am Donnerstag, 30. März 2017, 12:51:00 CEST schrieb Matthias Fehring:
Simply using BuildRequires gcc5 pulls gcc5 in but still uses gcc48 to build the package (especially in Build Service).
Besides Jan's way, using a BuiltIgnore could be another option.
Both ways, exyporting CC and defining #BuildIgnore are spec based. Any idea, how to select another compiler for a whole project in prjconf?
Macros: %__cc gcc-8 %__cxx g++-8 :Macros
But, because %configure and %cmake for example do not read %__cc unfortunately (why?!), it in itself has no effect. Some work from upstream rpm is needed.
Hi Jan,
thanks for your well educated response (as always). Much appreciated.
On Samstag, 31. März 2018 15:45:13 Jan Engelhardt wrote:
On Saturday 2018-03-31 14:29, Hans-Peter Jansen wrote:
Hi Jan, Christian, all,
On Donnerstag, 30. März 2017 22:08:40 Christian Boltz wrote:
Hello,
Am Donnerstag, 30. März 2017, 12:51:00 CEST schrieb Matthias Fehring:
Simply using BuildRequires gcc5 pulls gcc5 in but still uses gcc48 to build the package (especially in Build Service).
Besides Jan's way, using a BuiltIgnore could be another option.
Both ways, exyporting CC and defining #BuildIgnore are spec based. Any idea, how to select another compiler for a whole project in prjconf?
Macros: %__cc gcc-8 %__cxx g++-8
:Macros
But, because %configure and %cmake for example do not read %__cc unfortunately (why?!), it in itself has no effect. Some work from upstream rpm is needed.
which in turn means, that I have to touch every spec, doesn't it?
In a local OBS, where I attempt to build Kernel:stable and friends, I fiddled with below to get $subject going, but failed so far, barfing on a missing gcc.
Looks, like I need to create a gcc7-default package, that symlinks gcc7 and consorts to gcc. Has anybody done this before?
Guess, this plan isn't that uncommon nowadays...
%define gcc_version 7 Ignore: libgcc_s1 Preinstall: !libgcc_s1 libgcc_s1-gcc7 Prefer: -libstdc++6 libstdc++6-gcc7 Prefer: -libtsan0 libtsan0-gcc7 Prefer: -libgomp1 libgomp1-gcc7 Prefer: -libgcc_s1 libgcc_s1-gcc7 Prefer: -libatomic1 libatomic1-gcc7 Prefer: -libcilkrts5 libcilkrts5-gcc7 Prefer: -libitm1 libitm1-gcc7 Prefer: -liblsan0 liblsan0-gcc7 Prefer: -libmpx2 libmpx2-gcc7 Prefer: -libubsan0 libubsan0-gcc7
Required: gcc7 cpp7 gcc7-devel Ignore: gcc48 cpp48 Ignore: gcc-4.8 cpp-4.8 Ignore: gcc-c++ Ignore: gcc-devel
Substitute: gcc48 gcc7 Substitute: gcc gcc7 Substitute: cpp48 cpp7 Substitute: cpp cpp7 Substitute: gcc-4.8 gcc7 Substitute: gcc-c++ gcc7-c++ Substitute: gcc-devel gcc7-devel
#Prefer: -gcc gcc7 #Prefer: -gcc48 gcc7 #Prefer: -cpp48 cpp7
Macros: %__cc gcc-7 %__cxx g++-7 :Macros
Cheers, Pete
On Mär 31 2018, Hans-Peter Jansen hpj@urpla.net wrote:
In a local OBS, where I attempt to build Kernel:stable and friends, I fiddled with below to get $subject going, but failed so far, barfing on a missing gcc.
Looks, like I need to create a gcc7-default package, that symlinks gcc7 and consorts to gcc. Has anybody done this before?
Guess, this plan isn't that uncommon nowadays...
%define gcc_version 7 Ignore: libgcc_s1 Preinstall: !libgcc_s1 libgcc_s1-gcc7 Prefer: -libstdc++6 libstdc++6-gcc7 Prefer: -libtsan0 libtsan0-gcc7 Prefer: -libgomp1 libgomp1-gcc7 Prefer: -libgcc_s1 libgcc_s1-gcc7 Prefer: -libatomic1 libatomic1-gcc7 Prefer: -libcilkrts5 libcilkrts5-gcc7 Prefer: -libitm1 libitm1-gcc7 Prefer: -liblsan0 liblsan0-gcc7 Prefer: -libmpx2 libmpx2-gcc7 Prefer: -libubsan0 libubsan0-gcc7
That's all you should need, together with a branch of the gcc package with has gcc_version and gcc_suffix adjusted.
Andreas.
On Tue, Apr 03, 2018 at 11:34:02AM +0200, Andreas Schwab wrote:
On Mär 31 2018, Hans-Peter Jansen hpj@urpla.net wrote:
In a local OBS, where I attempt to build Kernel:stable and friends, I fiddled with below to get $subject going, but failed so far, barfing on a missing gcc.
Looks, like I need to create a gcc7-default package, that symlinks gcc7 and consorts to gcc. Has anybody done this before?
Guess, this plan isn't that uncommon nowadays...
%define gcc_version 7 Ignore: libgcc_s1 Preinstall: !libgcc_s1 libgcc_s1-gcc7 Prefer: -libstdc++6 libstdc++6-gcc7 Prefer: -libtsan0 libtsan0-gcc7 Prefer: -libgomp1 libgomp1-gcc7 Prefer: -libgcc_s1 libgcc_s1-gcc7 Prefer: -libatomic1 libatomic1-gcc7 Prefer: -libcilkrts5 libcilkrts5-gcc7 Prefer: -libitm1 libitm1-gcc7 Prefer: -liblsan0 liblsan0-gcc7 Prefer: -libmpx2 libmpx2-gcc7 Prefer: -libubsan0 libubsan0-gcc7
That's all you should need, together with a branch of the gcc package with has gcc_version and gcc_suffix adjusted.
Why not use BuildRequires: gcc7
and later on:
set CC=gcc-7
instead?
Ciao, Marcus
On Tuesday 2018-04-03 11:36, Marcus Meissner wrote:
Why not use BuildRequires: gcc7
and later on:
set CC=gcc-7
instead?
Because set CC requires modifying the spec file(s), of which there are potentially many.
On Dienstag, 3. April 2018 11:34:02 Andreas Schwab wrote:
On Mär 31 2018, Hans-Peter Jansen hpj@urpla.net wrote:
In a local OBS, where I attempt to build Kernel:stable and friends, I fiddled with below to get $subject going, but failed so far, barfing on a missing gcc.
Looks, like I need to create a gcc7-default package, that symlinks gcc7 and consorts to gcc. Has anybody done this before?
Guess, this plan isn't that uncommon nowadays...
%define gcc_version 7 Ignore: libgcc_s1 Preinstall: !libgcc_s1 libgcc_s1-gcc7 Prefer: -libstdc++6 libstdc++6-gcc7 Prefer: -libtsan0 libtsan0-gcc7 Prefer: -libgomp1 libgomp1-gcc7 Prefer: -libgcc_s1 libgcc_s1-gcc7 Prefer: -libatomic1 libatomic1-gcc7 Prefer: -libcilkrts5 libcilkrts5-gcc7 Prefer: -libitm1 libitm1-gcc7 Prefer: -liblsan0 liblsan0-gcc7 Prefer: -libmpx2 libmpx2-gcc7 Prefer: -libubsan0 libubsan0-gcc7
That's all you should need, together with a branch of the gcc package with has gcc_version and gcc_suffix adjusted.
Well, I find it a bit expensive to rebuild two gcc packages (in worst case) just for changing the compiler, but possibly the way to go.
Does anybody know, how the build system behaves, if I "overload" %___build_pre of /usr/lib/rpm/macros within another macro file? Is the load order of macro files documented/deterministic?
Would be much easier to Preinstall a rpm_macros_gcc7 package, where a matching CC is exported in %___build_pre, wouldn't it?
Cheers, Pete
On Tuesday 2018-04-03 12:58, Hans-Peter Jansen wrote:
That's all you should need, together with a branch of the gcc package with has gcc_version and gcc_suffix adjusted.
Well, I find it a bit expensive to rebuild two gcc packages (in worst case) just for changing the compiler, but possibly the way to go.
It's just the gcc *metapackage* (with the symlinks), not gcc7/gcc8.src.rpm itself.
On Apr 03 2018, Hans-Peter Jansen hpj@urpla.net wrote:
Well, I find it a bit expensive to rebuild two gcc packages (in worst case) just for changing the compiler, but possibly the way to go.
There is only one package named gcc.
Andreas.
On Dienstag, 3. April 2018 14:41:30 Andreas Schwab wrote:
On Apr 03 2018, Hans-Peter Jansen hpj@urpla.net wrote:
Well, I find it a bit expensive to rebuild two gcc packages (in worst case) just for changing the compiler, but possibly the way to go.
There is only one package named gcc.
Duh, of course. Thanks, Jan and Andreas.
For the record:
In order to change the default gcc for a project, do this:
Provide the gcc build in a repo, and add this repo to your upstream repos in the project meta data, e.g.:
<repository name="openSUSE_Leap_42.3"> <path project="home:xxx:gcc" repository="openSUSE_Leap_42.3"/> <path project="openSUSE:Leap:42.3:Update" repository="standard"/> <arch>x86_64</arch> </repository>
Add this to prjconf:
# change to gcc7 %define gcc_version 7 Preinstall: !libgcc_s1 libgcc_s1-gcc7 Prefer: -libstdc++6 libstdc++6-gcc7 Prefer: -libtsan0 libtsan0-gcc7 Prefer: -libgomp1 libgomp1-gcc7 Prefer: -libgcc_s1 libgcc_s1-gcc7 Prefer: -libatomic1 libatomic1-gcc7 Prefer: -libcilkrts5 libcilkrts5-gcc7 Prefer: -libitm1 libitm1-gcc7 Prefer: -liblsan0 liblsan0-gcc7 Prefer: -libmpx2 libmpx2-gcc7 Prefer: -libubsan0 libubsan0-gcc7
link gcc package into your project, adjust gcc_version and gcc_suffix in the spec:
%define gcc_version 7 %define gcc_suffix 7 Version: 7
Cheers, Pete