[physfs] Cross compiling PhysicsFS 3.0.1 using MinGW on Linux

Jay Dolan jay.t.dolan at gmail.com
Tue Mar 6 09:42:10 EST 2018


Hi,

Fedora has not yet updated their mingw32 and ming64 packages for PhysicsFS
3, so I’m trying to build it from source on my Fedora 27 cross-compile
build slave. From the mailing list archives, I’ve cobbled together this
toolchain file for CMake:

set(CMAKE_SYSTEM_NAME Windows)
set(CMAKE_INSTALL_PREFIX /usr/i686-w64-ming32/sys-root/mingw)
set(CMAKE_C_COMPILER i686-w64-mingw32-gcc)
set(CMAKE_CXX_COMPILER i686-w64-mingw32-g++)
set(CMAKE_RC_COMPILER i686-w64-mingw32-windres)
set(CMAKE_SHARED_LINKER_FLAGS -static-libgcc ..)
set(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 )
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)

But when I attempt to configure with it:

$ cmake -DCMAKE_TOOLCHAIN_FILE=i686-w64-mingw32.cmake
-- The CXX compiler identification is GNU 7.2.0
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-gcc
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-gcc -- broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:45
(message):
  The C++ compiler

    "/usr/bin/i686-w64-mingw32-gcc"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /home/fedora/Coding/physfs-3.0.1/CMakeFiles/CMakeTmp

    Run Build Command:"/usr/bin/gmake" "cmTC_0d37d/fast"
    /usr/bin/gmake -f CMakeFiles/cmTC_0d37d.dir/build.make
CMakeFiles/cmTC_0d37d.dir/build
    gmake[1]: Entering directory
'/home/fedora/Coding/physfs-3.0.1/CMakeFiles/CMakeTmp'
    Building CXX object CMakeFiles/cmTC_0d37d.dir/testCXXCompiler.cxx.o
    /usr/bin/i686-w64-mingw32-gcc     -o
CMakeFiles/cmTC_0d37d.dir/testCXXCompiler.cxx.o -c
/home/fedora/Coding/physfs-3.0.1/CMakeFiles/CMakeTmp/testCXXCompiler.cxx
    Linking CXX executable cmTC_0d37d
    /usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_0d37d.dir/link.txt
--verbose=1
    /usr/bin/i686-w64-mingw32-gcc       -rdynamic
CMakeFiles/cmTC_0d37d.dir/testCXXCompiler.cxx.o  -o cmTC_0d37d
    i686-w64-mingw32-gcc: error: unrecognized command line option
'-rdynamic'
    gmake[1]: *** [CMakeFiles/cmTC_0d37d.dir/build.make:98: cmTC_0d37d]
Error 1
    gmake[1]: Leaving directory
'/home/fedora/Coding/physfs-3.0.1/CMakeFiles/CMakeTmp'
    gmake: *** [Makefile:126: cmTC_0d37d/fast] Error 2


  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:14 (project)


The generated logs don’t provide anything terribly interesting — literally
just the output above. That -rdynamic flag is throwing a wrench into
things. Any ideas as to where that is coming from, or how to turn it off?
Grepping the directory for it only shows hits in the logs themselves.

Thanks!

-- 
Jay Dolan
508-415-1866
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://icculus.org/pipermail/physfs/attachments/20180306/e184003e/attachment.html>


More information about the physfs mailing list