Skip to content

Conversation

@lazka
Copy link
Contributor

@lazka lazka commented Dec 31, 2024

In #11113 a check was added to override the "register" keyword for older versions of flex. The check was added before the find_package() call which resulted in the workaround being active for any version of flex. This breaks the build with recent mingw-w64 which uses "register" in its headers.

Fix by moving the version check after the find_package() call.

In doxygen#11113 a check was added to override the "register" keyword for
older versions of flex. The check was added before the find_package()
call which resulted in the workaround being active for any version
of flex. This breaks the build with recent mingw-w64 which uses "register"
in its headers.

Fix by moving the version check after the find_package() call.
@lazka
Copy link
Contributor Author

lazka commented Dec 31, 2024

@albert-github

@albert-github
Copy link
Collaborator

@lazka

  • What kind of error messages do you get?
  • Which version of cmake and flex are you using
  • What is the output of your initial cmake run (the configuration run).

@albert-github albert-github added needinfo reported bug is incomplete, please add additional info install/build bug in the installation or build scripts labels Dec 31, 2024
@lazka
Copy link
Contributor Author

lazka commented Dec 31, 2024

  • What kind of error messages do you get?

https://sourceforge.net/p/mingw-w64/mailman/message/59112743/

For completeness:

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)
  • Which version of cmake and flex are you using
$ cmake --version
cmake version 3.31.3
$ flex --version
flex 2.6.4
  • What is the output of your initial cmake run (the configuration run).
$ cmake . -Wno-dev
-- Building for: Ninja
-- The C compiler identification is Clang 19.1.6
-- The CXX compiler identification is Clang 19.1.6
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: C:/msys64/clang64/bin/cc.exe - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/msys64/clang64/bin/c++.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Using Cmake version 3.31.3
-- Found Python: C:/Python312/python.exe (found version "3.12.7") found components: Interpreter
-- Found FLEX: C:/msys64/usr/bin/flex.exe (found version "2.6.4")
-- Found BISON: C:/msys64/usr/bin/bison.exe (found version "3.8.2")
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Found Iconv: C:/msys64/clang64/lib/libiconv.dll.a (found version "1.18")
-- Build spdlog: 1.14.1
-- Build type: Release
-- The javacc executable not found, using existing files
-- The generateDS executable not found, using existing files
-- Configuring done (3.2s)
-- Generating done (0.1s)
-- Build files have been written to: C:/msys64/home/user/git/doxygen

@albert-github albert-github added bug and removed needinfo reported bug is incomplete, please add additional info labels Dec 31, 2024
@albert-github
Copy link
Collaborator

The test indeed looks like to be at the completely wrong place.

@doxygen doxygen merged commit d7baa72 into doxygen:master Dec 31, 2024
10 checks passed
@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Dec 31, 2024
@lazka
Copy link
Contributor Author

lazka commented Dec 31, 2024

Thank you!

lazka added a commit to lazka/MINGW-packages that referenced this pull request Dec 31, 2024
See doxygen/doxygen#11302

This means we can remove the revert from mingw-w64 headers
which was using the register keyword.
lazka added a commit to msys2/MINGW-packages that referenced this pull request Dec 31, 2024
See doxygen/doxygen#11302

This means we can remove the revert from mingw-w64 headers
which was using the register keyword.
@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug install/build bug in the installation or build scripts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants