X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com X-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=Oa8J0O2FskJ62aJl+p+Z43yMa7hjOht2nXVgCdAm7UU=; b=XI2NbQr6Jb96gug3xdvQywYfbZvtdLK50oFEzHU4zexU+sMM4SKH5ios8j/Jjy2fKK gROEXfSbxRfvCqKSCoD3uhu6z032h6IsI2ejwD1KrLDpaerTDQuVcznI+wg/HsXbL3uP yLOIws1LzGg47+BmL5N/P3ZyID5crrIN8+EwbF6aq+bKj3Rdgk9D6a4Ggdmim2eqkKtt dEgFm76JOFHslPWaLEVSrNJXnOpXzlYic8bKBXDoFdXjJuCPH6AffLSYsNwifMta5dty JDZg4/HJDIF5WL6VC2UhFhDaTdSIXn0FgN4jApWjjl2f3/5pWW/anHjzzCMq+4XblGly owRw== MIME-Version: 1.0 X-Received: by 10.42.81.201 with SMTP id a9mr2000584icl.9.1432714853096; Wed, 27 May 2015 01:20:53 -0700 (PDT) In-Reply-To: <55653EB8.8050401@iki.fi> References: <55653EB8 DOT 8050401 AT iki DOT fi> Date: Wed, 27 May 2015 11:20:52 +0300 Message-ID: Subject: Re: limits.h problem in cross-toolchain From: "Ozkan Sezer (sezeroz AT gmail DOT com)" To: djgpp AT delorie DOT com Content-Type: text/plain; charset=UTF-8 Reply-To: djgpp AT delorie DOT com Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On 5/27/15, Andris Pavenis (andris DOT pavenis AT iki DOT fi) wrote: > On 05/26/2015 11:43 PM, Ozkan Sezer (sezeroz AT gmail DOT com) wrote: >> In my linux hosted cross-djgpp toolchains, gcc-provided limits.h doesn't >> include_next the djgpp-provided limits.h, I have to manually correct it. >> cross-gcc is configured like: >> ../gcc-3.46/configure --prefix=/usr/local/cross-djgpp >> --target=i586-pc-msdosdjgpp >> --with-headers=/usr/local/cross-djgpp/i586-pc-msdosdjgpp/include >> --enable-languages=c,c++ --disable-libgcj --disable-libada >> --disable-nls >> >> Same thing happens with gcc 3.3.6 and gcc 5.1.0 too. Before configuring >> and building gcc, djgpp libs and headers are of course copied under >> /usr/local/cross-djgpp/i586-pc-msdosdjgpp/ >> >> $ cat t.c >> #include >> #ifndef PATH_MAX >> #error bad limits.h >> #endif >> >> If I don't correct the installed gcc limits.h myself, the above test >> surely >> errors, which is annoying. What am I missing? > Known problem. Also easy to avoid > > Fragment from gcc/Makefile when building cross-compiler (on my Linux box) > > # Default native SYSTEM_HEADER_DIR, to be overridden by targets. > NATIVE_SYSTEM_HEADER_DIR = /dev/env/DJDIR/include > # Default cross SYSTEM_HEADER_DIR, to be overridden by targets. > CROSS_SYSTEM_HEADER_DIR = $(gcc_tooldir)/sys-include > > # autoconf sets SYSTEM_HEADER_DIR to one of the above. > # Purge it of unnecessary internal relative paths > # to directories that might not exist yet. > # The sed idiom for this is to repeat the search-and-replace until it > doesn't match, using :a ... ta. > # Use single quotes here to avoid nested double- and backquotes, this > # macro is also used in a double-quoted context. > SYSTEM_HEADER_DIR = `echo $(CROSS_SYSTEM_HEADER_DIR) | sed -e :a -e > 's,[^/]*/\.\.\/,,' -e ta` > > # Control whether to run fixincludes. > STMP_FIXINC = stmp-fixinc > > # Test to see whether exists in the system header files. > LIMITS_H_TEST = [ -f $(SYSTEM_HEADER_DIR)/limits.h ] > > Some variables in that Makefile: > libsubdir = > $(libdir)/gcc/$(real_target_noncanonical)/$(version)$(accel_dir_suffix) > gcc_tooldir = $(libsubdir)/$(libsubdir_to_prefix)$(target_noncanonical) > > In short: > > GCC build process expects system.h for prefix=/usr and > target=i586-pc-msdosdjgpp > in $(prefix)/$(target)/sys-include but not $(prefix)/$(target)/include > > The symptoms are as described in original message if DJGPP own limits.h is > not found when > GCC build expects it be located > > One can also take a look at RPM files I have put into directory > /pub/djgpp/rpms and subdirectories > of ftp.delorie.com (files djcrx*.src.rpm and djcross-gcc-*.src.rpm). > I see. So I tried symlinking or renaming the djgpp includes to sys-includes and removing any --with-headers configury options, it does work with gcc 5.1.0, but not with gcc 3.3.6 and 3.4.6 which I use extensively. Oh the joys of configuring gcc.. Thanks. -- O.S.