From: hat AT se-46 DOT wpa DOT wtb DOT tue DOT nl (Albert Theo Hofkamp) Newsgroups: gnu.gcc.help,comp.os.msdos.djgpp Subject: Smart template instantiations (repo patch) in cross compiler ? Date: 26 Aug 1997 13:28:19 GMT Organization: Eindhoven University of Technology, The Netherlands Message-ID: <5tullj$qp3@tuegate.tue.nl> Reply-To: a DOT hofkamp AT wtb DOT tue DOT nl NNTP-Posting-Host: se-46.wpa.wtb.tue.nl Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Lines: 45 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk Hello all, For those who don't understand what I mean with repo patches and template instantiations: C++ has templates, and gcc supports them (upto a certain point). Unfortunately, gcc is not very smart with templates and instantiates too many templates (to give an idea, of the 4MB executable which we built here, 3.4MB can be saved). The `repo' patch makes gcc smarter (and produces the savings of 3.4MB mentioned before). The problem is that we develop on Linux, and our target platform is DOS/Windows. The solution I thought, was to have a cross-compiler on Linux with repo patch, which produces a DOS executable. Unfortunately, until now, I doesn't work :-( A small list of steps I made: 1) I compiled gcc-2.7.2.2 with repo patch for gcc-2.7.0 on Linux. It works beautifully !!! (Thanks for this nice patch, it really saves the day here). Note that I didn't get any complaint from `patch' about the differences, and as it works with the build compiler, the difference in versions seems no problem. 2) I built a cross-compiler on Linux, for DOS DJGPP. Again gcc-2.7.2.2, with the same patch. Since it worked as native compiler on Linux, I assumed it would work as cross-compiler as well. I used the DJGPP faq as a guide, and together with some knowledge about building a compiler, and some shuffling of files afterwards, I got a gcc-dos executable supporting both C and C++. It compiles sources of both languages to DOS executables without problems worth mentioning here. 3) The extra `-frepo' flag allowed by including the patch is accepted, and .rpo files are generated, but the recompiling part is not happening. Instead, undefined references are reported for each template, and the compilation quits. Does anyone have an idea of what I might be doing wrong ? I can supply you with details, but I didn't include them here, because not many people are interested, and there are a lot of details.... However, don't let that worry you. If you want details, ask for them, and I will be happy to supply them. Albert --- Freedom: A Linux-based GNU computer system