X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f X-Recipient: djgpp AT delorie DOT com Message-ID: <52519E52.7060604@iki.fi> Date: Sun, 06 Oct 2013 20:30:58 +0300 From: Andris Pavenis User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130923 Thunderbird/17.0.9 MIME-Version: 1.0 To: djgpp AT delorie DOT com CC: RoBoard Lab Subject: Re: Cygwin-to-DJGPP cross compiler References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Reply-To: djgpp AT delorie DOT com On 10/02/2013 06:39 AM, RoBoard Lab wrote: > We successfully built DJGPP cross compiler in Cygwin last night using Andris Pavenis's SRPM > packages. We use it to compile several sample programs (such as a hello world program and a > 100-line I/O program hooking the 08h interrupt) and it seems that no problem occurs (but more tests > should be done). > > I briefly mention our process in the following: > > 1. djcross-binutils-2.22-1ap.src.rpm > > This is a package with less problems. We just added _smp_mflags to .rpmmacros and removed > BuildRequires from the spec file. Then the build progress basically succeeded under Cygwin. > > 2. djcrx-2.04pre_20130306-15ap.src.rpm > > This package needs DJGPP cross compiler to build, but we has no such compiler under Cygwin:( And if > we want to build Cygwin-to-DJGPP cross compiler, we must build this package first... (like a > contradiction) See also old package ftp://ftp.delorie.com/pub/djgpp/rpms/djcrx-2.04pre-5.src.rpm That can be used for bootstrapping as it relies on prepackages djcrx204.zip. It is however recommended to replace djcrx204.zip with newer version built from current CVS sources. > On the other hand, the makefile of DJGPP source in this package uses the environment variable > "COMSPEC" to determine whether the cross compiling should run. And in my Cygwin (running on WinXP), > COMSPEC is always defined, and hence the makefile don't run cross compiling correctly. > > To solve the above problems, we modify that makefile to force cross compiling and remove the > compilation of all DOS binaries. The DOS binaries (djcrx204.zip) are downloaded from internet > instead and added into this package. We then modify the spec file correspondingly to build this > package. > > 3. djcross-gcc-4.8.1-1ap.src.rpm > > Because we need only c,c++ compilers, we modify the spec file to remove the compilation of f95, > objc/objc++, ada. > > The original spec file uses the following line to make gcc binaries: > > make %{_smp_mflags} PATH=$RPM_BUILD_DIR/%{name}-%{version}/tmpinst/bin:$PATH || exit 1 > > The $PATH variable has problems in Cygwin due to some path names with spaces (such as "/Program > Files"). So we change $PATH to '/usr/local/bin:/usr/bin' in our spec file. You can try updated SRPM version ftp://ftp.delorie.com/pub/djgpp/rpms/djcross-gcc-4.8.1/djcross-gcc-4.8.1-3ap.src.rpm I added "" around path so hopefully directory names with spaces should be OK. I have not however tried to build for Cygwin > > The original spec file has two bugs as follows: > > sh unpack-gcc.sh --no-djgpp-sources gcc-%{gcc_source_name}.tar.bz2 || exit 1 > > '--no-djgpp-sources' should be changed to '--no-djgpp-source' That was typo. Fixed in my local GIT repo and SRPM mentioned above > > and > > %{_libdir}/gcc/%{target}/%{gcc_version}/finclude > > 'finclude' should be changed to 'include' It should not. This line was simply misplaced and is now moved to Fortran cross-compiler section > > With the above modification, the binaries of gcc cross compilers can then be built successfully. > But the RPM building progress fails due to the lack of some paths/files specified in the original > spec file: > > %{_libdir}/gcc/%{target}/%{gcc_version}/libcaf_single.* > %{_libdir}/gcc/%{target}/%{gcc_version}/plugin/gtype.state > %{_libdir}/gcc/%{target}/%{gcc_version}/plugin/include/* > %{_libexecdir}/gcc/%{target}/%{gcc_version}/plugin/gengtype > %doc COPYING* README readme.DJGPP > > This is possibly because we skip the compilation of gcc fortran. And we remove the above lines and > rebuild, and then every step is passed but rpmbuild still reports errors after the last step as > follows: Added define to SPEC file to enable/disable also Fortran, ObjectiveC and ObjectiveC++ support. Andris