Menu

#318 CMake + MinGW - libmpg123 build error

1.28.x
closed-fixed
nobody
None
5
2021-07-12
2021-06-16
No
[build] FAILED: src/libmpg123/libmpg123.dll src/libmpg123/libmpg123.dll.a 
[build] C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/libmpg123/CMakeFiles/libmpg123.dir/C_/msys64/home/evpobr/libmpg123/trunk/src/libmpg123/frame.c.obj: in function `wrap_getcpuflags':
[build] C:/msys64/home/evpobr/libmpg123/trunk/src/libmpg123/getcpuflags.h:54: undefined reference to `INT123_getcpuflags'
[build] C:/msys64/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/10.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: src/libmpg123/CMakeFiles/libmpg123.dir/C_/msys64/home/evpobr/libmpg123/trunk/src/libmpg123/optimize.c.obj: in function `wrap_getcpuflags':
[build] C:/msys64/home/evpobr/libmpg123/trunk/src/libmpg123/getcpuflags.h:54: undefined reference to `INT123_getcpuflags'

It happens because HAVE_FPU is set to 0 in ports/cmake/src/CMakeLists.txt:

cmake_host_system_information(RESULT HAVE_FPU QUERY HAS_FPU)

CMake bug?

Quick workaround - i guess it is safe to set HAVE_FPU to 1 for Windows platform:

if(WIN32)
    set(HAVE_FPU 1)
 else()
    cmake_host_system_information(RESULT HAVE_FPU QUERY HAS_FPU)
endif()

Discussion

  • Thomas Orgis

    Thomas Orgis - 2021-07-05

    Oh, somehow I missed that one. Can you confirm that this is needed also with a current CMake?

    I'd put it into the 1.28.1 release, then.

     
    • Evgeni Poberezhnikov

      Yes, all patches are needed.

       
  • Thomas Orgis

    Thomas Orgis - 2021-07-06

    OK, It's in svn now. I should prepare 1.28.1 shortly, then.

    Are you in touch with CMake or MinGW upstream to investigate and fix the root cause?

     
  • Thomas Orgis

    Thomas Orgis - 2021-07-12
    • status: open --> closed-fixed
     

Log in to post a comment.