Skip to content

lto-wrapper.exe: fatal error: gcc returned 1 exit status #4

@liudonghua123

Description

@liudonghua123

I followed the instructions on readme, but I got the following error.

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$ make LDEXPORT="-Wl,-static,-s" LDEXTRAS="-Wl,-static,-s"
x86_64-w64-mingw32-gcc -g -Wall -MMD -MF .obj/quickjs.check.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -DCONFIG_CHECK_JSVALUE -c -o .obj/quickjs.check.o quickjs.c
x86_64-w64-mingw32-gcc -g -Wall -MMD -MF .obj/qjs.check.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -DCONFIG_CHECK_JSVALUE -c -o .obj/qjs.check.o qjs.c
qjs.c: In function 'js_trace_malloc_printf':
qjs.c:152:35: warning: unknown conversion type character 'l' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                   ^
qjs.c:152:39: warning: unknown conversion type character 'z' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                       ^
qjs.c:152:28: warning: too many arguments for format [-Wformat-extra-args]
                     printf("H%+06lld.%zd",
                            ^~~~~~~~~~~~~~
qjs.c:152:35: warning: unknown conversion type character 'l' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                   ^
qjs.c:152:39: warning: unknown conversion type character 'z' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                       ^
qjs.c:152:28: warning: too many arguments for format [-Wformat-extra-args]
                     printf("H%+06lld.%zd",
                            ^~~~~~~~~~~~~~
qjs.c:161:26: warning: unknown conversion type character 'z' in format [-Wformat=]
                 printf("%zd", sz);
                          ^
qjs.c:161:24: warning: too many arguments for format [-Wformat-extra-args]
                 printf("%zd", sz);
                        ^~~~~
qjs.c:161:26: warning: unknown conversion type character 'z' in format [-Wformat=]
                 printf("%zd", sz);
                          ^
qjs.c:161:24: warning: too many arguments for format [-Wformat-extra-args]
                 printf("%zd", sz);
                        ^~~~~
qjs.c: In function 'js_trace_malloc':
qjs.c:186:35: warning: unknown conversion type character 'z' in format [-Wformat=]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                                   ^
qjs.c:186:42: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                                         ~^     ~~~~
                                         %I64d
qjs.c:186:31: warning: too many arguments for format [-Wformat-extra-args]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                               ^~~~~~~~~~~~~~~
qjs.c: In function 'js_trace_realloc':
qjs.c:216:39: warning: unknown conversion type character 'z' in format [-Wformat=]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                       ^
qjs.c:216:43: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                          ~^     ~~~~
                                          %I64d
qjs.c:216:35: warning: too many arguments for format [-Wformat-extra-args]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                   ^~~~~~~~~~~~
qjs.c:225:35: warning: unknown conversion type character 'z' in format [-Wformat=]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                                   ^
qjs.c:225:39: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                                      ~^   ~~~~
                                      %I64d
qjs.c:225:31: warning: too many arguments for format [-Wformat-extra-args]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                               ^~~~~~~~~~
x86_64-w64-mingw32-gcc -g -Wall -MMD -MF .obj/qjs.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/qjs.o qjs.c
qjs.c: In function 'js_trace_malloc_printf':
qjs.c:152:35: warning: unknown conversion type character 'l' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                   ^
qjs.c:152:39: warning: unknown conversion type character 'z' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                       ^
qjs.c:152:28: warning: too many arguments for format [-Wformat-extra-args]
                     printf("H%+06lld.%zd",
                            ^~~~~~~~~~~~~~
qjs.c:152:35: warning: unknown conversion type character 'l' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                   ^
qjs.c:152:39: warning: unknown conversion type character 'z' in format [-Wformat=]
                     printf("H%+06lld.%zd",
                                       ^
qjs.c:152:28: warning: too many arguments for format [-Wformat-extra-args]
                     printf("H%+06lld.%zd",
                            ^~~~~~~~~~~~~~
qjs.c:161:26: warning: unknown conversion type character 'z' in format [-Wformat=]
                 printf("%zd", sz);
                          ^
qjs.c:161:24: warning: too many arguments for format [-Wformat-extra-args]
                 printf("%zd", sz);
                        ^~~~~
qjs.c:161:26: warning: unknown conversion type character 'z' in format [-Wformat=]
                 printf("%zd", sz);
                          ^
qjs.c:161:24: warning: too many arguments for format [-Wformat-extra-args]
                 printf("%zd", sz);
                        ^~~~~
qjs.c: In function 'js_trace_malloc':
qjs.c:186:35: warning: unknown conversion type character 'z' in format [-Wformat=]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                                   ^
qjs.c:186:42: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                                         ~^     ~~~~
                                         %I64d
qjs.c:186:31: warning: too many arguments for format [-Wformat-extra-args]
     js_trace_malloc_printf(s, "A %zd -> %p\n", size, ptr);
                               ^~~~~~~~~~~~~~~
qjs.c: In function 'js_trace_realloc':
qjs.c:216:39: warning: unknown conversion type character 'z' in format [-Wformat=]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                       ^
qjs.c:216:43: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                          ~^     ~~~~
                                          %I64d
qjs.c:216:35: warning: too many arguments for format [-Wformat-extra-args]
         js_trace_malloc_printf(s, "R %zd %p\n", size, ptr);
                                   ^~~~~~~~~~~~
qjs.c:225:35: warning: unknown conversion type character 'z' in format [-Wformat=]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                                   ^
qjs.c:225:39: warning: format '%p' expects argument of type 'void *', but argument 3 has type 'size_t' {aka 'long long unsigned int'} [-Wformat=]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                                      ~^   ~~~~
                                      %I64d
qjs.c:225:31: warning: too many arguments for format [-Wformat-extra-args]
     js_trace_malloc_printf(s, "R %zd %p", size, ptr);
                               ^~~~~~~~~~
gcc -g -Wall -MMD -MF .obj/qjsc.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -DCONFIG_CC=\"gcc\" -DCONFIG_PREFIX=\"/usr/local\" -O2 -flto -c -o .obj/qjsc.host.o qjsc.c
gcc -g -Wall -MMD -MF .obj/quickjs.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/quickjs.host.o quickjs.c
gcc -g -Wall -MMD -MF .obj/libregexp.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/libregexp.host.o libregexp.c
gcc -g -Wall -MMD -MF .obj/libunicode.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/libunicode.host.o libunicode.c
gcc -g -Wall -MMD -MF .obj/cutils.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/cutils.host.o cutils.c
gcc -g -Wall -MMD -MF .obj/quickjs-libc.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/quickjs-libc.host.o quickjs-libc.c
gcc -g -Wall -MMD -MF .obj/libbf.host.o.d -Wno-array-bounds -Wno-format-truncation -D_GNU_SOURCE -DCONFIG_VERSION=\"2020-03-16\" -DCONFIG_BIGNUM -O2 -flto -c -o .obj/libbf.host.o libbf.c
gcc -g -flto -Wl,-static,-s -o host-qjsc .obj/qjsc.host.o .obj/quickjs.host.o .obj/libregexp.host.o .obj/libunicode.host.o .obj/cutils.host.o .obj/quickjs-libc.host.o .obj/libbf.host.o -lm
lto1.exe: internal compiler error: in gen_subprogram_die, at dwarf2out.c:22682
libbacktrace could not find executable to open
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://sourceforge.net/projects/msys2> for instructions.
lto-wrapper.exe: fatal error: gcc returned 1 exit status
compilation terminated.
C:/msys32/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe: error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status
mingw32-make: *** [Makefile:203: host-qjsc] Error 1

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$
Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$ which make
/mingw64/bin/make

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$ cat `which make`
#! /bin/sh
"mingw32-make" "$@"

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$ gcc -v
Using built-in specs.
COLLECT_GCC=C:\msys32\mingw64\bin\gcc.exe
COLLECT_LTO_WRAPPER=C:/msys32/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.2.0/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: ../gcc-8.2.0/configure --prefix=/mingw64 --with-local-prefix=/mingw64/local --build=x86_64-w64-mingw32 --host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --with-native-system-header-dir=/mingw64/x86_64-w64-mingw32/include --libexecdir=/mingw64/lib --enable-bootstrap --with-arch=x86-64 --with-tune=generic --enable-languages=ada,c,lto,c++,objc,obj-c++,fortran --enable-shared --enable-static --enable-libatomic --enable-threads=posix --enable-graphite --enable-fully-dynamic-string --enable-libstdcxx-filesystem-ts=yes --enable-libstdcxx-time=yes --disable-libstdcxx-pch --disable-libstdcxx-debug --disable-isl-version-check --enable-lto --enable-libgomp --disable-multilib --enable-checking=release --disable-rpath --disable-win32-registry --disable-nls --disable-werror --disable-symvers --with-libiconv --with-system-zlib --with-gmp=/mingw64 --with-mpfr=/mingw64 --with-mpc=/mingw64 --with-isl=/mingw64 --with-pkgversion='Rev3, Built by MSYS2 project' --with-bugurl=https://sourceforge.net/projects/msys2 --with-gnu-as --with-gnu-ld
Thread model: posix
gcc version 8.2.0 (Rev3, Built by MSYS2 project)

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$ make -v
GNU Make 4.2.1
Built for x86_64-w64-mingw32
Copyright (C) 1988-2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Liu.D.H@DESKTOP-KA8TQF4 MINGW64 ~/quickjs/QuickJS-Windows-Build
$

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions