Port-vax archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

native build status

There's good news and bad news on a native build.

I have been able to build a complete release using the netbsd-5 branch without any problems.

But I verfied a report by Gred Oster that the -current branch failed while building tools (although in a different place and in a different way).

I found that I was able to build the tools using the -current branch with a netbsd-5 system. Even running a -current kernel on the netbsd-5 system worked. However, when using the -current binaries, I was getting a segmentation fault when trying to install the the tools gcc.

The core dump was from nbgmake, and I found that gcc had generated a blbs which accessed past the end of a structure, and it just happened that the end of the structure was also the end of mapped memory. The structure in question is "dep" in gnu/dist/gmake/dep.h:

struct dep
    struct dep *next;
    char *name;
    struct file *file;
    unsigned int changed : 8;
    unsigned int ignore_mtime : 1;

The code that fails is testing the ignore_mtime field and generates the instruction 'blbs 0xd(r6),xxx'. Since the access is a 32 bit access, then will access the byte at 0x10(r6) which is past the end of the structure and manages to be unmapped memory in one particular case when using -current. I'd say this is probably a code-generation bug, but I'm way out of my areas of expertise in trying to figure out how to fix this.

As a simple work-around, I did the following patch, which places the ignore_mtime field in the first byte of the last 32 bits of the structure and was able to complete the tools build (and am in the process of the full build).

The work-around patch is:

Index: gnu/dist/gmake/dep.h
RCS file: /cvsroot/src/gnu/dist/gmake/dep.h,v
retrieving revision
diff -u -r1.1.1.1 dep.h
--- gnu/dist/gmake/dep.h        29 Mar 2006 21:09:18 -0000
+++ gnu/dist/gmake/dep.h        28 May 2009 03:08:21 -0000
@@ -38,8 +38,9 @@
     struct dep *next;
     char *name;
     struct file *file;
-    unsigned int changed : 8;
     unsigned int ignore_mtime : 1;
+    unsigned int dummy : 7;    /* vax work-around */
+    unsigned int changed : 8;

Michael L. Hitch                        mhitch%montana.edu@localhost
Computer Consultant
Information Technology Center
Montana State University        Bozeman, MT     USA

Home | Main Index | Thread Index | Old Index