Summary: | dev-util/mingw64-runtime fails to build due to __rdtsc() redefinition with gcc11 | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Mihai Donțu <mihai.dontu> |
Component: | Current packages | Assignee: | Gentoo Toolchain Maintainers <toolchain> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | ionen, mike |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | AMD64 | ||
OS: | Linux | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 732706 | ||
Attachments: |
crossdev log file
crossdev log file (runtime) crossdev log file (runtime config) |
Description
Mihai Donțu
2021-04-28 20:16:59 UTC
Created attachment 703473 [details]
crossdev log file
Created attachment 703476 [details]
crossdev log file (runtime)
Created attachment 703479 [details]
crossdev log file (runtime config)
__rdtsc is a new gcc11 mingw64-runtime issue https://sourceforge.net/p/mingw-w64/mailman/message/37259429/ Unsure if above patch is complete/proper for gcc11, haven't took the time to look into this. The patch worked. Thank you! '#if !__has_builtin(__rdtsc)' is a nasty check. I think the original intent is to check if compiler (MSVC) provides __rdtsc builtin. Instead it gets fooled by a (incompatible) compat define: /usr/lib/gcc/x86_64-w64-mingw32/11.1.0/include/ia32intrin.h:110: note: macro "__rdtsc" defined here 110 | #define __rdtsc() __builtin_ia32_rdtsc () That effectively checks for __builtin_ia32_rdtsc. Given it's a namespace clash simplest would be to not rely on gcc's __rdtsc. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=40d0fd393ac48096a4e826f3eb941a21142a1f41 commit 40d0fd393ac48096a4e826f3eb941a21142a1f41 Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-04-28 21:58:19 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-04-28 21:58:54 +0000 dev-util/mingw64-runtime: fix build against gcc-11 (__rdtsc clash) gcc-11 defines __rdtsc as a macro: // include/ia32intrin.h:110 #define __rdtsc() __builtin_ia32_rdtsc () and causes build failure: intrincs/rdtsc.c:15:30: error: macro "__rdtsc" passed 1 arguments, but takes just 0 15 | unsigned __int64 __rdtsc(void) | ^ Let's avoid __rdtsc definition on systems with #define __rdtsc present. There is still a chance that it might be a '#define __rdtsc __rdtsc'. We'll revisit it then. Reported-by: Mihai Donțu Closes: https://bugs.gentoo.org/786549 Package-Manager: Portage-3.0.18, Repoman-3.0.3 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> .../files/mingw64-runtime-8.0.0-__rdtsc.patch | 25 +++++ .../mingw64-runtime-8.0.0-r1.ebuild | 119 +++++++++++++++++++++ 2 files changed, 144 insertions(+) |