This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
> I would try again with the DJ*204 files from > http://clio.rice.edu/djgpp/win2k/main_204.htm as these are built with GCC > 3.2 as I built them. > > Andrew It is my goal to fully document the process of building a linux hosted gcc-3.2 cross compiler using the msdosdjgpp target. I look forward to possibly contributing a fresh howto for this, but there is possible support issue that still remains. I managed to get this to build using current release sources, but there is still a hitch with the c++ exe terminating with a SIGSEGV exception error. I don't mean to sound like I know what I am talking about, coz I don't but just as an idea, if we can get past this last hitch, we could then do some cleanup with the libstdc++ / djgppv2 target code, so a whole laundry list of workarounds isn't necessary just to build this thing under linux. Just as a sidenote, I didn't try this with newlib yet. If anybody thinks that using newlib instead of glibc might help with any of this, please speak up. I tried starting from scratch and this time using djcrx204_alpha.zip instead of djcrx203.zip. Unfortunately, I am getting the same results as I did with djcrx203.zip. i.e. a linux host cross compiler that can make DOS and Win32 C and C++ executables, but only the C exe's run without SIGSEGV. I am of the mind that either I am doing something wrong with my building process or there is something broken between libstdc++-v3 and djgppv2xx. If I am doing something wrong, maybe somebody will read this e-mail and the attachments and see it and be able to make suggestions. Below shows what I am doing that deviates from the DJ's 1999 linux-x-djgpp howto. Additionally, I have attached the piped output from all configures and makes of binutils-2.13.1 gcc-3.2 and libstdc++-v3 as well as recursive directory listings of the djgpp target tree at the various building stages. i.e. initial djgpp setup, after binutils is built and installed, after gcc is built and installed and after libstc++-v3 is built and installed ...just in case somebody wants to see them, they are in the attached tarballz. I am basically doing everything in this faq with some changes to correct build errors. http://www.delorie.com/howto/djgpp/linux-x-djgpp.html Additionally, I have consulted the crossgcc faq, the binutils homepage, the gcc homepage, the various mailing list archives as well as given google a few new grey hairs... Here are the some of the software versions I am working with that seem to relate to all of this. djcrx203.zip with djdev203_u2.zip gcc-3.2 w/ libstdc++-v3 binutils-2.13.1 libc-2.2.2 (not newlib) bash-2.05b kernel-2.4.19 With the ~djgpp/cross source and target directories in place for the build as well as the package sources untarred I configure and build with the following commands. Note: that I show building gcc separately from building libstdc++-v3 since there was a modification to the libstdc++-v3 sources that I had to make to correct an error. It is detailed below. =========== binutils =========== To start off, I am compiling with gcc-3.2. It is not native, so I set the CC environment variable. export CC=/usr/local/compiler/gcc-3.2/bin/gcc 2.95.3 is my native compiler, but fyi, I tried both compilers and neither make a difference in the end regarding the SIGSEGV exception error. cd ~/binutils-2.13-obj ../binutils-2.13-src/configure --target=i686-pc-msdosdjgpp --prefix=/usr/loc al/compiler/cross2/djgpp --without-newlib make make install =========== gcc =========== /usr/local/compiler/cross2/djgpp/bin/i686-pc-msdosdjgpp-ar needs to be in the path so that the cross gcc builds. /usr/local/compiler/cross2/djgpp/bin/i686-pc-msdosdjgpp-ranlib needs to be in the path so that cross libstdc++-v3 builds. This can be done by putting the whole directory in the path or by creating links to just the files from a directory in the path. Both ways work. cd ~/gcc-3.2-obj ../gcc-3.2-src/configure --target=i686-pc-msdosdjgpp --prefix=/usr/local/com piler/cross2/djgpp --without-newlib --with-headers=/usr/local/compiler/cross2/djgpp/i686-pc-msdosdjgpp/include --with-libs=/usr/local/compiler/cross2/djgpp/lib /usr/local/compiler/cross2/djgpp/i686-pc-msdosdjgpp/lib The --with-headers=path was essential to prevent conflicts with limits.h and other subsequent make failures. i.e. PATH_MAX undefined in functions called by getpwd.c LONG_MIN undefined in functionc called by fibheap.c ... The --without-newlib and the --with-libs don't seem to have any affect on the end result, but I list them since I feel they are correct with this build process, however I could be wrong. make all-gcc make install-gcc =========== libstdc++-v3 =========== In order for libstdc++ to build without failure, I had to make the following change to the source tree: cd ~/gcc-3.2-src/libstdc++-v3/config/os mv newlib newlib.real cp -r djgpp newlib It would seem that there is a problem with libstdc++-v3 configure script and the djgpp target where the newlib headers are being used when they shouldn't be. The above change simply eliminates newlib headers from being seen and puts the djgpp in their place. The make log associated with and without doing the above are attached in this e-mail. cd ~/gcc-3.2-obj make all-target-libstdc++-v3 make install-target-libstdc++-v3 =========== At this point, and even before building libstdc++, it is possible to use the i686-pc-msdosdjgpp-gcc cross compiler from linux to compile standard C programs for use on the target platform. IOW, the exe's created from linux will run in real mode DOS (with the dpmi present or added), and in Win32. =========== In order to use the i686-pc-msdosdjgpp-gcc, I had to link libstdcxx.a to libstdc++.a and libsupcxx.a to libsupc++.a cd /usr/local/compiler/cross2/djgpp/i686-pc-msdosdjgpp/lib ln -s libstdc++.a libstdcxx.a ln -s libsupc++.a libsupcxx.a Once the links are in place, I can compile a cpp program, but the executable yields an exception error under real mode DOS and Win32. Here is the simple program: #include <iostream> int main() { std::cout << "Welcome to GNU C++ for Linux programming!" << std::endl; return 0; } =========== Here is the printed out of welcome.exe.. =========== Exiting due to signal SIGSEGV General Protection Fault at eip=0001e1ff eax=00000000 ebx=00043b58 ecx=00043b58 edx=000c7f60 esi=00000054 edi=00001670 ebp=000c7f28 esp=000c7f24 program=H:\ROOT\PROJECTS\CPP\TEST\WELCOME.EXE cs: sel=01a7 base=01dd0000 limit=000cffff ds: sel=01af base=01dd0000 limit=000cffff es: sel=01af base=01dd0000 limit=000cffff fs: sel=017f base=00005870 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=01dd0000 limit=000cffff App stack: [000c7fdc..00047fdc] Exceptn stack: [00047e8c..00045f4c] Call frame traceback EIPs: 0x0001e1ff 0x0001e46e 0x000016bd 0x0000d837 =========== here is symify output.. =========== Call frame traceback EIPs: 0x0001e1df ___udivmoddi4+7231 0x0001e44e ___udivmoddi4+7854 0x0000167e _main+36 0x0000d817 ___crt1_startup+199 C:\Archives\RIP2\DJGPP\bin>bfdsymify -o welcome2.out welcome.exe Exiting due to signal SIGSEGV General Protection Fault at eip=00040175 eax=f8ed7b60 ebx=f8ed7b58 ecx=f8ed7b58 edx=00000000 esi=000d8280 edi=f8ed7b60 ebp=000d6450 esp=000d6444 program=C:\ARCHIVES\RIP2\DJGPP\BIN\BFDSYM~1.EXE cs: sel=01a7 base=01dc0000 limit=0075ffff ds: sel=01af base=01dc0000 limit=0075ffff es: sel=01af base=01dc0000 limit=0075ffff fs: sel=017f base=00005870 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=01dc0000 limit=0075ffff App stack: [000d6a6c..00056a6c] Exceptn stack: [000569c0..00054a80] Call frame traceback EIPs: 0x00040175 ___EH_FRAME_BEGIN__+15509 0x000402d2 ___EH_FRAME_BEGIN__+15858 0x000314e1 ___udivmoddi4+85825 0x00002f2e __ZNSt13bad_exceptionD1Ev+14, line 95 of eh_exception.cc 0x0003f528 ___EH_FRAME_BEGIN__+12360 C:\Archives\RIP2\DJGPP\bin>bfdsymify -o welcome2.out welcome.exe C:\Archives\RIP2\DJGPP\bin>welcome Exiting due to signal SIGSEGV General Protection Fault at eip=0001e1df eax=00000000 ebx=00043b58 ecx=00043b58 edx=007cff90 esi=00000054 edi=00001630 ebp=007cff58 esp=007cff54 program=C:\ARCHIVES\RIP2\DJGPP\BIN\WELCOME.EXE cs: sel=01a7 base=01670000 limit=007dffff ds: sel=01af base=01670000 limit=007dffff es: sel=01af base=01670000 limit=007dffff fs: sel=017f base=00005870 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=01670000 limit=007dffff App stack: [007d0000..00750000] Exceptn stack: [00047e8c..00045f4c] Call frame traceback EIPs: 0x0001e1df ___udivmoddi4+7231 0x0001e44e ___udivmoddi4+7854 0x0000167e _main+36 0x0000d817 ___crt1_startup+199 C:\Archives\RIP2\DJGPP\bin>symify -o welcome.out welcome.exe =========== here is bfdsymify output.. =========== 0x0001e1df std::ostream::sentry::sentry(std::ostream&)+15, file ostream-inst.cc, line 99 0x0001e44e std::basic_ostream<char, std::char_traits<char> >& std::operator<< <std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&, char const*)+30, file ostream-inst.cc, line 624 0x0000167e main+36, file crt0.s 0x0000d817 __crt1_startup+199, file crt1.c 0x00040175 .eh_frame+1201, file libgcc2.c 0x000402d2 .eh_frame+1550, file libgcc2.c 0x000314e1 std::istream::operator>>(unsigned long long&)+337, file istream-inst.cc, line 364 0x00002f2e std::bad_exception::~bad_exception()+14, file eh_exception.cc 0x0003f528 .eh_frame+7188, file libgcc2.c C:\Archives\RIP2\DJGPP\bin>symify -o welcome.out welcome.exe C:\Archives\RIP2\DJGPP\bin>welcome Exiting due to signal SIGSEGV General Protection Fault at eip=0001e1df eax=00000000 ebx=00043b58 ecx=00043b58 edx=000c7f60 esi=00000054 edi=00001630 ebp=000c7f28 esp=000c7f24 program=C:\ARCHIVES\RIP2\DJGPP\BIN\WELCOME.EXE cs: sel=01a7 base=01dd0000 limit=000cffff ds: sel=01af base=01dd0000 limit=000cffff es: sel=01af base=01dd0000 limit=000cffff fs: sel=017f base=00005870 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=01dd0000 limit=000cffff App stack: [000c7fdc..00047fdc] Exceptn stack: [00047e8c..00045f4c] Call frame traceback EIPs: 0x0001e1df std::ostream::sentry::sentry(..+15, file ostream-inst.cc, line 99 0x0001e44e std::basic_ostream<char, std:..+30, file ostream-..nst.cc, line 624 0x0000167e main+36, file crt0.s 0x0000d817 __crt1_startup+199, file crt1.c C:\Archives\RIP2\DJGPP\bin>bfdsymify -o welcome2.out welcome.exe Exiting due to signal SIGSEGV General Protection Fault at eip=00040175 eax=f8ed7b60 ebx=f8ed7b58 ecx=f8ed7b58 edx=00000000 esi=000d8280 edi=f8ed7b60 ebp=000d6450 esp=000d6444 program=C:\ARCHIVES\RIP2\DJGPP\BIN\BFDSYM~1.EXE cs: sel=01a7 base=01dc0000 limit=0075ffff ds: sel=01af base=01dc0000 limit=0075ffff es: sel=01af base=01dc0000 limit=0075ffff fs: sel=017f base=00005870 limit=0000ffff gs: sel=01bf base=00000000 limit=0010ffff ss: sel=01af base=01dc0000 limit=0075ffff App stack: [000d6a6c..00056a6c] Exceptn stack: [000569c0..00054a80] Call frame traceback EIPs: 0x00040175 .eh_frame+1201, file libgcc2.c 0x000402d2 .eh_frame+1550, file libgcc2.c 0x000314e1 std::istream::operator>>(uns..+337, file istream-..nst.cc, line 364 0x00002f2e std::bad_exception::~bad_exception()+14, file eh_exception.cc 0x0003f528 .eh_frame+7188, file libgcc2.c C:\Archives\RIP2\DJGPP\bin>bfdsymify -o welcome2.out welcome.exe !!! Program name on screen doesn't match `welcome.exe' =========== here is g++ -v.. =========== Reading specs from /usr/local/compiler/cross2/djgpp/lib/gcc-lib/i686-pc-msdosdjgpp/3.2/specs Configured with: ../gcc-3.2-src/configure --target=i686-pc-msdosdjgpp --prefix=/usr/local/com piler/cross2/djgpp --with-headers=/usr/local/compiler/cross2/djgpp/i686-pc-m sdosdjgpp/include --without-newlib --with-libs=/usr/local/compiler/cross2/dj gpp/lib /usr/local/compiler/cross2/djgpp/i686-pc-msdosdjgpp/lib Thread model: single gcc version 3.2 g++: no input files =========== verbose linker output for g++ -Wl,--verbose welcome.cpp -o welcome.exe is attached =========== Any ideas or suggestions? Thank you all very much for you attention, Charles Wilkins p.s. There are a number of credits due regarding the above workarounds and howtos and for helping me get this far. I look forward to mentioning everybody in the final howto once this is straightened out.
Attachment:
binutils.tar.gz
Description: GNU Zip compressed data
Attachment:
dir.tar.gz
Description: GNU Zip compressed data
Attachment:
gcc.tar.gz
Description: GNU Zip compressed data
Attachment:
libstdcxx.tar.gz
Description: GNU Zip compressed data
Attachment:
g++-ld-verbose.tar.gz
Description: GNU Zip compressed data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |