compiling ups-3.38beta2 on FreeBSD 5.4

Callum Gibson <[email protected]> 21 Jun 2005 13:20:52 +1000
Newsgroups gmane.comp.debugging.ups.user
Message-ID <[email protected]>
Hi,
Just some info for people running on FreeBSD. There have been some
changes in recent 5.X versions which have rendered the previous BSD
portage incompatible. I'm not sure if this may also apply to 5.3 so
suck it and see.

Here are the changes I had to make to get things to work.

Firstly, after the configure I had to change HAVE_GLOBAL_IOB to 0 in
ifdefs.h since none of the existing methods of accessing the global iob
were compatible. If one could be bothered, you could actually fix the
code as well, but it doesn't affect most things (only the interpreter,
I think).

Next, the following diffs need to be applied to 2 files:

-------------------------cut here-----------------------
diff -ruw ups-3.38-beta2/ups/ao_pt_regs.c ups-3.38-beta2-fbsd/ups/ao_pt_regs.c
--- ups-3.38-beta2/ups/ao_pt_regs.c     Fri Apr 11 01:27:52 2003
+++ ups-3.38-beta2-fbsd/ups/ao_pt_regs.c        Wed Jun 15 17:33:14 2005
@@ -522,7 +522,7 @@
        /* FreeBSD : .../sys/i386/i386/machdep.c
         * dr6 is status register, dr7 is control register.
         */
-       return (pr->dbregs.dr6 & 0x0000000f);
+       return (pr->dbregs.dr[6] & 0x0000000f);
 }
 
 /*
diff -ruw ups-3.38-beta2/ups/ao_pt_uarea.c ups-3.38-beta2-fbsd/ups/ao_pt_uarea.c
--- ups-3.38-beta2/ups/ao_pt_uarea.c    Wed Jul 16 20:00:27 2003
+++ ups-3.38-beta2-fbsd/ups/ao_pt_uarea.c       Wed Jun 15 17:43:55 2005
@@ -253,8 +253,8 @@
        taddr_t addr;
        int flags, offset, i, *regmap;
 
-       flags = (*get_uarea_word)(arg, (int)U_OFFSET(u_pcb.pcb_flags));
 #if defined(bsdi)
+       flags = (*get_uarea_word)(arg, (int)U_OFFSET(u_pcb.pcb_flags));
        regmap = ((flags & FM_TRAP) != 0) ? trapregs : syscallregs;
        addr = (*get_uarea_word)(arg, (int)U_OFFSET(u_kproc.kp_proc.p_regs));
 #elif defined(KINFO_PROC_SIZE)
@@ -264,7 +264,7 @@
            struct proc *paddr;
            regmap = trapregs;
            paddr = (struct proc *)(*get_uarea_word)(arg, (int)U_OFFSET(u_kproc.
ki_paddr));
-           addr = (*get_uarea_word)(arg, (int)(paddr->p_md.md_regs));
+           addr = (*get_uarea_word)(arg, (int)(paddr->p_md.md_ldt->ldt_base));
        }
 #else
        regmap = trapregs;
@@ -813,7 +813,7 @@
 #if defined(ARCH_MIPS)
        uaddr = (char *)(SIG_BASE + signo);
 #elif defined(ARCH_BSDI386)
-       uaddr = U_OFFSET(u_sigacts.ps_sigact[signo]);
+       uaddr = U_OFFSET(u_kproc.ki_paddr->p_sigacts[signo]);
 #elif defined(ARCH_SUN4) && defined(CPU_ARCH)
        uaddr = U_OFFSET(u_signal[signo]) + sparc_u_offset();
 #else
-------------------------cut here-----------------------

That seems to be sufficient to get it working reasonably from my
limited testing. Let me know if any changes or comments...

    C

-- 
Callum Gibson          [email protected]          61 438 266 463 (M)
Rates & ICT IT, Deutsche Bank, Australia [/]  61 2 9258 1620 (W)
### The opinions in this message are mine and not Deutsche's ###