Bug#881939: gcc: disable D when cross build native GCC
On Thu, 16 Nov 2017 20:45:44 +0100 Iain Buclaw wrote: > On 16 November 2017 at 20:34, YunQiang Su wrote: > > Package: src:gcc-7 > > Version: 7.2.0-16 > > > > When we build native GCC with the cross gcc, D will always fails. > > So please disable D in this condition. > > > > @@ -891,6 +926,12 @@ ifeq ($(with_base_only),yes > >with_d := no > > endif > > > > +ifneq ($(DEB_BUILD_ARCH), $(DEB_HOST_ARCH)) > > +ifeq ($(DEB_HOST_ARCH), $(DEB_TARGET_ARCH)) > > + with_d := no > > +endif > > +endif > > + > > ifeq ($(with_d)-$(with_separate_gdc),yes-yes) > >ifneq (,$(findstring gdc,$(PKGSOURCE))) > > languages := c c++ > > > > Out of interest, why/how does it fail? It need to a object file twice, one time for native, one time for cross. To solve this problem, I guess we need to do lots of work to improve the build system of D. > > Iain. > >
Bug#881939: gcc: disable D when cross build native GCC
On 16 November 2017 at 20:34, YunQiang Su wrote: > Package: src:gcc-7 > Version: 7.2.0-16 > > When we build native GCC with the cross gcc, D will always fails. > So please disable D in this condition. > > @@ -891,6 +926,12 @@ ifeq ($(with_base_only),yes >with_d := no > endif > > +ifneq ($(DEB_BUILD_ARCH), $(DEB_HOST_ARCH)) > +ifeq ($(DEB_HOST_ARCH), $(DEB_TARGET_ARCH)) > + with_d := no > +endif > +endif > + > ifeq ($(with_d)-$(with_separate_gdc),yes-yes) >ifneq (,$(findstring gdc,$(PKGSOURCE))) > languages := c c++ > Out of interest, why/how does it fail? Iain.
Re: Hurd port for gcc-7 go PATCH 1-3(15)
On Thu, 2017-11-16 at 14:12 +0100, Svante Signell wrote: > On Wed, 2017-11-15 at 21:54 +0100, Svante Signell wrote: > > > > Attached is an updated patch for gcc-7. An updated patch for gcc-8 will follow > shortly when I have build tested gcc-8 go on both Linux and Hurd. > > The patch for src/libgo/mksysinfo.sh worked fine in gcc-5 and gcc-6. The > problem is that in gcc-7 and gcc-8 generation of build/ triplet>/libgo/sysinfo.go is made differently. Well, in gcc-5 and gcc-6 the gccgo patches in debian/rules.patch are conditional, and were not in gcc-7-7.2.0-15. In gcc-7-7.2.0-16 they are conditional again. > The Hurd-specific entry about SYS_IOCTL had to be moved after: > > # The syscall numbers. We force the names to upper case. > grep '^const _SYS_' gen-sysinfo.go | \ > sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \ > while read sys; do > sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` > echo "const $sup = _$sys" >> ${OUT} > done For completeness updated patches for gcc-6 and gcc-8 are attached. gcc-6-6.4.0-10: src_libgo_mksysinfo.sh.diff gcc-8-8-20171108-1: srs_libgo_build.diff And thank you for finding the bug in the patches by making them (temporarily) unconditional. Thanks!Index: gcc-6-6.4.0/src/libgo/mksysinfo.sh === --- gcc-6-6.4.0.orig/src/libgo/mksysinfo.sh +++ gcc-6-6.4.0/src/libgo/mksysinfo.sh @@ -304,6 +304,13 @@ echo '#include ' | ${CC} -x c - egrep '#define E[A-Z0-9_]+ ' | \ sed -e 's/^#define \(E[A-Z0-9_]*\) .*$/const \1 = Errno(_\1)/' >> ${OUT} +# Special treatment of EWOULDBLOCK for GNU/Hurd +# /usr/include/bits/errno.h: #define EWOULDBLOCK EAGAIN +if egrep 'define EWOULDBLOCK EAGAIN' gen-sysinfo.go > /dev/null 2>&1; then + egrep '^const EWOULDBLOCK = Errno(_EWOULDBLOCK)' ${OUT} | \ +sed -i -e 's/_EWOULDBLOCK/_EAGAIN/' ${OUT} +fi + # The O_xxx flags. egrep '^const _(O|F|FD)_' gen-sysinfo.go | \ sed -e 's/^\(const \)_\([^= ]*\)\(.*\)$/\1\2 = _\2/' >> ${OUT} @@ -362,6 +369,11 @@ grep '^const _SYS_' gen-sysinfo.go | \ echo "const $sup = _$sys" >> ${OUT} done +# Special treatment of SYS_IOCTL for GNU/Hurd +if ! grep '^const SYS_IOCTL' ${OUT} > /dev/null 2>&1; then + echo "const SYS_IOCTL = 0" >> ${OUT} +fi + # The GNU/Linux support wants to use SYS_GETDENTS64 if available. if ! grep '^const SYS_GETDENTS ' ${OUT} >/dev/null 2>&1; then echo "const SYS_GETDENTS = 0" >> ${OUT} @@ -676,6 +688,11 @@ grep '^type _tms ' gen-sysinfo.go | \ # The stat type. # Prefer largefile variant if available. +# Special treatment of st_dev for GNU/Hurd +# /usr/include/i386-gnu/bits/stat.h: #define st_dev st_fsid +if grep 'define st_dev st_fsid' gen-sysinfo.go > /dev/null 2>&1; then + sed -i -e 's/; st_fsid/; st_dev/' gen-sysinfo.go +fi stat=`grep '^type _stat64 ' gen-sysinfo.go || true` if test "$stat" != ""; then grep '^type _stat64 ' gen-sysinfo.go Index: gcc-8-8-20171108/src/libgo/configure.ac === --- gcc-8-8-20171108.orig/src/libgo/configure.ac +++ gcc-8-8-20171108/src/libgo/configure.ac @@ -154,7 +154,7 @@ AC_SUBST(go_include) # All known GOOS values. This is the union of all operating systems # supported by the gofrontend and all operating systems supported by # the gc toolchain. -ALLGOOS="aix android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows" +ALLGOOS="aix android darwin dragonfly freebsd irix gnu linux netbsd openbsd plan9 rtems solaris windows" is_darwin=no is_freebsd=no @@ -166,6 +166,7 @@ is_dragonfly=no is_rtems=no is_solaris=no is_aix=no +is_gnu=no GOOS=unknown case ${host} in *-*-darwin*) is_darwin=yes; GOOS=darwin ;; @@ -178,6 +179,7 @@ case ${host} in *-*-rtems*)is_rtems=yes; GOOS=rtems ;; *-*-solaris2*) is_solaris=yes; GOOS=solaris ;; *-*-aix*) is_aix=yes; GOOS=aix ;; + *-*-gnu*) is_gnu=yes; GOOS=gnu ;; esac AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes) AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes) @@ -189,6 +191,7 @@ AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes) AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes) AM_CONDITIONAL(LIBGO_IS_AIX, test $is_aix = yes) +AM_CONDITIONAL(LIBGO_IS_GNU, test $is_gnu = yes) AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes) AC_SUBST(GOOS) AC_SUBST(ALLGOOS) @@ -853,6 +856,13 @@ main () CFLAGS="$CFLAGS_hold" LIBS="$LIBS_hold" ]) +case ${host} in + *-*-gnu*) + LIBS="$LIBS -lpthread" + AC_SUBST(LIBS) + ;; +esac + dnl overwrite for the mips* 64bit multilibs, fails on some buildds if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then case "$target" in Index: gcc-8-8-20171108/src/libgo/Makefile.am === --- gcc-8-8-201
Bug#881939: gcc: disable D when cross build native GCC
Package: src:gcc-7 Version: 7.2.0-16 When we build native GCC with the cross gcc, D will always fails. So please disable D in this condition. @@ -891,6 +926,12 @@ ifeq ($(with_base_only),yes with_d := no endif +ifneq ($(DEB_BUILD_ARCH), $(DEB_HOST_ARCH)) +ifeq ($(DEB_HOST_ARCH), $(DEB_TARGET_ARCH)) + with_d := no +endif +endif + ifeq ($(with_d)-$(with_separate_gdc),yes-yes) ifneq (,$(findstring gdc,$(PKGSOURCE))) languages := c c++ -- YunQiang Su
Bug#881938: gnat: call gcc/g++ with system_type
Package: src:gcc-7 Version: 7.2.0-16 gnatlink/gnatmake etc programs may call gcc/g++ internally, while they just call them by the name: gcc-VERSION g++-VERSION which will cause problem for cross toolchains. -- YunQiang Su diff --git a/debian/patches/ada-gcc-name.diff b/debian/patches/ada-gcc-name.diff index ef6c223..970d3bc 100644 --- a/debian/patches/ada-gcc-name.diff +++ b/debian/patches/ada-gcc-name.diff @@ -10,29 +10,39 @@ Author: Nicolas Boulenguez --- a/src/gcc/ada/gnatlink.adb +++ b/src/gcc/ada/gnatlink.adb -@@ -136,7 +136,8 @@ +@@ -33,6 +33,7 @@ with Namet;use Namet; + with Opt; + with Osint;use Osint; + with Output; use Output; ++with Sdefault; + with Snames; + with Switch; use Switch; + with System; use System; +@@ -136,7 +137,9 @@ procedure Gnatlink is -- This table collects the arguments to be passed to compile the binder -- generated file. - Gcc : String_Access := Program_Name ("gcc", "gnatlink"); + Gcc : String_Access -+ := Program_Name ("gcc-" & Gnatvsn.Library_Version, "gnatlink"); ++ := Program_Name (Sdefault.Target_Name.all & "-gcc-" & ++Gnatvsn.Library_Version, "gnatlink"); Read_Mode : constant String := "r" & ASCII.NUL; -@@ -1414,7 +1415,8 @@ +@@ -1414,7 +1417,9 @@ procedure Gnatlink is end if; Write_Line (" --GCC=comp Use comp as the compiler"); - Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc'"); -+ Write_Line (" --LINK=nam Use 'nam' for the linking rather than 'gcc-" ++ Write_Line (" --LINK=nam Use 'nam' for the linking rather than '" ++& Sdefault.Target_Name.all & "-gcc-" +& Gnatvsn.Library_Version & "'"); Write_Eol; Write_Line (" [non-Ada-objects] list of non Ada object files"); Write_Line (" [linker-options] other options for the linker"); --- a/src/gcc/ada/make.adb +++ b/src/gcc/ada/make.adb -@@ -670,9 +670,12 @@ +@@ -670,9 +670,15 @@ package body Make is -- Compiler, Binder & Linker Data and Subprograms -- @@ -40,34 +50,38 @@ Author: Nicolas Boulenguez - Gnatbind : String_Access := Program_Name ("gnatbind", "gnatmake"); - Gnatlink : String_Access := Program_Name ("gnatlink", "gnatmake"); + Gcc : String_Access := Program_Name -+ ("gcc-" & Gnatvsn.Library_Version, "gnatmake"); ++ (Sdefault.Target_Name.all & "-gcc-" & ++Gnatvsn.Library_Version, "gnatmake"); + Gnatbind : String_Access := Program_Name -+ ("gnatbind-" & Gnatvsn.Library_Version, "gnatmake"); ++ (Sdefault.Target_Name.all & "-gnatbind-" & ++Gnatvsn.Library_Version, "gnatmake"); + Gnatlink : String_Access := Program_Name -+ ("gnatlink-" & Gnatvsn.Library_Version, "gnatmake"); ++ (Sdefault.Target_Name.all & "-gnatlink-" & ++Gnatvsn.Library_Version, "gnatmake"); -- Default compiler, binder, linker programs Saved_Gcc : String_Access := null; --- a/src/gcc/ada/mdll-utl.adb +++ b/src/gcc/ada/mdll-utl.adb -@@ -29,6 +29,7 @@ +@@ -29,6 +29,8 @@ with Ada.Text_IO; with Ada.Exceptions; with GNAT.Directory_Operations; +with Gnatvsn; ++with Sdefault; with Osint; package body MDLL.Utl is -@@ -39,7 +40,7 @@ +@@ -39,7 +41,7 @@ package body MDLL.Utl is Dlltool_Name : constant String := "dlltool"; Dlltool_Exec : OS_Lib.String_Access; - Gcc_Name : constant String := "gcc"; -+ Gcc_Name : constant String := "gcc-" & Gnatvsn.Library_Version; ++ Gcc_Name : constant String := Sdefault.Target_Name.all & "-gcc-" & Gnatvsn.Library_Version; Gcc_Exec : OS_Lib.String_Access; Gnatbind_Name : constant String := "gnatbind"; -@@ -212,7 +213,7 @@ +@@ -212,7 +214,7 @@ package body MDLL.Utl is end; end if; @@ -78,21 +92,23 @@ Author: Nicolas Boulenguez --- a/src/gcc/ada/mlib-utl.adb +++ b/src/gcc/ada/mlib-utl.adb -@@ -23,6 +23,7 @@ +@@ -23,6 +23,8 @@ -- -- -- +with Gnatvsn; ++with Sdefault; with MLib.Fil; use MLib.Fil; with MLib.Tgt; use MLib.Tgt; with Opt; -@@ -446,7 +447,8 @@ +@@ -446,7 +448,9 @@ package body MLib.Utl is if Driver_Name = No_Name then if Gcc_Exec = null then if Gcc_Name = null then - Gcc_Name := Osint.Program_Name ("gcc", "gnatmake"); + Gcc_Name := Osint.Program_Name -+ ("gcc-" & Gnatvsn.Library_Version, "gnatmake"); ++ (Sdefault.Target_Name.all & "-gcc-" & ++Gnatvsn.Library_Version, "gnatmake"); end if; Gcc_Exec := Locate_Exec_On_Path (Gcc_Name.all); @@ -106,12 +122,13 @@ Author: Nicolas Boulenguez with Makeutl; use Makeutl; with Opt; with Output; -@@ -115,7 +116,7 @@ +@@ -115,
Processed: forwarded GCC issue
Processing commands for cont...@bugs.debian.org: > forwarded 881918 https://gcc.gnu.org/PR83021 Bug #881918 [gfortran-7] gfortran-7: ICE building open-coarrays Set Bug forwarded-to-address to 'https://gcc.gnu.org/PR83021'. > tags 881918 + upstream Bug #881918 [gfortran-7] gfortran-7: ICE building open-coarrays Added tag(s) upstream. > thanks Stopping processing here. Please contact me if you need assistance. -- 881918: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881918 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Bug#881918: gfortran-7: ICE building open-coarrays
Package: gfortran-7 Version: 7.2.0-14 Severity: serious Control: affects -1 src:open-coarrays Testcase: $ gfortran global_field.f90 -fcoarray=lib global_field.f90:126:0: lhs%values(:) = rhs%state() internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See for instructions. $ Seen on amd64, i386, arm64, armhf (likely happens on all architectures). Fails with 7.2.0-14 and 7.2.0-16. open-coarrays built on the buildds with 7.2.0-8. f951-segfault.tar.xz Description: application/xz
Processed: gfortran-7: ICE building open-coarrays
Processing control commands: > affects -1 src:open-coarrays Bug #881918 [gfortran-7] gfortran-7: ICE building open-coarrays Added indication that 881918 affects src:open-coarrays -- 881918: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881918 Debian Bug Tracking System Contact ow...@bugs.debian.org with problems
Re: Hurd port for gcc-7 go PATCH 1-3(15)
On Wed, 2017-11-15 at 21:54 +0100, Svante Signell wrote: > On Wed, 2017-11-15 at 21:40 +0100, Matthias Klose wrote: > > On 06.11.2017 16:36, Svante Signell wrote: > > > Hi, > > > > > > Attached are patches to enable gccgo to build properly on Debian > > > GNU/Hurd on gcc-7 (7-7.2.0-12). > > > > sysinfo.go:6744:7: error: redefinition of 'SYS_IOCTL' > > const SYS_IOCTL = _SYS_ioctl > > ^ > > sysinfo.go:6403:7: note: previous definition of 'SYS_IOCTL' was here > > const SYS_IOCTL = 0 > > ^ > > the patches break the build on any Linux architecture. Please could you > > test > > your patches against a linux target as well? > > I'm really sorry. I regularly do that, but missed this one for gcc-7. Do you > mean the patches against gcc-8 you asked me for? You wrote that gcc-7 is not > of > interest and I should concentrate on gcc-8. > > Again, I'm really sorry. Will fix this tomorrow hopefully. > > Thanks! Attached is an updated patch for gcc-7. An updated patch for gcc-8 will follow shortly when I have build tested gcc-8 go on both Linux and Hurd. The patch for src/libgo/mksysinfo.sh worked fine in gcc-5 and gcc-6. The problem is that in gcc-7 and gcc-8 generation of build//libgo/sysinfo.go is made differently. The Hurd-specific entry about SYS_IOCTL had to be moved after: # The syscall numbers. We force the names to upper case. grep '^const _SYS_' gen-sysinfo.go | \ sed -e 's/const _\(SYS_[^= ]*\).*$/\1/' | \ while read sys; do sup=`echo $sys | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` echo "const $sup = _$sys" >> ${OUT} done Thanks!Index: gcc-7-7.2.0/src/libgo/configure.ac === --- gcc-7-7.2.0.orig/src/libgo/configure.ac +++ gcc-7-7.2.0/src/libgo/configure.ac @@ -146,7 +146,7 @@ AC_SUBST(go_include) # All known GOOS values. This is the union of all operating systems # supported by the gofrontend and all operating systems supported by # the gc toolchain. -ALLGOOS="android darwin dragonfly freebsd irix linux netbsd openbsd plan9 rtems solaris windows" +ALLGOOS="android darwin dragonfly freebsd irix gnu linux netbsd openbsd plan9 rtems solaris windows" is_darwin=no is_freebsd=no @@ -157,6 +157,7 @@ is_openbsd=no is_dragonfly=no is_rtems=no is_solaris=no +is_gnu=no GOOS=unknown case ${host} in *-*-darwin*) is_darwin=yes; GOOS=darwin ;; @@ -168,6 +169,7 @@ case ${host} in *-*-dragonfly*) is_dragonfly=yes; GOOS=dragonfly ;; *-*-rtems*)is_rtems=yes; GOOS=rtems ;; *-*-solaris2*) is_solaris=yes; GOOS=solaris ;; + *-*-gnu*) is_gnu=yes; GOOS=gnu ;; esac AM_CONDITIONAL(LIBGO_IS_DARWIN, test $is_darwin = yes) AM_CONDITIONAL(LIBGO_IS_FREEBSD, test $is_freebsd = yes) @@ -178,6 +180,7 @@ AM_CONDITIONAL(LIBGO_IS_OPENBSD, test $i AM_CONDITIONAL(LIBGO_IS_DRAGONFLY, test $is_dragonfly = yes) AM_CONDITIONAL(LIBGO_IS_RTEMS, test $is_rtems = yes) AM_CONDITIONAL(LIBGO_IS_SOLARIS, test $is_solaris = yes) +AM_CONDITIONAL(LIBGO_IS_GNU, test $is_gnu = yes) AM_CONDITIONAL(LIBGO_IS_BSD, test $is_darwin = yes -o $is_dragonfly = yes -o $is_freebsd = yes -o $is_netbsd = yes -o $is_openbsd = yes) AC_SUBST(GOOS) AC_SUBST(ALLGOOS) @@ -838,6 +841,14 @@ main () CFLAGS="$CFLAGS_hold" LIBS="$LIBS_hold" ]) + +case ${host} in + *-*-gnu*) + LIBS="$LIBS -lpthread" + AC_SUBST(LIBS) + ;; +esac + dnl overwrite for the mips* 64bit multilibs, fails on some buildds if test "$libgo_cv_lib_setcontext_clobbers_tls" = "yes"; then case "$target" in Index: gcc-7-7.2.0/src/libgo/Makefile.am === --- gcc-7-7.2.0.orig/src/libgo/Makefile.am +++ gcc-7-7.2.0/src/libgo/Makefile.am @@ -420,10 +420,14 @@ else if LIBGO_IS_NETBSD runtime_getncpu_file = runtime/getncpu-bsd.c else +if LIBGO_IS_GNU +runtime_getncpu_file = runtime/getncpu-gnu.c +else runtime_getncpu_file = runtime/getncpu-none.c endif endif endif +endif endif endif endif Index: gcc-7-7.2.0/src/libgo/Makefile.in === --- gcc-7-7.2.0.orig/src/libgo/Makefile.in +++ gcc-7-7.2.0/src/libgo/Makefile.in @@ -183,7 +183,8 @@ libgo_llgo_la_DEPENDENCIES = $(am__DEPEN @LIBGO_IS_LINUX_FALSE@am__objects_2 = thread-sema.lo @LIBGO_IS_LINUX_TRUE@am__objects_2 = thread-linux.lo @LIBGO_IS_RTEMS_TRUE@am__objects_3 = rtems-task-variable-add.lo -@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_4 = getncpu-none.lo +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_FALSE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_4 = getncpu-none.lo +@LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FREEBSD_FALSE@@LIBGO_IS_GNU_TRUE@@LIBGO_IS_IRIX_FALSE@@LIBGO_IS_LINUX_FALSE@@LIBGO_IS_NETBSD_FALSE@@LIBGO_IS_SOLARIS_FALSE@am__objects_4 = getncpu-gnu.lo @LIBGO_IS_DARWIN_FALSE@@LIBGO_IS_FR