Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 928037 - dev-libs/dynolog-0.3.1_p20230126-r1: FTBFS on arm64 due to malformed riscv patch
Summary: dev-libs/dynolog-0.3.1_p20230126-r1: FTBFS on arm64 due to malformed riscv patch
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: ARM64 Linux
: Normal normal (vote)
Assignee: Gentoo Linux bug wranglers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-03-28 08:58 UTC by Marcus Comstedt
Modified: 2024-03-28 21:36 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Comstedt 2024-03-28 08:58:48 UTC
The dev-libs/dynolog-0.3.1_p20230126-r1 ebuild applies a patch called dynolog-0.3.1_p20230126-riscv.patch which looks like this:

--- a/hbt/src/common/System.h	2024-01-21 15:26:26.940486370 +0000
+++ b/hbt/src/common/System.h	2024-01-21 22:22:36.713134358 +0000
@@ -445,6 +445,14 @@
   asm volatile("mrs %0, cntvct_el0" : "=r"(tstamp));
   cpu = getCpu();
   return tstamp;
+#elif defined(__riscv)
+inline TimeStamp rdtscp(CpuId& cpu) {
+  TimeStamp tstamp;
+  // Use the RDCYCLE instruction for RISC-V.
+  asm volatile("rdcycle %0" : "=r"(tstamp));
+  cpu = getCpu();
+  return tstamp;
+
 }
 #endif

As can be seen this removes the trailing brace from the preceding definition (which is for defined(__aarch64__)) by moving it into the the section that is __riscv specific, thus breaking compilation on arm64.  Each definition of the rdtscp function should have its own braces.


Reproducible: Always

Steps to Reproduce:
1.Preprocess hbt/src/common/System.h with -D__aarch64__
2.
3.
Actual Results:  
The preprocessed source has mismatching braces in the definition of TimeStamp rdtscp(CpuId& cpu)

Expected Results:  
The preprocessed source has matching braces
Comment 1 Larry the Git Cow gentoo-dev 2024-03-28 21:36:14 UTC
The bug has been closed via the following commit(s):

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

commit ae84dcc926bb15e5848146f402a6ab5fbc55225e
Author:     Alfredo Tupone <tupone@gentoo.org>
AuthorDate: 2024-03-28 21:34:56 +0000
Commit:     Alfredo Tupone <tupone@gentoo.org>
CommitDate: 2024-03-28 21:35:43 +0000

    dev-libs/dynolog: malformed riscv patch
    
    Closes: https://bugs.gentoo.org/928037
    Signed-off-by: Alfredo Tupone <tupone@gentoo.org>

 dev-libs/dynolog/files/dynolog-0.3.1_p20230126-riscv.patch | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)