<html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hi, <br>
</p>
<p>The problem happened after upgrade to lttng-ust 2.13.0. 2.12.0
don't have this issue.</p>
<p>liburcu version: 0.13.0</p>
<p>gcc: 11.2.0<br>
<br>
</p>
<p>This is my reproduce steps, it is cross compile enviroment based
on yocto project.<br>
</p>
<ol>
<li>git clone git://git.yoctoproject.org/poky</li>
<li>. oe-init-build-env</li>
<li>echo "MACHINE='qemuarm'" >> conf/local.conf</li>
<li>echo "DEBUG_BUILD='1'" >> conf/local.conf <br>
</li>
<li>bitbake lttng-ust</li>
</ol>
<p>compile failed with error:</p>
<p>|
/work/cortexa15t2hf-neon-poky-linux-gnueabi/lttng-ust/2_2.13.0-r0/recipe-sysroot-native/usr/bin/arm-poky-linux-gnueabi/../../libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/11.2.0/ld:
../../../src/lib/lttng-ust/.libs/liblttng-ust.so: undefined
reference to `_uatomic_link_error'<br>
| collect2: error: ld returned 1 exit status<br>
| Makefile:399: recipe for target 'test_ust_error' failed</p>
<p>checked with "nm
../../../src/lib/lttng-ust/.libs/liblttng-ust.so" | grep atomic,
we can see 'U _uatomic_link_error', but since -Og <br>
</p>
<p>is used, liburcu don't define this function.</p>
<p>[snip]<br>
#if !defined __OPTIMIZE__ || defined UATOMIC_NO_LINK_ERROR<br>
static inline __attribute__((always_inline, noreturn))<br>
void _uatomic_link_error(void)<br>
{<br>
#ifdef ILLEGAL_INSTR<br>
/*<br>
* generate an illegal instruction. Cannot catch this with<br>
* linker tricks when optimizations are disabled.<br>
*/<br>
__asm__ __volatile__(ILLEGAL_INSTR);<br>
#else<br>
__builtin_trap();<br>
#endif<br>
}<br>
#else /* #if !defined __OPTIMIZE__ || defined
UATOMIC_NO_LINK_ERROR */<br>
extern void _uatomic_link_error(void);<br>
#endif /* #else #if !defined __OPTIMIZE__ || defined
UATOMIC_NO_LINK_ERROR */<br>
</p>
<p>[snip]<br>
</p>
<p>we cannot see 'U _uatomic_link_error' in following conditions, so
compile successed:</p>
<p>1. without -Og(using -O2), + 32bit arm</p>
<p>2. -Og + 64bit arm</p>
<p>3. -Og + x86/x86-64</p>
<p><br>
</p>
<p>Do you have any idea about how to fix this? I don't understand
why only "-Og + 32bit arm" will call function _uatomic_link_error.</p>
<p>Thanks</p>
<p>//Changqing<br>
</p>
</body>
</html>