Re: [PING**2] Another build!=host fix
On Tue, Feb 4, 2014 at 9:28 AM, Bernd Edlinger wrote: > Ping... > > this is still open, > in short, the configuration > > ../gcc-4.9-20140202/configure --prefix=/home/ed/gnu/arm-linux-gnueabihf-cross > --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf > --enable-languages=c,c++,fortran,ada --with-arch=armv7-a > --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard > > fails with this error: > > In file included from ../../gcc-4.9-20140202/gcc/config/host-linux.c:21:0: > ../../gcc-4.9-20140202/gcc/config/host-linux.c: In function 'int > linux_gt_pch_use_address(void*, size_t, int, size_t)': > ../../gcc-4.9-20140202/gcc/config/host-linux.c:215:43: error: 'SSIZE_MAX' was > not declared in this scope >nbytes = read (fd, base, MIN (size, SSIZE_MAX)); >^ > ../../gcc-4.9-20140202/gcc/system.h:351:26: note: in definition of macro 'MIN' > #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) > ^ > make[2]: *** [host-linux.o] Error 1 > > > > The reason is that the target's limits.h gets replaced by glimits.h which > does not define SSIZE_MAX. > This is the only place where SSIZE_MAX is used. Therefore I'd try to avoid > that define which is not guaranteed > to be defined. > > > Boot-Strapped and regression-tested on X86_64. > Plus cross-build for arm-linux-gnueabihf. > > OK for trunk? Ok. Thanks, Richard. > Thanks > Bernd. > > >> Date: Mon, 27 Jan 2014 08:34:59 +0100 >> >> Ping... >> >> >> >>> >>> Hello, >>> >>> and Ping for this patch: >>> >>> http://gcc.gnu.org/ml/gcc-patches/2013-12/msg01552.html >>> >>> >>> note however, that cross-building is probably broken >>> anyway in the moment by r205690, >>> >>> >>> Thanks >>> Bernd. >>> there is a small problem with SSIZE_MAX, because it is not always defined, especially not in gcc/glimits.h, which seems to be the fall-back if the target fails to have a working limits.h. When I create a cross-compiler for --target=arm-linux-gnueabihf, the working limits.h is overwritten by fix-includes with a copy of gcc/glimits.h. Probably because it is not possible to compile the target headers with the build compiler and produce meaningful test results. However because gcc/glimits.h does not define SSIZE_MAX the following build fails with In file included from ../../gcc-4.9-20131215/gcc/config/host-linux.c:21:0: ../../gcc-4.9-20131215/gcc/config/host-linux.c: In function 'int linux_gt_pch_use_address(void*, size_t, int, size_t)': ../../gcc-4.9-20131215/gcc/config/host-linux.c:215:43: error: 'SSIZE_MAX' was not declared in this scope nbytes = read (fd, base, MIN (size, SSIZE_MAX)); ^ ../../gcc-4.9-20131215/gcc/system.h:351:26: note: in definition of macro 'MIN' #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) ^ The most simple way to fix this would be to not use SSIZE_MAX here. Boot-Strapped and regression-tested on X86_64. Plus cross-build for arm-linux-gnueabihf. Ok for trunk? Thanks Bernd.
RE: [PING**2] Another build!=host fix
Ping... this is still open, in short, the configuration ../gcc-4.9-20140202/configure --prefix=/home/ed/gnu/arm-linux-gnueabihf-cross --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf --enable-languages=c,c++,fortran,ada --with-arch=armv7-a --with-tune=cortex-a9 --with-fpu=vfpv3-d16 --with-float=hard fails with this error: In file included from ../../gcc-4.9-20140202/gcc/config/host-linux.c:21:0: ../../gcc-4.9-20140202/gcc/config/host-linux.c: In function 'int linux_gt_pch_use_address(void*, size_t, int, size_t)': ../../gcc-4.9-20140202/gcc/config/host-linux.c:215:43: error: 'SSIZE_MAX' was not declared in this scope nbytes = read (fd, base, MIN (size, SSIZE_MAX)); ^ ../../gcc-4.9-20140202/gcc/system.h:351:26: note: in definition of macro 'MIN' #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) ^ make[2]: *** [host-linux.o] Error 1 The reason is that the target's limits.h gets replaced by glimits.h which does not define SSIZE_MAX. This is the only place where SSIZE_MAX is used. Therefore I'd try to avoid that define which is not guaranteed to be defined. Boot-Strapped and regression-tested on X86_64. Plus cross-build for arm-linux-gnueabihf. OK for trunk? Thanks Bernd. > Date: Mon, 27 Jan 2014 08:34:59 +0100 > > Ping... > > > >> >> Hello, >> >> and Ping for this patch: >> >> http://gcc.gnu.org/ml/gcc-patches/2013-12/msg01552.html >> >> >> note however, that cross-building is probably broken >> anyway in the moment by r205690, >> >> >> Thanks >> Bernd. >> >>> there is a small problem with SSIZE_MAX, because it is not always >>> defined, especially not in gcc/glimits.h, which seems to be the fall-back >>> if the target fails to have a working limits.h. >>> >>> When I create a cross-compiler for --target=arm-linux-gnueabihf, the >>> working limits.h is overwritten by fix-includes with a copy of >>> gcc/glimits.h. >>> Probably because it is not possible to compile the target headers with the >>> build >>> compiler and produce meaningful test results. >>> >>> However because gcc/glimits.h does not define SSIZE_MAX the following build >>> fails with >>> >>> In file included from ../../gcc-4.9-20131215/gcc/config/host-linux.c:21:0: >>> ../../gcc-4.9-20131215/gcc/config/host-linux.c: In function 'int >>> linux_gt_pch_use_address(void*, size_t, int, size_t)': >>> ../../gcc-4.9-20131215/gcc/config/host-linux.c:215:43: error: 'SSIZE_MAX' >>> was not declared in this scope >>> nbytes = read (fd, base, MIN (size, SSIZE_MAX)); >>> ^ >>> ../../gcc-4.9-20131215/gcc/system.h:351:26: note: in definition of macro >>> 'MIN' >>> #define MIN(X,Y) ((X) < (Y) ? (X) : (Y)) >>> ^ >>> >>> >>> The most simple way to fix this would be to not use SSIZE_MAX >>> here. >>> >>> Boot-Strapped and regression-tested on X86_64. >>> Plus cross-build for arm-linux-gnueabihf. >>> >>> Ok for trunk? >>> >>> >>> Thanks >>> Bernd. patch-host-linux.diff Description: Binary data