You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This might be a low priority issue but it might be worth addressing at some point.
As @punitagrawaldiscovered, starting with version 10.1.0 GCC compiler enables usage of outline atomics bases on LSE instructions and also adds runtime detection of this optional cpu feature handled by the init function init_have_lse_atomics (part of libgcc.a). The init_have_lse_atomics calls __getauxval to fetch AT_HWCAP and check for presense of HWCAP_ATOMICS flag. The __getauxval in OSv does not handle __getauxval and shows a warning (getauxval() stubbed):
OSv v0.55.0-206-g6df05b6c
getauxval() stubbed
eth0: 192.168.122.15
Booted up in 49.35 ms
Cmdline: /tests/tst-hello.so
Hello World
To address it we could disable LTE usage by compiling with -mno-outline-atomics or implement AT_HWCAP in getauxval. For the former, we would need to detect the version of GCC (>= 10.1) and only then pass -mno-outline-atomics.
Also, I have noticed that on Ubuntu 20.10 with GCC 10.2.0, compiling natively with -mno-outline-atomics does NOT remove the init_have_lse_atomics function which still gets executed by early ELF initialization logic. On Fedora with GCC 10.2.1, the init_have_lse_atomics is removed. I wonder why this happens.
The text was updated successfully, but these errors were encountered:
This might be a low priority issue but it might be worth addressing at some point.
As @punitagrawal discovered, starting with version 10.1.0 GCC compiler enables usage of outline atomics bases on LSE instructions and also adds runtime detection of this optional cpu feature handled by the init function
init_have_lse_atomics
(part oflibgcc.a
). Theinit_have_lse_atomics
calls__getauxval
to fetchAT_HWCAP
and check for presense ofHWCAP_ATOMICS
flag. The__getauxval
in OSv does not handle__getauxval
and shows a warning (getauxval() stubbed
):To address it we could disable LTE usage by compiling with
-mno-outline-atomics
or implementAT_HWCAP
ingetauxval
. For the former, we would need to detect the version of GCC (>= 10.1) and only then pass-mno-outline-atomics
.Also, I have noticed that on Ubuntu 20.10 with GCC 10.2.0, compiling natively with
-mno-outline-atomics
does NOT remove theinit_have_lse_atomics
function which still gets executed by early ELF initialization logic. On Fedora with GCC 10.2.1, theinit_have_lse_atomics
is removed. I wonder why this happens.The text was updated successfully, but these errors were encountered: