This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

fixes for some native/cross compiling problems


Hello,

1. libgomp/env.c, if _BSD_SOURCE is not defined, then strncasecmp won't 
get a prototype, fix is including strings.h instead of string.h (or 
include both)

2. despite the fact, that I used --disable-werror, libgomp fails to 
compile if a warning occurs (like missing prototype as in 1.).

3. if SSIZE_MAX is not defined, gcc/config/host-linux.c fails to compile
possible fix
#ifndef SSIZE_MAX
# define SSIZE_MAX LONG_MAX
#endif

4. if O_RDWR is not defined (can happen on cross-compile, omiting the 
inclusion of fcntl.h), gcc.c and gcov-io.c fails to compile
possible fix in gcc/system.h (O_RDONLY/O_WRONLY are already there too)
#ifndef O_RDWR
# define O_RDWR 2
#endif

5. if MAXPATHLEN is not defined (can happen on cross-compile), tlink.c 
fails to compile
possible fix in gcc/system.h
#ifndef MAXPATHLEN
# define MAXPATHLEN PATH_MAX
#endif
#ifndef PATH_MAX
# define PATH_MAX 1024/4096 (or at least the POSIX requirement of 256)
#endif

The failing cross-compiles above happened, when
--host=i386-*-linux-uclibc --target=i386-*-linux-uclibc --build=i686-*-linux-gnu
(on the i686-*-linux-gnu host a cross-compiler for i386-*-linux-uclibc was 
set up and tried to use that to compile a "native" gcc for the target) 
using gcc-4.2.2.

The limits missing above happen probably due to the use of include_next 
<limits.h>, not getting to include the target provided limits.h.

No idea why fcntl.h was not included though.

Peter

-- 
Peter S. Mazinger <ps dot m at gmx dot net>           ID: 0xA5F059F2
Key fingerprint = 92A4 31E1 56BC 3D5A 2D08  BB6E C389 975E A5F0 59F2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]