为Windows构建GCC时如何解决'inline调用always_inline'__builtin_alloca失败'错误

时间:2019-05-04 00:41:45

标签: gcc

我正在使用msys构建适用于Windows 10的GCC 8.3.0,并且构建失败并出现以下错误:

gcc -c -DHAVE_CONFIG_H -g  -I. -I../../source/libiberty/../include  -W -Wall -Wwrite-strings -Wc++-compat -Wstrict-prototypes -Wshadow=local -pedantic  -D_GNU_SOURCE ../../source/libiberty/pex-win32.c -o pex-win32.o
In file included from ../../source/libiberty/pex-common.h:25,
                 from ../../source/libiberty/pex-win32.c:21:
c:\software-development\prebuilt\mingw32\include\alloca.h: In function 'win32_spawn':
../../source/libiberty/../include/libiberty.h:722:20: error: inlining failed in call to always_inline '__builtin_alloca': function not considered for inlining
 # define alloca(x) __builtin_alloca(x)
                    ^~~~~~~~~~~~~~~~
In file included from c:\software-development\prebuilt\mingw32\include\stdlib.h:499,
                 from c:\software-development\prebuilt\mingw32\include\objbase.h:12,
                 from c:\software-development\prebuilt\mingw32\include\ole2.h:9,
                 from c:\software-development\prebuilt\mingw32\include\windows.h:100,
                 from ../../source/libiberty/pex-win32.c:23:
c:\software-development\prebuilt\mingw32\include\alloca.h:62:48: note: called from here
 __CRT_ALIAS void *alloca( size_t __n ){ return __builtin_alloca( __n ); }

是否有一种明智的方法来解决配置中的错误,或解决此问题的某种方法来修补或解决此问题?

这是我当前的配置,从批处理文件运行:

--prefix=/c/software-development/gcc-8.3.0/install-x86_64-w64-mingw32 \
--build=x86_64-w64-mingw32 \
--enable-shared \
--enable-static \
--enable-bootstrap \
--enable-languages=c,c++,lto

构建gcc 8.2.0并猜测构建时发生了相同的错误。我正在使用GNU的MinGW 8.2.0进行构建。

1 个答案:

答案 0 :(得分:0)

尝试在“ C_alloca”上的libiberty.h文件“ __builtin_alloca”中的所有位置进行交换。一处更换。在预处理程序命令中。它帮助了我。