gpt4 book ai didi

linux - 配置在 linux-64 上为 linux-64 构建 MinGW-64 的选项(最终针对 windows-64)

转载 作者:行者123 更新时间:2023-12-03 00:31:18 26 4
gpt4 key购买 nike

我想在以下位置构建 MinGW-w64:

A:我想在 Linux(64 位)上编译 MinGW 本身。
B:我希望 MinGW 工具(编译器等)能够在 Linux(64 位)上运行。
C:我希望 MinGW 工具(编译器等)生成在 Windows 64 位(Win7 和 Win8)上运行的代码。

我在配置阶段遇到问题。我用谷歌搜索了一下,但找不到我需要传递哪些选项来配置。

我已经从 ( https://svn.code.sf.net/p/mingw-w64/code/trunk/ ) 下载了 MinGW-w64 SVN 的源代码。(AFAICT 这是当前的官方存储库)。

源代码有文本帮助(mingw-w64-doc/howto-build/mingw-w64-howto-build.txt)。然而,这主要适用于那些想要在 Windows 上运行 MinGW 工具的人。
示例选项(对于非 multilib w64 目标)为:

--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disable-multilib

但我想我希望主机选项指的是linux(对吗?)。我已经尝试过

--host=x86_64-linux-gnu
--host=x86_64-pc-linux-gnu
但运气不佳。

我收到错误:

configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.
configure: error: ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure failed for mingw-w64-crt

完整日志为

    checking whether to enable maintainer-specific portions of Makefiles... no    checking for a BSD-compatible install... /usr/bin/install -c    checking whether build environment is sane... yes    /make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/build-aux/missing: Unknown `--is-lightweight' option    Try `/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/build-aux/missing --help' for more information    configure: WARNING: 'missing' script is too old or missing    checking for x86_64-linux-gnu-strip... no    checking for strip... strip    checking for a thread-safe mkdir -p... /bin/mkdir -p    checking for gawk... gawk    checking whether make sets $(MAKE)... yes    checking whether make supports nested variables... yes    checking build system type... x86_64-unknown-linux-gnu    checking host system type... x86_64-pc-linux-gnu    checking whether to build the headers... yes    checking whether to build the crt... yes    checking whether to build the optional libraries... no    checking whether to build the optional tools... no    checking that generated files are newer than configure... done    configure: creating ./config.status    config.status: creating Makefile    config.status: creating config.h    config.status: config.h is unchanged    === configuring in mingw-w64-headers (/make/tool/MinGW/build/v6615-2014-05-07/mingw-w64-headers)    configure: running /bin/bash ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/configure --disable-option-checking '--prefix=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32'  '--target=x86_64-w64-mingw32' '--host=x86_64-linux-gnu' '--disable-multilib' '--with-sysroot=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' 'host_alias=x86_64-linux-gnu' 'target_alias=x86_64-w64-mingw32' --cache-file=/dev/null --srcdir=../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers    checking for a BSD-compatible install... /usr/bin/install -c    checking whether build environment is sane... yes    /make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/build-aux/missing: Unknown `--is-lightweight' option    Try `/make/tool/MinGW/svn/mingw-w64-v6615-2014-05-07/mingw-w64-headers/build-aux/missing --help' for more information    configure: WARNING: 'missing' script is too old or missing    checking for x86_64-linux-gnu-strip... no    checking for strip... strip    checking for a thread-safe mkdir -p... /bin/mkdir -p    checking for gawk... gawk    checking whether make sets $(MAKE)... yes    checking whether make supports nested variables... yes    checking whether to enable maintainer-specific portions of Makefiles... no    checking build system type... x86_64-unknown-linux-gnu    checking host system type... x86_64-pc-linux-gnu    checking for a sed that does not truncate output... /bin/sed    checking whether to rebuild headers with widl... no    checking whether to build a w32api package for Cygwin... no    checking for c-runtime headers... yes    checking for optional sdk headers... ddk,directx    checking if installing idl files is enabled... no    checking whether to enable the secure API... no    checking that generated files are newer than configure... done    configure: creating ./config.status    config.status: creating Makefile    config.status: creating crt/_mingw.h    config.status: creating config.h    config.status: config.h is unchanged    === configuring in mingw-w64-crt (/make/tool/MinGW/build/v6615-2014-05-07/mingw-w64-crt)    configure: running /bin/bash ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure --disable-option-checking '--prefix=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32'  '--target=x86_64-w64-mingw32' '--host=x86_64-linux-gnu' '--disable-multilib' '--with-sysroot=/make/tool/MinGW/use/v6615/x86_64-w64-mingw32' 'host_alias=x86_64-linux-gnu' 'target_alias=x86_64-w64-mingw32' --cache-file=/dev/null --srcdir=../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt    checking for a BSD-compatible install... /usr/bin/install -c    checking whether build environment is sane... yes    checking for x86_64-linux-gnu-strip... no    checking for strip... strip    checking for a thread-safe mkdir -p... /bin/mkdir -p    checking for gawk... gawk    checking whether make sets $(MAKE)... yes    checking whether make supports nested variables... yes    checking whether to enable maintainer-specific portions of Makefiles... no    checking build system type... x86_64-unknown-linux-gnu    checking host system type... x86_64-pc-linux-gnu    checking for sysroot... /make/tool/MinGW/use/v6615/x86_64-w64-mingw32    checking for a sed that does not truncate output... /bin/sed    checking for gawk... (cached) gawk    checking for x86_64-linux-gnu-gcc... x86_64-linux-gnu-gcc    checking whether the C compiler works... yes    checking for C compiler default output file name... a.out    checking for suffix of executables...     checking whether we are cross compiling... no    checking for suffix of object files... o    checking whether we are using the GNU C compiler... yes    checking whether x86_64-linux-gnu-gcc accepts -g... yes    checking for x86_64-linux-gnu-gcc option to accept ISO C89... none needed    checking whether x86_64-linux-gnu-gcc understands -c and -o together... yes    checking for style of include used by make... GNU    checking dependency style of x86_64-linux-gnu-gcc... gcc3    checking for x86_64-linux-gnu-g++... x86_64-linux-gnu-g++    checking whether we are using the GNU C++ compiler... yes    checking whether x86_64-linux-gnu-g++ accepts -g... yes    checking dependency style of x86_64-linux-gnu-g++... gcc3    checking how to run the C preprocessor... x86_64-linux-gnu-gcc -E    checking for x86_64-linux-gnu-ranlib... no    checking for ranlib... ranlib    checking for x86_64-linux-gnu-dlltool... no    checking for dlltool... no    checking for x86_64-linux-gnu-ar... no    checking for x86_64-linux-gnu-lib... no    checking for x86_64-linux-gnu-link... no    checking for ar... ar    checking the archiver (ar) interface... ar    checking dependency style of x86_64-linux-gnu-gcc... gcc3    checking for x86_64-linux-gnu-as... no    checking for as... as    checking whether to build a w32api package for Cygwin... no    checking whether to build the Win32 libraries... no    checking whether to build the Win64 libraries... yes    checking whether to build the WinCE libraries... no    checking whether to enable globbing... no    checking whether to enable private exports... no    checking whether to enable delay import libs... no    checking whether to enable experimental features... no    checking whether the compiler supports -municode... no    checking for grep that handles long lines and -e... /bin/grep    checking for egrep... /bin/grep -E    checking for ANSI C header files... yes    checking for sys/types.h... yes    checking for sys/stat.h... yes    checking for stdlib.h... yes    checking for string.h... yes    checking for memory.h... yes    checking for strings.h... yes    checking for inttypes.h... yes    checking for stdint.h... yes    checking for unistd.h... yes    checking _mingw_mac.h usability... no    checking _mingw_mac.h presence... no    checking for _mingw_mac.h... no    configure: error: Please check if the mingw-w64 header set and the build/host option are set properly.    configure: error: ../../../svn/mingw-w64-v6615-2014-05-07/mingw-w64-crt/configure failed for mingw-w64-crt

注意:我可以从源代码成功编译 native GCC 和 Clang。

目的:我的最终目标是使用最新的 Clang 为 Windows 7/8 64 位(包括 D3D11 和 OpenGL)生成 C++14 代码。
我想构建主干 MinGW,因为最新的 Clang 生成默认 MinGW 无法汇编的汇编代码(主要是“行尾垃圾”错误)。
截至 2014 年 5 月 7 日(今天),只有 Clang 提供完整的 C++14 支持,并且我正在使用仅在 Clang 中可用的功能(例如:变量模板)。
然而,Clang 依赖 GCC/MinGW 进行组装和链接。

信息:操作系统:Linux Mint 16 64 位 (XFCE)。

感谢您的所有帮助。

最佳答案

老问题,但答案可能对来自 Google 的人有所帮助。

主机和构建标志有点误导。 mingw-w64-crt/configure --help 帮助页面中的信息显示:

System types:
--build=BUILD configure for building on BUILD [guessed]
--host=HOST cross-compile to build programs to run on HOST [BUILD]

因此,我们希望保留 --build ,并使用 --host 指定我们希望交叉编译的 Windows 系统。

因此,构建 64 位 Windows 并包含 32 位和 64 位库以及 std::experimental 功能的方法是:

./configure --enable-lib32 --enable-lib64 --enable-experimental --host=x86_64-w64-mingw32

如果你想为 32 位 Windows 构建,这非常相似,但当然你不能启用 64 位模式:

./configure --enable-lib32 --enable-experimental --host=i686-w64-mingw32

关于linux - 配置在 linux-64 上为 linux-64 构建 MinGW-64 的选项(最终针对 windows-64),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23515168/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com