On Fri, 13 Dec 2024, Jacek Caban wrote:
>
> This change is based on Wine's winnt.h implementation. Using a register
> variable for NtCurrentTeb
> allows the compiler to optimize the access more effectively.
> ---
> mingw-w64-headers/include/winnt.h | 5 ++---
> 1 file changed, 2 insertions(+), 3 deletions(-)
>
>
> diff --git a/mingw-w64-headers/include/winnt.h
> b/mingw-w64-headers/include/winnt.h
> index 96a610c1d..499f72219 100644
> --- a/mingw-w64-headers/include/winnt.h
> +++ b/mingw-w64-headers/include/winnt.h
> @@ -10211,11 +10211,10 @@ typedef DWORD (WINAPI
> *PRTL_RUN_ONCE_INIT_FN)(PRTL_RUN_ONCE, PVOID, PVOID *);
> PVOID GetFiberData(VOID);
>
> #if defined (__aarch64__) || defined(__arm64ec__)
> + register struct _TEB *__mingw_current_teb __asm__("x18");
> FORCEINLINE struct _TEB *NtCurrentTeb(VOID)
> {
> - struct _TEB *teb;
> - __asm ("mov %0, x18" : "=r" (teb));
> - return teb;
> + return __mingw_current_teb;
> }
> FORCEINLINE PVOID GetCurrentFiber(VOID)
> {
I'm not sure, but I'm guessing this change is causing an error building
doxygen in
https://github.com/msys2-arm/msys2-autobuild/actions/runs/12531144362/job/34948452159?check_suite_focus=true#step:11:1036
ld.lld: error: duplicate symbol: x18
>>> defined at addon/doxyparse/CMakeFiles/doxyparse.dir/doxyparse.cpp.obj
>>> defined at libdoxymain.a(dir.cpp.obj)
ld.lld: error: duplicate symbol: x18
>>> defined at addon/doxyparse/CMakeFiles/doxyparse.dir/doxyparse.cpp.obj
>>> defined at libdoxycfg.a(portable.cpp.obj)
ld.lld: error: duplicate symbol: x18
>>> defined at addon/doxyparse/CMakeFiles/doxyparse.dir/doxyparse.cpp.obj
>>> defined at libdoxymain.a(fileinfo.cpp.obj)
ld.lld: error: duplicate symbol: x18
>>> defined at addon/doxyparse/CMakeFiles/doxyparse.dir/doxyparse.cpp.obj
>>> defined at libdoxycfg.a(trace.cpp.obj)
_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public