Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!milano!bigtex!james From: james@bigtex.cactus.org (James Van Artsdalen) Newsgroups: comp.unix.sysv386 Subject: gcc 1.38 & Roell's X11r4 server Message-ID: <52314@bigtex.cactus.org> Date: 6 Jan 91 00:17:30 GMT Reply-To: james@bigtex.cactus.org (James Van Artsdalen) Organization: Institute of Applied Cosmology, Austin TX Lines: 247 I believe I have resolved most of the bugs involving compiling Thomas Roell's X11r4 server and gcc 1.38. The first patch fixes a bug in gcc wherein static uninitialized local variables are put in .bss instead of .data. The difference is moot unless you're trying to build a shared library. The next set of patches fix some indirect calls through uninitialized variables in the X libraries. There might be more of these: they are hard to find via regular expression searches. The last patch is to a bug in the X server - a define is wrong. I don't know what damage it was doing. I would like to know of any core dumps that remain. I am especially interested in any bugs involving the 387 that anyone can induce. *** /tmp/,RCSt1a14640 Sat Jan 5 18:05:49 1991 --- config/tm-att386.h Fri Jan 4 23:49:05 1991 *************** *** 145,166 **** #define DATA_SECTION_ASM_OP ".data" - /* Output before uninitialized data. */ - - #define BSS_SECTION_ASM_OP ".bss" - - #define EXTRA_SECTIONS in_bss - - #define EXTRA_SECTION_FUNCTIONS \ - void \ - bss_section () \ - { \ - if (in_section != in_bss) \ - { \ - fprintf (asm_out_file, "%s\n", BSS_SECTION_ASM_OP); \ - in_section = in_bss; \ - } \ - } /* Define the syntax of labels and symbol definitions/declarations. */ --- 145,150 ---- *************** *** 179,185 **** to define a local common symbol. */ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ ! (bss_section (), \ ASM_OUTPUT_LABEL ((FILE), (NAME)), \ fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED))) --- 163,169 ---- to define a local common symbol. */ #define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ ! (data_section (), \ ASM_OUTPUT_LABEL ((FILE), (NAME)), \ fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED))) =========================================================================== /usr/local/src/X/mit> rcsdiff -c lib/X/XGetDflt.c lib/Xaw/Clock.c lib/Xaw/Mailbox.c server/ddx/mi/mispritest.h RCS file: lib/X/RCS/XGetDflt.c,v retrieving revision 1.1 diff -c -r1.1 lib/X/XGetDflt.c *** /tmp/,RCSt1a14655 Sat Jan 5 18:08:00 1991 --- lib/X/XGetDflt.c Sat Jan 5 16:12:00 1991 *************** *** 33,45 **** #include "Xlibint.h" #include static char *GetHomeDir (dest) char *dest; { int uid; extern char *getenv(); - extern int getuid(); - extern struct passwd *getpwuid(), *getpwnam(); struct passwd *pw; register char *ptr; --- 33,46 ---- #include "Xlibint.h" #include + extern int getuid(); + extern struct passwd *getpwuid(), *getpwnam(); + static char *GetHomeDir (dest) char *dest; { int uid; extern char *getenv(); struct passwd *pw; register char *ptr; =================================================================== RCS file: lib/Xaw/RCS/Clock.c,v retrieving revision 1.1 diff -c -r1.1 lib/Xaw/Clock.c *** /tmp/,RCSt1a14655 Sat Jan 5 18:08:00 1991 --- lib/Xaw/Clock.c Sat Jan 5 17:32:30 1991 *************** *** 170,175 **** --- 170,177 ---- NULL, 0 ); } + extern struct tm *localtime(); + /* ARGSUSED */ STATIC void Initialize (request, new) Widget request, new; *************** *** 189,195 **** if(!w->clock.analog) { char *str; struct tm tm; - extern struct tm *localtime(); long time_value; (void) time(&time_value); tm = *localtime(&time_value); --- 191,196 ---- *************** *** 313,319 **** XtIntervalId *id; { ClockWidget w = (ClockWidget)client_data; - struct tm *localtime(); struct tm tm; long time_value; char *time_ptr; --- 314,319 ---- *************** *** 512,517 **** --- 512,520 ---- } } + extern double cos(); + extern double sin(); + /* * DrawLine - Draws a line. * *************** *** 533,540 **** { double dblank_length = (double)blank_length, dlength = (double)length; double angle, cosangle, sinangle; - extern double cos(); - extern double sin(); int cx = w->clock.centerX, cy = w->clock.centerY, x1, y1, x2, y2; /* --- 536,541 ---- *************** *** 576,583 **** register double angle, cosangle, sinangle; register double ws, wc; Position x, y, x1, y1, x2, y2; - extern double cos(); - extern double sin(); /* * A full circle is 2 PI radians. --- 577,582 ---- *************** *** 635,642 **** register double ms, mc, ws, wc; register int mid; Position x, y; - extern double cos(); - extern double sin(); /* * A full circle is 2 PI radians. --- 634,639 ---- =================================================================== *** /tmp/,RCSt1a14655 Sat Jan 5 18:08:01 1991 --- lib/Xaw/Mailbox.c Sat Jan 5 16:17:02 1991 *************** *** 510,524 **** * get user name for building mailbox */ static void GetMailFile (w) MailboxWidget w; { - extern char *getlogin(); char *username; username = getlogin (); if (!username) { - extern struct passwd * getpwuid(); struct passwd *pw = getpwuid (getuid ()); if (!pw) { --- 510,525 ---- * get user name for building mailbox */ + extern char *getlogin(); + extern struct passwd * getpwuid(); + static void GetMailFile (w) MailboxWidget w; { char *username; username = getlogin (); if (!username) { struct passwd *pw = getpwuid (getuid ()); if (!pw) { =================================================================== RCS file: server/ddx/mi/RCS/mispritest.h,v retrieving revision 1.1 diff -c -r1.1 server/ddx/mi/mispritest.h *** /tmp/,RCSt1a14655 Sat Jan 5 18:08:01 1991 --- server/ddx/mi/mispritest.h Fri Dec 21 10:12:24 1990 *************** *** 92,98 **** */ #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y)) ! #define LINE_SORT(x1,y2,x2,y2) \ { int _t; \ if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \ if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } } --- 92,98 ---- */ #define SPN_OVERLAP(pCbox,y,x,w) BOX_OVERLAP((pCbox),(x),(y),(x)+(w),(y)) ! #define LINE_SORT(x1,y1,x2,y2) \ { int _t; \ if (x1 > x2) { _t = x1; x1 = x2; x2 = _t; } \ if (y1 > y2) { _t = y1; y1 = y2; y2 = _t; } } -- James R. Van Artsdalen james@bigtex.cactus.org "Live Free or Die" Dell Computer Co 9505 Arboretum Blvd Austin TX 78759 512-338-8789