[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#796901: fails to build stage1 cross compiler for kfreebsd-any



Source: gcc-5
Version: 5.1.1-13
Tags: patch
User: helmutg@debian.org
Usertags: rebootstrap

Trying to build a stage1 cross compiler for kfreebsd-any, e.g.
kfreebsd-amd64 fails with the following error:

>From https://jenkins.debian.net/job/rebootstrap_kfreebsd-amd64_gcc5/2/console
| /tmp/buildd/gcc1/gcc-5-5.2.1/build/./gcc/xgcc -B/tmp/buildd/gcc1/gcc-5-5.2.1/build/./gcc/ -B/usr/x86_64-kfreebsd-gnu/bin/  -B/usr/x86_64-kfreebsd-gnu/lib32/ -isystem /usr/x86_64-kfreebsd-gnu/include -isystem /usr/x86_64-kfreebsd-gnu/sys-include -isystem /tmp/buildd/gcc1/gcc-5-5.2.1/build/sys-include    -g -O2 -m32 -O2  -g -O2 -DIN_GCC  -DCROSS_DIRECTORY_STRUCTURE  -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wold-style-definition  -isystem ./include   -fpic -mlong-double-80 -g -DIN_LIBGCC2 -fbuilding-libgcc -fno-stack-protector -Dinhibit_libc  -fpic -mlong-double-80 -I. -I. -I../../.././gcc -I../../../../src/libgcc -I../../../../src/libgcc/. -I../../../../src/libgcc/../gcc -I../../../../src/libgcc/../include  -DHAVE_CC_TLS  -DUSE_TLS -o unwind-dw2.o -MT unwind-dw2.o -MD -MP -MF unwind-dw2.dep -fexceptions -c ../../../../src/libgcc/unwind-dw2.c -fvisibility=hidden -DHIDE_EXPORTS
| In file included from ../../../../src/libgcc/unwind-dw2.c:401:0:
| ./md-unwind-support.h:29:23: fatal error: sys/types.h: No such file or directory
| compilation terminated.
| ../../../../src/libgcc/static-object.mk:17: recipe for target 'unwind-dw2.o' failed
| make[6]: *** [unwind-dw2.o] Error 1
| make[6]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1/build/x86_64-kfreebsd-gnu/32/libgcc'
| Makefile:1154: recipe for target 'multi-do' failed
| make[5]: *** [multi-do] Error 1
| make[5]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1/build/x86_64-kfreebsd-gnu/libgcc'
| Makefile:117: recipe for target 'all-multi' failed
| make[4]: *** [all-multi] Error 2
| make[4]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1/build/x86_64-kfreebsd-gnu/libgcc'
| Makefile:10662: recipe for target 'all-target-libgcc' failed
| make[3]: *** [all-target-libgcc] Error 2
| make[3]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1/build'
| Makefile:852: recipe for target 'all' failed
| make[2]: *** [all] Error 2
| make[2]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1/build'
| s=`cat status`; rm -f status; test $s -eq 0
| debian/rules2:1169: recipe for target 'stamps/05-build-stamp' failed
| make[1]: *** [stamps/05-build-stamp] Error 1
| make[1]: Leaving directory '/tmp/buildd/gcc1/gcc-5-5.2.1'
| debian/rules:52: recipe for target 'stamps/05-build-stamp' failed
| make: *** [stamps/05-build-stamp] Error 2

This is a regression introduced in gcc-5 svn revision 8143 which amounts
to version 5.1.1-13. It updates the patch stack for a new gcc-5 release
and thus updates debian/patches/kfreebsd-unwind.diff. The mentioned
patch drops the creation of src/libgcc/config/i386/freebsd-unwind.h,
because that file was upstreamed.

Well almost that is. What was upstreamed is different from what was
removed from packaging patches. In particular the "#ifndef inhibit_libc"
that was present in the Debian patch was dropped upstream. However it
was what made the stage1 build work.

I therefore propose appending the attached patch to
debian/patches/kfreebsd-unwind.diff.

Thanks to Steven Chamberlain for his help to sort this out.

Helmut
--- a/src/libgcc/config/i386/freebsd-unwind.h
+++ a/src/libgcc/config/i386/freebsd-unwind.h
@@ -26,6 +26,8 @@
 /* Do code reading to identify a signal frame, and set the frame
    state data appropriately.  See unwind-dw2.c for the structs. */

+#ifndef inhibit_libc
+
 #include <sys/types.h>
 #include <signal.h>
 #include <sys/ucontext.h>
@@ -171,3 +171,5 @@
   return _URC_NO_REASON;
 }
 #endif /* ifdef __x86_64__  */
+
+#endif /* ifndef inhibit_libc */

Reply to: