Content-Type: text/plain; charset="iso-8859-13" From: Andris Pavenis To: John Fremlin , Subject: Re: i586-pc-linux-gnu to DJGPP cross compiler with today's 3.00 CVS Date: Mon, 12 Mar 2001 12:42:30 +0200 X-Mailer: KMail [version 1.2] References: In-Reply-To: Cc: djgpp-workers AT delorie DOT com MIME-Version: 1.0 Message-Id: <01031212093100.30669@hal> Content-Transfer-Encoding: 8bit Reply-To: djgpp-workers AT delorie DOT com On Monday 12 March 2001 00:44, John Fremlin wrote: > I set up a cross compiler from i586-pc-linux-gnu to i386-pc-msdosdjgpp > using the GCC CVS (-r gcc-3_0-branch) of today. There was quite a bit > of hassle and some problems with C++ remain. > > Linking fails on cpp0 because target_flags (used by SUPPORTS_ONE_ONLY > macro defined in the djgpp.h config file which is instantiated in > cppinit.c) is defined in rtlanal.c which is not included in the > link. This can be fixed by also defining target_flags in cppinit.c, > though that probably isn't the right, as, as far as I can see, they > are not modified anywhere. > > The gcc libiberty/getcwd.c bombed out because of undefined > PATH_MAX. This can be fixed by #including "limits.h" (careful: with > the GCC version is included instead of the DJGPP version) > in the unistd.h. I got the headers from from djcxr203.zip. > > I don't have any POSIX drafts so I can't say who's at fault ;-) > > Anyway, once I got over these hassles, I managed to produce some > working executables so things aren't badly broekn. Tried the same and run into the trouble with building libstdc++-v3: I got 4 incorrect symlinks in i586-pc-msdosdjgpp/libstdc++-v3/include/bits to files in libstdc++-v3/include/config/os/newlib/bits instead of ones in libstdc++-v3/include/config/djgpp/bits /disk2/cvs/egcs-curr/build/build.djg/i586-pc-msdosdjgpp/libstdc++-v3/include/bits total 80 lrwxrwxrwx 1 andris users 64 Mar 12 10:58 atomicity.h -> ../../../../../gcc/libstdc++-v3/config/cpu/i486/bits/atomicity.h lrwxrwxrwx 1 andris users 57 Mar 12 10:58 basic_file_model.h -> ../../../../../gcc/libstdc++-v3/config/basic_file_stdio.h -rw-r--r-- 1 andris users 26533 Mar 12 10:58 c++config.h lrwxrwxrwx 1 andris users 51 Mar 12 10:58 c++io.h -> ../../../../../gcc/libstdc++-v3/config/c_io_stdio.h lrwxrwxrwx 1 andris users 57 Mar 12 10:58 c++locale.h -> ../../../../../gcc/libstdc++-v3/config/c_locale_generic.h lrwxrwxrwx 1 andris users 51 Mar 12 10:58 c++threads.h -> ../../../../../gcc/libstdc++-v3/config/threads-no.h lrwxrwxrwx 1 andris users 66 Mar 12 10:58 ctype_base.h -> ../../../../../gcc/libstdc++-v3/config/os/newlib/bits/ctype_base.h lrwxrwxrwx 1 andris users 68 Mar 12 10:58 ctype_inline.h -> ../../../../../gcc/libstdc++-v3/config/os/newlib/bits/ctype_inline.h lrwxrwxrwx 1 andris users 71 Mar 12 10:58 ctype_noninline.h -> ../../../../../gcc/libstdc++-v3/config/os/newlib/bits/ctype_noninline.h lrwxrwxrwx 1 andris users 66 Mar 12 10:58 os_defines.h -> ../../../../../gcc/libstdc++-v3/config/os/newlib/bits/os_defines.h -rw-r--r-- 1 andris users 28537 Mar 12 10:58 std_limits.h I had to edit symlinks to point to correct files and to be able to finish build. After that I tried build under Linux gcc-3.0 20010311 as native compiler for DJGPP. (I think it would be good test for cross-compiler) When configuring gcc-3.0 20010311 as native compiler for DJGPP $srcdir/configure --prefix=/dev/env/DJDIR --build=i586-pc-linux-gnu --host=i586-pc-msdosdjgpp \ --target=i586-pc-msdosdjgpp --with-as=/disk2/gcctest/bin/i586-pc-msdosdjgpp-as configure incorrectly detected that it's possible to mmap /dev/zero. As result I would get failure when compiling gcc/ggc-page.c unless I edit gcc/auto-host.h gcc/gcc.c unconditionally uses SIGCHLD (line 5483). Perhaps it should be enclosed in #ifdef SIGCHLD .... #endif (This broke compiling gcc.c with when cross-building under Linux native compiler for DJGPP) --- gcc.c~1 Sat Mar 10 01:01:15 2001 +++ gcc.c Mon Mar 12 12:28:41 2001 @@ -5480,7 +5480,9 @@ #endif /* We *MUST* set SIGCHLD to SIG_DFL so that the wait4() call will receive the signal. A different setting is inheritable */ +#ifdef SIGCHLD signal (SIGCHLD, SIG_DFL); +#endif argbuf_length = 10; argbuf = (const char **) xmalloc (argbuf_length * sizeof (const char *)); This time symlinks in i586-pc-msdosdjgpp/libstdc++-v3/include/bits were set correctly. So perhaps I should look whether native compiler for DJGPP I built works at all ... Andris