Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-owner AT cygwin DOT com Mail-Followup-To: cygwin AT cygwin DOT com Delivered-To: mailing list cygwin AT cygwin DOT com Date: Wed, 29 Jan 2003 17:14:44 -0500 From: Paul Kienzle To: cygwin AT cygwin DOT com Cc: octave-maintainers AT bevo DOT che DOT wisc DOT edu Subject: progress on libstdc++.dll Message-ID: <20030129171444.L6924007@jazz.ncnr.nist.gov> Mail-Followup-To: Paul Kienzle , cygwin AT cygwin DOT com, octave-maintainers AT bevo DOT che DOT wisc DOT edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5.1i Hi, I'm trying to make GNU Octave work well under cygwin. One issue is the size of the loadable modules, which are huge because they are statically linked to libstdc++.a I've been working on a libstdc++.dll instead. Has someone already done this? My first approach was to use dlltool: dlltool --export-all --output-exp a.exp \ --dllname libstdc++.dll \ --output-lib libstdc++.dll.a \ /usr/lib/libstdc++.a gcc -shared a.exp /usr/lib/libstdc++.a -o libstdc++.dll # To avoid using rebase I will try adding the following: # -Wl,--anable-auto-image-base # but I didn't do so in the current build. rebase -d -b 0x68000000 -o 0x10000 libstdc++.dll I could then link the loadable modules using gcc -shared -Wl,--export-all-symbols,--enable-auto-import,--enable-runtime-pseudo-reloc ... libstdc++.dll The loadable modules mostly work! And they are only 1/10th the size of the statically linked modules. One problem was that saving an image to jpg munged the file name (as if there were no end of string terminator from c_str). I wrote the following simple test program which seg-faults: #include #include int main(int argc, char *argv[]) { std::string x="hello"; std::cout << "<" << x.c_str() << ">" << std::endl; return 0; } g++ -c str.cc gcc -o str.exe -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc \ str.o libstdc++.dll There may be other problems. I have been advised from a couple of sources that the dlltool approach to building libstdc++.dll will not work. So I then tried the following: gcc -shared -Wl,-whole-archive,--export-all-symbols,--enable-auto-image-base \ /usr/lib/libstdc++.a -Wl,-no-whole-archive -o libstdc++.dll gcc -o str.exe -Wl,--enable-auto-import,--enable-runtime-pseudo-reloc str.o \ libstdc++.dll but the linker complained about many missing symbols. Using nm, they seem to be in libstdc++.dll. Any suggestions what I'm doing wrong? Thanks in advance, Paul Kienzle pkienzle AT nist DOT gov -- Unsubscribe info: http://cygwin.com/ml/#unsubscribe-simple Bug reporting: http://cygwin.com/bugs.html Documentation: http://cygwin.com/docs.html FAQ: http://cygwin.com/faq/