From: Christian S. <sch...@li...> - 2025-06-18 10:26:02
|
On Tuesday, June 17, 2025 2:16:19 AM CEST Philippe DIDIER wrote: > Hi Hi Philippe, > We use to create rpms of gig linuxsampler gigedit and qsampler for i686 > , x86_64 , aarch64 and armv7hl... > > There's something wrong when we try to build linuxsampler 2.4.0 for > armv7hl : > > This concerns RTMath.cpp ... We get a build failure with this message : > > RTMath.cpp:79:19: error: invalid operand for instruction > 79 | asm volatile ("mrs %0, cntvct_el0" : "=r"(t)); > > > This is linked to the instructions from line 77 to 80 #elif > defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__) uint32_t t; asm > volatile ("mrs %0, cntvct_el0" : "=r"(t)); return t; > > Maybe we should use for ARM_ARCH_75 Yeah, looks like that's an ARMv8 (a.k.a. ARM64) feature. > the same instruction as for ARMv6 ... that is : > uint32_t t; > asm volatile ("mrc p15, 0, %0, c15, c12, 1" : "=r" (t)); > return t; I think that also needs some correction. Can you test the following patch? Index: src/common/RTMath.cpp =================================================================== --- src/common/RTMath.cpp (revision 4334) +++ src/common/RTMath.cpp (working copy) @@ -74,16 +74,12 @@ uint64_t t; asm volatile ("mrs %0, cntvct_el0" : "=r"(t)); return (time_stamp_t) t; - #elif defined(__ARM_ARCH_7A__) || defined(__ARM_ARCH_7S__) - uint32_t t; - asm volatile ("mrs %0, cntvct_el0" : "=r"(t)); - return t; #elif defined(__APPLE__) return (time_stamp_t) mach_absolute_time(); #elif defined(__arm__) /* ARMv6 and older */ # warning ARM 'mrc' instruction requires special runtime privileges! uint32_t t; - asm volatile ("mrc p15, 0, %0, c15, c12, 1" : "=r" (t)); + asm volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r" (t)); return t; #else // we don't want to use a slow generic solution # error "Sorry, LinuxSampler lacks time stamp code for your system." Would be good to know not only if it compiles, but whether it works at runtime. Because as you can see from the warning, special privileges or preceding system configuration steps might be required for this to work at all. If not, it's getting pretty ugly for the user. Since the sampler would first start without complaint and eventually after loading a sound the app would die with illegal instruction exception. /Christian |