Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 721690 - sys-devel/gcc-8.4.0 doesn't build: cc1: error: bad value ('znver2') for '-march=' switch
Summary: sys-devel/gcc-8.4.0 doesn't build: cc1: error: bad value ('znver2') for '-mar...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2020-05-08 20:47 UTC by Alexey
Modified: 2020-05-11 21:11 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
gcc-build-logs.tar.bz2 (gcc-build-logs.tar.bz2,103.00 KB, application/x-bzip2)
2020-05-08 20:47 UTC, Alexey
Details
emerge --info (file_721690.txt,19.38 KB, text/plain)
2020-05-08 20:48 UTC, Alexey
Details
build.log (build.log,974.49 KB, text/x-log)
2020-05-08 20:48 UTC, Alexey
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alexey 2020-05-08 20:47:01 UTC
Created attachment 636898 [details]
gcc-build-logs.tar.bz2

I uses gcc 9.3, and tried to install gcc 8.

cc1: note: valid arguments to '-march=' switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake-client icelake-server bonnell atom silvermont slm knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 native; did you mean 'znver1'?
Comment 1 Alexey 2020-05-08 20:48:08 UTC
Created attachment 636900 [details]
emerge --info
Comment 2 Alexey 2020-05-08 20:48:59 UTC
Created attachment 636902 [details]
build.log
Comment 3 Alexander Tsoy 2020-05-09 11:34:48 UTC
Yeah, looks like support for skylake+ and znver1+ in downgrade_arch_flags() is missing:
https://gitweb.gentoo.org/repo/gentoo.git/tree/eclass/toolchain.eclass#n1405
Comment 4 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-09 22:48:35 UTC
I assume znver2 is a proper superset of znver1 and should be easy to translate with one-liner that specifies gcc version that introduced znver2. Do you want to write a patch yourself?
Comment 5 Larry the Git Cow gentoo-dev 2020-05-10 01:02:43 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=4d587a4d38d0ad25c46b194d88f59ae467e508cf

commit 4d587a4d38d0ad25c46b194d88f59ae467e508cf
Author:     Alexey Sokolov <sokolov@google.com>
AuthorDate: 2020-05-09 23:08:11 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-05-10 01:00:21 +0000

    toolchain.eclass: downgrade znver2 to znver1
    
    Multiple other downgrades are missing here after 4.9 though
    
    Closes: https://bugs.gentoo.org/721690
    Closes: https://github.com/gentoo/gentoo/pull/15733
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/toolchain.eclass | 1 +
 1 file changed, 1 insertion(+)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=e0f8418663dff3c4e51899b8ccb172363478591a

commit e0f8418663dff3c4e51899b8ccb172363478591a
Author:     Sergei Trofimovich <slyfox@gentoo.org>
AuthorDate: 2020-05-10 01:02:07 +0000
Commit:     Sergei Trofimovich <slyfox@gentoo.org>
CommitDate: 2020-05-10 01:02:07 +0000

    eclass/tests/toolchain.sh: add znver2 downgrade test
    
    Bug: https://bugs.gentoo.org/721690
    Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>

 eclass/tests/toolchain.sh | 1 +
 1 file changed, 1 insertion(+)
Comment 6 Sergei Trofimovich (RETIRED) gentoo-dev 2020-05-11 21:11:02 UTC
Thank you for the fix! Handling arches on one-by-one basis should be fine.

We don't attempt to cover all possible combinations as there are so many of them across all the arches and it's somewhat a limited use case to simultaneously: keep multiple gcc versions available use very fresh -march= value.