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

2023-11-23

我想在其中构建 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/)。 (AFAICT 这是当前的官方仓库)。

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


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

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


--host=x86_64-linux-gnu  
and

--host=x86_64-pc-linux-gnu  
but no luck.

我收到错误:



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

  

注意:我可以从源代码成功编译本机 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)。

感谢您的所有帮助。


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

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

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

所以我们想离开--build单独,并指定我们希望交叉编译的 Windows 系统--host.

因此,构建 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
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

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

  • linux新手关于嵌入式linux设备驱动的问题

    最近在研究linux驱动 正如我读过的那些文章所说 设备驱动程序模块很可能会根据内核的需要自动加载 因此我想知道内核如何确定为特定设备 声卡 I2C spi 设备 等 我也无法彻底想象内核如何在启动时检测每个硬件设备 与嵌入式linux相关
  • ld: 无法对非 PE 输出文件执行 PE 操作错误

    我是操作系统编程的新手 我正在读一本书 其中给出了一个简单的内核示例 如下所示 main char video memory 0xb8000 video memory X 为了编译这个名为 kernel c 的文件 我在 Windows 7
  • 如何从脚本编辑 /etc/sudoers?

    我需要编辑 etc sudoers从脚本中添加 删除白名单中的内容 假设我有一个可以处理普通文件的命令 我如何将其应用到 etc sudoers 我可以复制并修改它 然后有visudo用修改后的副本替换原始版本 通过提供我自己的脚本 EDI
  • 何时用引号将 shell 变量括起来?

    我应该或不应该在 shell 脚本中用引号括住变量吗 例如 下列说法正确的是 xdg open URL eq 2 or xdg open URL eq 2 如果是这样 为什么 一般规则 如果它可以为空或包含空格 或实际上任何空格 或特殊字符
  • Apache 端口转发 80 到 8080 并访问 Apache (80) 中托管的应用程序,即 phpMyadmin 和 Tomcat (8080)

    我想访问托管在 tomcat 服务器 8080 中的应用程序 myapp 当前可以通过以下方式访问http example com 8080 myapp http example com 8080 myapp in http example
  • 应用程序中两个不同版本的库

    考虑一个场景 其中有两个不同版本的共享库 考虑 A 1 so 链接到 B so A 2 so 链接到 C so 现在 B so 和 C so 都链接到 d exe 当 B so 想要调用 A 1 so 中的函数时 它最终会调用 A 2 so
  • Linux 内核使用的设备树文件 (dtb) 可视化工具? [关闭]

    Closed 这个问题正在寻求书籍 工具 软件库等的推荐 不满足堆栈溢出指南 help closed questions 目前不接受答案 我正在寻找一个可以图形化表示Linux内核中使用的硬件设备树的工具 我正在尝试了解特定 Arm 芯片组
  • Vagrant 遇到问题 - “404 - 未找到”

    我正在尝试使用 Vagrant 制作一个 LAMP 盒子 有人告诉我它使用起来非常简单 我对网络和虚拟机完全陌生 对 Linux Ubuntu 的经验也很少 我目前已尝试按照官方文档页面上的教程进行操作 http docs vagrantu
  • 在ubuntu中打开spyder

    我想在ubuntu中打开spyder Python IDE 通常我会在 shell 中编写 spyder 它会打开spyder IDE 现在 当我在shell中编写spyder时 它只是换行 什么也没有发生 类似于按 enter 我如何找回
  • 为什么 OS X 和 Linux 之间的 UTF-8 文本排序顺序不同?

    我有一个包含 UTF 8 编码文本行的文本文件 mac os x cat unsorted txt foo foo 津 如果它有助于重现问题 这里是文件中确切字节的校验和和转储 以及如何自己生成文件 在 Linux 上 使用base64 d
  • Python glob,操作系统,相对路径,将文件名放入列表中[重复]

    这个问题在这里已经有答案了 我正在尝试创建一个目录中所有文件的列表 其中文件名以 root 结尾 在阅读了论坛中的一些文章后 我尝试使用 glob 和 os listdir 的基本策略 但我都遇到了麻烦 首先 当我使用 import glo
  • Ruby:在 Ubuntu 上安装 rmagick

    我正在尝试在 Ubuntu 10 04 上安装 RMagick 看起来here https stackoverflow com questions 1482823 is there an easy way to install rmagic
  • 为什么此 NASM 代码会打印我的环境变量?

    本学期我刚刚完成计算机体系结构课程 除其他外 我们一直在涉足 MIPS 汇编并在 MARS 模拟器中运行它 今天 出于好奇 我开始在我的 Ubuntu 机器上摆弄 NASM 基本上只是将教程中的内容拼凑起来 并感受一下 NASM 与 MIP
  • 为 Linux 编译 Objective-C 应用程序(API 覆盖范围)

    我可能在这里问一些奇怪的问题 但我不确定从哪里开始 问题是我正在考虑使用 Obj C 和 Foundation 类在 Mac 上编写一个命令行工具 但存在一个非常大的风险 那就是我希望能够为不同的 Linux 发行版编译它 以便将来作为服务
  • Linux无法删除文件

    当我找到文件时 我在删除它们时遇到问题 任务 必须找到带有空格的文件并将其删除 我的尝试 rm find L root grep i 但我有错误 rm cannot remove root test No such file or dire
  • 在汇编中使用 printf 会导致管道传输时输出为空,但可以在终端上使用

    无输出 https stackoverflow com questions 54507957 printf call from assembly do not print to stdout即使在终端上 当输出不包含换行符时也有相同的原因
  • Linux 使用 boost asio 拒绝套接字绑定权限

    我在绑定套接字时遇到问题 并且以用户身份运行程序时权限被拒绝 这行代码会产生错误 acceptor new boost asio ip tcp acceptor io boost asio ip tcp endpoint boost asi
  • 在 docker 中重定向命令输出

    我想为我的服务器做一些简单的日志记录 它是一个在 Docker 容器中运行的小型 Flask 应用程序 这是 Dockerfile Dockerfile FROM dreen flask MAINTAINER dreen WORKDIR s
  • 相当于Linux中的导入库

    在 Windows C 中 当您想要链接 DLL 时 您必须提供导入库 但是在 GNU 构建系统中 当您想要链接 so 文件 相当于 dll 时 您就不需要链接 为什么是这样 是否有等效的 Windows 导入库 注意 我不会谈论在 Win
  • 如何使用 JSch 将多行命令输出存储到变量中

    所以 我有一段很好的代码 我很难理解 它允许我向我的服务器发送命令 并获得一行响应 该代码有效 但我想从服务器返回多行 主要类是 JSch jSch new JSch MyUserInfo ui new MyUserInfo String

随机推荐

  • 如何在Java中从客户端获取uuid或mac地址?

    我正在寻找一种基于 Java 的 Web 应用程序的解决方案来唯一标识客户端 服务器与客户端位于同一网络中 我认为使用 MAC 地址将是一个很好的解决方案 问题是我无法使用 cookie 因为它们可以在客户端删除 而且我无法使用 IP 因为
  • 如何针对不同屏幕动态设置textview的文本大小[重复]

    这个问题在这里已经有答案了 我正在创建一个文本视图并动态添加到布局中 我在用textView setTextSize 18 设置文本大小的方法 我在三星平板电脑上测试了它 发现字体大小对于这个屏幕来说太小 然后我将文本大小更改为25 但对于
  • 保存 ML 模型以供将来使用

    我正在将一些机器学习算法 如线性回归 逻辑回归和朴素贝叶斯 应用于一些数据 但我试图避免使用 RDD 并开始使用 DataFrame 因为RDD 速度较慢比 pyspark 下的数据帧 见图 1 我使用 DataFrames 的另一个原因是
  • [NSMutableArray objectAtIndex:]:索引 0 超出 AVURLAsset 中空数组的范围

    我尝试使用以下代码来合并音频 AVMutableComposition composition AVMutableComposition composition AVURLAsset videoAsset AVURLAsset alloc
  • spring data JPA如何决定调用entityManager.persist(…)或entityManager.merge(…)方法

    当entityManager persist 方法被调用时以及当entityManager merge 在spring data jpa中被调用时 根据文档 如果实体尚未持久化 Spring Data JPA将通过调用entityManag
  • 实体框架(首先是数据库)存储过程的返回结果不正确[重复]

    这个问题在这里已经有答案了 环境 视觉工作室 2017 SQL Server 2016 采用数据库优先方法的 EF v6 背景 存储过程位于EDMX中 如果没有发生任何事情 我的存储过程将返回值设置为 0 如果有任何影响 则将返回值设置为
  • 当使用“L'Ecuyer-CMRG”RNG 时,R 不会重置种子?

    我在 R 中做了一些并行模拟 我注意到种子 使用 L Ecuyer CMRG rng 时不会更改 我正在读书 Parallel R 一书 选项 mc set seed TRUE 应该给出 每次调用 mclapply 时 每个工作人员都会获得
  • 无法解码下载的字体

    这是我在 Chrome 中遇到的错误 不幸的是搜索它并没有给我太多结果 字体本身显示正确 但是我仍然收到此错误 警告 更具体地说 这是完整的警告 无法解码下载的字体 http localhost 8000 app fonts Lato 我的
  • Excel VBA 列出键绑定(OnKey ?)

    我正在使用大量 Excel vba 脚本 其中一些脚本绑定到 Ctrl 键组合 我知道如何在 Excel 的用户界面中一次设置一个 拉出 vba 脚本列表 Alt F8 选择一个脚本 然后单击 选项 然后您可以将脚本绑定 取消绑定到 Ctr
  • 如何在 MVC 5 中搭建视图模型

    我正在尝试开发一个简单的应用程序 我通过实体框架引入了三个 SQL 表 并自动创建了模型 我希望能够在 Visual Studio 中自动构建创建 详细信息 编辑等视图 当我从单个模型 例如单独的名称 搭建支架时 我可以自动执行此操作 但在
  • Solr 中的词频

    我正在尝试使用 solr 获取单词的频率 当我给出这个查询时 localSolr solr select q someQuery rows 0 facet true facet field content wt xml solr 给我类似的
  • Javascript:如何使用 Promise 迭代数组?

    LIVE DEMO 给定以下函数 function isGood number var defer q defer timeout function if
  • Python - 何时使用文件与打开

    有什么区别file and open在Python中 我什么时候应该使用哪一个 假设我在2 5 你应该总是使用open As the 文档 states 打开文件时 最好 使用 open 而不是调用它 直接构造函数 文件较多 适合型式测试
  • 如何在 web.sitemap 中实现本地化

    您能解释一下如何在 web sitemap 中实现本地化吗 如果你有全球资源 你可以这样使用它
  • 使用 rpart.plot 功能绘制 ctree

    一直在尝试使用rpart plot包来绘制ctree来自partykit图书馆 原因是当树很深时 默认的绘图方法很糟糕 就我而言 我的max depth 5 我真的很喜欢rpart plot的输出 因为它允许更深的树在视觉上更好地显示 输出
  • 使用正则表达式 LtKit 在地图视图上绘制路线时出错

    在我的 iPhone 项目之一中 我使用 RegexLiteKit 在地图视图中绘制路线 编译时显示以下失败 Undefined symbols for architecture i386 uregex start referenced f
  • 在 OS X Mavericks 上安装 Calabash-Android 会导致错误

    我需要一些帮助来尝试安装 Calabash Android 安装 rvm home brew 后 当我安装 Calabash 时 出现一个奇怪的错误 sudo gem install calabash android Building na
  • 如何清除要垃圾收集的对象(HashMap) - Java

    所以我这里有一个java程序 它操作大量数据并将其存储到对象中 主要是哈希映射 在运行时的某个时刻 数据变得无用 我需要丢弃 以便释放一些内存 我的问题是丢弃这些要进行垃圾收集的数据的最佳行为是什么 我已经尝试过map clear 但这不足
  • 如何在 Meteor 中使用 jQuery UI?

    在 Meteor 应用程序中安装 jQuery UI 的正确方法是什么 由于它还不是一个包 我将下载中的 jquery ui min js 和 jquery 1 8 3 js 添加到lib我的流星项目中的文件夹 这导致了以下致命错误 You
  • 配置在 linux-64 上为 linux-64 构建 MinGW-64 的选项(最终针对 windows-64)

    我想在其中构建 MinGW w64 A 我想在Linux 64位 上编译MinGW本身 B 我希望 MinGW 工具 编译器等 在 Linux 64 位 上运行 C 我希望 MinGW 工具 编译器等 生成在 Windows 64 位 Wi