SCO cross-compiler, iBCS, curses -- problems!

SCO cross-compiler, iBCS, curses -- problems!

Post by Steve Krulewit » Wed, 31 Jul 1996 04:00:00



Hey all,

   I have a gcc-2.7.0 SCO cross compiler installed.  I have iBCS2 installed.  I am
finally ready to do some SCO binary generation, but...

   The program I am trying to compile relies on ncurses, so I am linking in SCO's
curses library -- and everything compiles and links just fine.  However, my program
seems to seg fault in the call to the curses initscr() function:

bossanova:~/programs/utype$ file utype
utype: 80386 COFF executable not stripped
bossanova:~/programs/utype$ ./utype
Segmentation fault
bossanova:~/programs/utype$ gdb -quiet utype
(gdb) run
Starting program: /home/skrul/programs/utype/utype

Program received signal SIGSEGV, Segmentation fault.
0xf08d in _init_costs ()
(gdb) bt
#0  0xf08d in _init_costs ()
#1  0x90e3 in newscreen ()
#2  0x83d7 in initscr32 ()
#3  0xcfc in screen_init ()
#4  0x490 in main ()
(gdb)

From the trace, it look like initscr32() is causing the segfault.  However, I wrote
a simple program:

#include <curses.h>
main() { initscr(); endwin(); }

Which compiled and ran fine.  The program with the problem is considerably longer
(about 5000 lines) and also has initscr() as its first function call.  (Actually, it
calls screen_init() which calls initscr()) -- and it seg faults.

Any ideas on this one?  I am using iBCS (obviously) to execute the SCO binaries I
have generated, and it seems to work OK.  I've tried running the problematic program
on a real SCO system with the same results (seg fault).

I have even tried compiling ncurses-1.9.9e with the gcc SCO cross compiler and
linking with that (instead of SCO's curses lib) -- this was a real mess.  I actually
got some wierd output from the above program, that looked a little bit like it was
supposed to, but then it seg faulted.  I do have a funny feeling that when compiling
ncurses, the gcc SCO cross compiler may have been mixing some of the SCO stuff with
the Linux stuff (e.g. created SCO object files, but used Linux's ar to create the .a
file :)

Any help would be appreciated.  Should I give up and install a development system on
SCO?  No!  Linux can do anything!

- Steve

 
 
 

SCO cross-compiler, iBCS, curses -- problems!

Post by bill davids » Fri, 02 Aug 1996 04:00:00




|    The program I am trying to compile relies on ncurses, so I am linking in SCO's
| curses library -- and everything compiles and links just fine.  However, my program
| seems to seg fault in the call to the curses initscr() function:

I don't know if this is related to your problem, but Linux does not
support curese and SCO does. Support for curses disappeared around
Slackware 2.1 (which had it), one reason why I still have a system
running that release, and still have a lot of static linked a.out
binaries.

The curses and ncurses stuff are not the same. SCO, AIX, HP, Sun and
BSD all still support curses.
| Which compiled and ran fine.  The program with the problem is considerably longer
| (about 5000 lines) and also has initscr() as its first function call.  (Actually, it
| calls screen_init() which calls initscr()) -- and it seg faults.
|
| Any ideas on this one?  I am using iBCS (obviously) to execute the SCO binaries I
| have generated, and it seems to work OK.  I've tried running the problematic program
| on a real SCO system with the same results (seg fault).

Ah ha! Perfect compatibility.

| Any help would be appreciated.  Should I give up and install a development system on
| SCO?  No!  Linux can do anything!

I still do development of curses stuff on other platforms, the time
to rewrite an existing curses program to run under ncurses is large,
and then you have to port ncurses to some platforms to make things
work. I have about 100 hours into one application and it doesn't
work yet, although the original source code does a lot of stuff
without telling you what it's doing, and I have to reverse engineer
it.

I'd love to be able to cross compile from Linux to SCO, can you
point me at the doc? I have lots of non-curses stuff.
--

"The secret to procrastination is to put things off until the
 last possible moment - but no longer"  -me