Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure with static libiberty #494

Open
jeroen opened this issue Dec 13, 2019 · 5 comments
Open

Failure with static libiberty #494

jeroen opened this issue Dec 13, 2019 · 5 comments

Comments

@jeroen
Copy link

jeroen commented Dec 13, 2019

Building -static-gcc toolchain (tested with mingw-w64 v5 and v6):

./build --mode=gcc-8.3.0 --rt-version=v5 --arch=i686 --exceptions=dwarf --static-gcc --threads=posix --enable-languages=c,c++,fortran 

Errors with:

/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/xg++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/ -B/mingw32/i686-w64-mingw32/bin/ -nostdinc++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include  -I/home/jeroen/mingw-gcc-8.3.0/src/gcc-8.3.0/libstdc++-v3/libsupc++ -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../../../src/gcc-8.3.0/gcc -I../../../../src/gcc-8.3.0/gcc/build -I../../../../src/gcc-8.3.0/gcc/../include  -I../../../../src/gcc-8.3.0/gcc/../libcpp/include -I/mingw32/include \
	-o build/genmodes.o ../../../../src/gcc-8.3.0/gcc/genmodes.c
/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/xg++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/ -B/mingw32/i686-w64-mingw32/bin/ -nostdinc++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include  -I/home/jeroen/mingw-gcc-8.3.0/src/gcc-8.3.0/libstdc++-v3/libsupc++ -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs -c   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -I. -Ibuild -I../../../../src/gcc-8.3.0/gcc -I../../../../src/gcc-8.3.0/gcc/build -I../../../../src/gcc-8.3.0/gcc/../include  -I../../../../src/gcc-8.3.0/gcc/../libcpp/include -I/mingw32/include \
	-o build/errors.o ../../../../src/gcc-8.3.0/gcc/errors.c
../../../../src/gcc-8.3.0/gcc/errors.c: In function 'void warning(const char*, ...)':
../../../../src/gcc-8.3.0/gcc/errors.c:50:31: warning: function 'void warning(const char*, ...)' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
   vfprintf (stderr, format, ap);
                               ^
../../../../src/gcc-8.3.0/gcc/errors.c: In function 'void error(const char*, ...)':
../../../../src/gcc-8.3.0/gcc/errors.c:65:31: warning: function 'void error(const char*, ...)' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
   vfprintf (stderr, format, ap);
                               ^
../../../../src/gcc-8.3.0/gcc/errors.c: In function 'void fatal(const char*, ...)':
../../../../src/gcc-8.3.0/gcc/errors.c:82:31: warning: function 'void fatal(const char*, ...)' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
   vfprintf (stderr, format, ap);
                               ^
../../../../src/gcc-8.3.0/gcc/errors.c: In function 'void internal_error(const char*, ...)':
../../../../src/gcc-8.3.0/gcc/errors.c:97:31: warning: function 'void internal_error(const char*, ...)' might be a candidate for 'gnu_printf' format attribute [-Wsuggest-attribute=format]
   vfprintf (stderr, format, ap);
                               ^
/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/xg++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/./prev-gcc/ -B/mingw32/i686-w64-mingw32/bin/ -nostdinc++ -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -B/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include/i686-w64-mingw32  -I/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/include  -I/home/jeroen/mingw-gcc-8.3.0/src/gcc-8.3.0/libstdc++-v3/libsupc++ -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/src/.libs -L/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/prev-i686-w64-mingw32/libstdc++-v3/libsupc++/.libs   -g -O2 -D__USE_MINGW_ACCESS -Wno-pedantic-ms-format -gtoggle -DIN_GCC     -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings   -DHAVE_CONFIG_H -DGENERATOR_FILE -fno-PIE -static-libstdc++ -static-libgcc -Wl,--stack,12582912 -no-pie -o build/genmodes.exe \
    build/genmodes.o build/errors.o .././libiberty/libiberty.a
C:\msys64\home\jeroen\mingw-gcc-8.3.0\i686-830-posix-dwarf-rt_v5-s\mingw32\bin\ld.exe: .././libiberty/libiberty.a(hashtab.o):hashtab.c:(.text+0x10b): undefined reference to `_imp____acrt_iob_func'
C:\msys64\home\jeroen\mingw-gcc-8.3.0\i686-830-posix-dwarf-rt_v5-s\mingw32\bin\ld.exe: .././libiberty/libiberty.a(xmalloc.o):xmalloc.c:(.text+0x34): undefined reference to `_imp____acrt_iob_func'
collect2.exe: error: ld returned 1 exit status
make[3]: *** [Makefile:2869: build/genmodes.exe] Error 1
make[3]: Leaving directory '/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0/gcc'
make[2]: *** [Makefile:4661: all-stage2-gcc] Error 2
make[2]: Leaving directory '/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0'
make[1]: *** [Makefile:22205: stage2-bubble] Error 2
make[1]: Leaving directory '/home/jeroen/mingw-gcc-8.3.0/i686-830-posix-dwarf-rt_v5-s/build/gcc-8.3.0'
make: *** [Makefile:949: all] Error 2
@jeroen jeroen changed the title Failure in i686-830-posix-dwarf-rt_v5-s Failure with static libiberty Dec 13, 2019
@lgka
Copy link

lgka commented Nov 25, 2021

I have the following error regarding libiberty:

Command:
./build --mode=gcc-8.1.0 --arch=x86_64 --buildroot=/home/admin/mingw-builds/root3

Error:

make[3]: Entering directory '/home/admin/mingw-builds/root3/x86_64-810-posix-sjlj-rt_v9/build/gcc-8.1.0/gcc'
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h config/i386/xm-mingw32.h" DEFINES="" \
/bin/sh ../../../../src/gcc-8.1.0/gcc/mkconfig.sh config.h
TARGET_CPU_DEFAULT="" \
HEADERS="options.h insn-constants.h config/vxworks-dummy.h config/i386/biarch64.h config/i386/i386.h config/i386/unix.h config/i386/bsd.h config/i386/gas.h config/dbxcoff.h config/i386/cygming.h config/i386/mingw-pthread.h config/i386/mingw32.h config/i386/mingw-w64.h config/i386/mingw-stdint.h config/initfini-array.h defaults.h" DEFINES="LIBC_GLIBC=1 LIBC_UCLIBC=2 LIBC_BIONIC=3 LIBC_MUSL=4 TARGET_BI_ARCH=1" \
/bin/sh ../../../../src/gcc-8.1.0/gcc/mkconfig.sh tm.h
TARGET_CPU_DEFAULT="" \
HEADERS="config/i386/i386-protos.h tm-preds.h" DEFINES="" \
/bin/sh ../../../../src/gcc-8.1.0/gcc/mkconfig.sh tm_p.h
TARGET_CPU_DEFAULT="" \
HEADERS="auto-host.h ansidecl.h config/i386/xm-mingw32.h" DEFINES="" \
/bin/sh ../../../../src/gcc-8.1.0/gcc/mkconfig.sh bconfig.h
make[3]: *** No rule to make target '../build-x86_64-w64-mingw32/libiberty/pic/libiberty.a', needed by 'build/genmodes.exe'.  Stop.
make[3]: *** Waiting for unfinished jobs....
make[3]: Leaving directory '/home/admin/mingw-builds/root3/x86_64-810-posix-sjlj-rt_v9/build/gcc-8.1.0/gcc'
make[2]: *** [Makefile:4620: all-stage1-gcc] Error 2
make[2]: Leaving directory '/home/admin/mingw-builds/root3/x86_64-810-posix-sjlj-rt_v9/build/gcc-8.1.0'
make[1]: *** [Makefile:22088: stage1-bubble] Error 2
make[1]: Leaving directory '/home/admin/mingw-builds/root3/x86_64-810-posix-sjlj-rt_v9/build/gcc-8.1.0'
make: *** [Makefile:949: all] Error 2

@JohannesKauffmann
Copy link
Contributor

Unfortunately, same issue here with:

./build --mode=gcc-8.2.0 --arch=i686 --exceptions=sjlj --no-multilib --threads=posix --enable-languages=c,c++ --rt-version=v10.0.0

@niXman
Copy link
Owner

niXman commented Oct 11, 2022

is there any reason to build so old version?
could you please try at least 8.5 please? because it was built fine: https://github.com/niXman/mingw-builds-binaries/releases/tag/8.5.0-rt_v10-rev0

@JohannesKauffmann
Copy link
Contributor

JohannesKauffmann commented Oct 11, 2022

8.5 works also here, yes.

Since it is possible to select lower versions, I used it to try and reproduce compiler bugs which have been reported upstream at some project. Sometimes, you are stuck with an older compiler + patch release (e.g. Ubuntu 18.04 LTS with GCC 7.3.0), thats why I try to match their versions to reproduce on Windows also.

So it's not that important to get the 8.2.0 build fixed here, but I thought it'd be nice to report to future readers that this is still a problem with the current revision of the build scripts.

@niXman
Copy link
Owner

niXman commented Oct 20, 2022

got it.

as a option you can try to fix 8.2 because once upon a time that version was successfully built.
I think it is because some changes in GCC configure options... AFAIR 8.4 have the same issue, but 8.5 - no!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants