* Illegal instruction
@ 2001-07-06 8:15 Carsten Langgaard
2001-07-06 9:27 ` Houten K.H.C. van (Karel)
` (2 more replies)
0 siblings, 3 replies; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-06 8:15 UTC (permalink / raw)
To: vhouten, linux-mips
Hi Karel,
I have tried the root-images tar-files: mipselroot-rh7-20010606 and
mipsroot-rh7.
The mipsroot-rh7 (bigendian) root image seem to work fine, but when
I use the mipselroot-rh7-20010606 (littleendian) I get an illegal
instruction.
[cat:179] Illegal instruction 7c010001 at 2ac8b20c ra=00000000.
I'm using a 2.4.3 kernel.
Anyone got an idea ?
/Carsten
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-06 8:15 Illegal instruction Carsten Langgaard
@ 2001-07-06 9:27 ` Houten K.H.C. van (Karel)
2001-07-06 11:42 ` Maciej W. Rozycki
2001-07-06 13:26 ` Dan Aizenstros
2001-07-06 22:04 ` Jun Sun
2 siblings, 1 reply; 23+ messages in thread
From: Houten K.H.C. van (Karel) @ 2001-07-06 9:27 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: vhouten, linux-mips, karel
Carsten Langgaard wrote:
> I have tried the root-images tar-files: mipselroot-rh7-20010606 and
> mipsroot-rh7.
> The mipsroot-rh7 (bigendian) root image seem to work fine, but when
> I use the mipselroot-rh7-20010606 (littleendian) I get an illegal
> instruction.
> [cat:179] Illegal instruction 7c010001 at 2ac8b20c ra=00000000.
>
> I'm using a 2.4.3 kernel.
> Anyone got an idea ?
I'm still using 2.4.0-test9 on mipsel, because I've problems with the
newer kernels too. I hope to test H.J. Lu's toolchain/glibc, but
currently it is much to hot to switch on extra computers :-)
Regards,
--
Karel van Houten
----------------------------------------------------------
The box said "Requires Windows 95 or better."
I can't understand why it won't work on my Linux computer.
----------------------------------------------------------
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-06 9:27 ` Houten K.H.C. van (Karel)
@ 2001-07-06 11:42 ` Maciej W. Rozycki
0 siblings, 0 replies; 23+ messages in thread
From: Maciej W. Rozycki @ 2001-07-06 11:42 UTC (permalink / raw)
To: Houten K.H.C. van (Karel); +Cc: Carsten Langgaard, linux-mips, karel
On Fri, 6 Jul 2001, Houten K.H.C. van (Karel) wrote:
> I'm still using 2.4.0-test9 on mipsel, because I've problems with the
> newer kernels too. I hope to test H.J. Lu's toolchain/glibc, but
> currently it is much to hot to switch on extra computers :-)
Weird, I'm using 2.4.5 for more than a week now on my /240 and it appears
to work fine. I've built it with my old tools which I'm still using.
--
+ Maciej W. Rozycki, Technical University of Gdansk, Poland +
+--------------------------------------------------------------+
+ e-mail: macro@ds2.pg.gda.pl, PGP key available +
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-06 8:15 Illegal instruction Carsten Langgaard
2001-07-06 9:27 ` Houten K.H.C. van (Karel)
@ 2001-07-06 13:26 ` Dan Aizenstros
2001-07-06 22:04 ` Jun Sun
2 siblings, 0 replies; 23+ messages in thread
From: Dan Aizenstros @ 2001-07-06 13:26 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: vhouten, linux-mips
Hello Carsten,
I have seen the same thing on the same kernel version.
Dan Aizenstros
Software Engineer
V3 Semiconductor Corp.
Carsten Langgaard wrote:
>
> Hi Karel,
>
> I have tried the root-images tar-files: mipselroot-rh7-20010606 and
> mipsroot-rh7.
> The mipsroot-rh7 (bigendian) root image seem to work fine, but when
> I use the mipselroot-rh7-20010606 (littleendian) I get an illegal
> instruction.
> [cat:179] Illegal instruction 7c010001 at 2ac8b20c ra=00000000.
>
> I'm using a 2.4.3 kernel.
> Anyone got an idea ?
>
> /Carsten
>
> --
> _ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
> |\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
> | \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
> TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
> Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-06 8:15 Illegal instruction Carsten Langgaard
2001-07-06 9:27 ` Houten K.H.C. van (Karel)
2001-07-06 13:26 ` Dan Aizenstros
@ 2001-07-06 22:04 ` Jun Sun
2001-07-10 11:14 ` Carsten Langgaard
2 siblings, 1 reply; 23+ messages in thread
From: Jun Sun @ 2001-07-06 22:04 UTC (permalink / raw)
To: Carsten Langgaard, ralf; +Cc: vhouten, linux-mips
[-- Attachment #1: Type: text/plain, Size: 951 bytes --]
Carsten Langgaard wrote:
>
> Hi Karel,
>
> I have tried the root-images tar-files: mipselroot-rh7-20010606 and
> mipsroot-rh7.
> The mipsroot-rh7 (bigendian) root image seem to work fine, but when
> I use the mipselroot-rh7-20010606 (littleendian) I get an illegal
> instruction.
> [cat:179] Illegal instruction 7c010001 at 2ac8b20c ra=00000000.
>
> I'm using a 2.4.3 kernel.
> Anyone got an idea ?
>
> /Carsten
>
Is the userland compiled with MIPS I option? I bet this is the same nasty
MIPS_ATOMIC_SET bug.
Currently, there are three fixes. One is from Florian, which only takes care
of CPUs with ll/sc. Another is from Maceij, which introduces a new syscall,
and some changes in glibc. The thrid is mine, a compromising one. It takes
care of both ll/sc case and non-llsc case, has minimum change, and practically
makes all programs happy.
Ralf, please take at least one of the fixes. Even a not-so-good fix is better
than no fix.
Jun
[-- Attachment #2: MIPS_ATOMIC_SET-compromising-fix.010626.010626.pathc --]
[-- Type: text/plain, Size: 3935 bytes --]
This is a compromising fix for sysmips(MIPS_ATOMIC_SET, ...). It
forces SIGSYS when the return value is a small negative value. This
limit is OK for glibc.
Jun
diff -Nru linux/arch/mips/kernel/sysmips.c.orig linux/arch/mips/kernel/sysmips.c
--- linux/arch/mips/kernel/sysmips.c.orig Mon Apr 23 11:32:54 2001
+++ linux/arch/mips/kernel/sysmips.c Tue Jun 26 11:50:48 2001
@@ -16,7 +16,7 @@
#include <linux/sched.h>
#include <linux/string.h>
#include <linux/utsname.h>
-
+#include <linux/signal.h>
#include <asm/cachectl.h>
#include <asm/pgalloc.h>
#include <asm/sysmips.h>
@@ -75,53 +75,83 @@
}
case MIPS_ATOMIC_SET: {
-#ifdef CONFIG_CPU_HAS_LLSC
- unsigned int tmp;
+ int *ptr, val, ret, err, tmp;
+ struct siginfo info;
- p = (int *) arg1;
- errno = verify_area(VERIFY_WRITE, p, sizeof(*p));
- if (errno)
- return errno;
- errno = 0;
-
- __asm__(".set\tpush\t\t\t# sysmips(MIPS_ATOMIC, ...)\n\t"
- ".set\tmips2\n\t"
- ".set\tnoat\n\t"
- "1:\tll\t%0, %4\n\t"
- "move\t$1, %3\n\t"
- "2:\tsc\t$1, %1\n\t"
- "beqz\t$1, 1b\n\t"
- ".set\tpop\n\t"
- ".section\t.fixup,\"ax\"\n"
- "3:\tli\t%2, 1\t\t\t# error\n\t"
- ".previous\n\t"
- ".section\t__ex_table,\"a\"\n\t"
- ".word\t1b, 3b\n\t"
- ".word\t2b, 3b\n\t"
- ".previous\n\t"
- : "=&r" (tmp), "=o" (* (u32 *) p), "=r" (errno)
- : "r" (arg2), "o" (* (u32 *) p), "2" (errno)
- : "$1");
+ ptr = (int *)arg1;
+ val = (int)arg2;
- if (errno)
- return -EFAULT;
+ /* Don't emulate unaligned accesses. */
+ if ((int)ptr & 3) {
+ info.si_signo = SIGBUS;
+ info.si_code = BUS_ADRALN;
+ goto fault;
+ }
+
+ /* A zero here saves us three instructions. */
+ err = verify_area(VERIFY_WRITE, ptr, 0);
+ if (err) {
+ info.si_signo = SIGSEGV;
+ info.si_code = SEGV_ACCERR;
+ goto fault;
+ }
- /* We're skipping error handling etc. */
- if (current->ptrace & PT_TRACESYS)
- syscall_trace();
-
- ((struct pt_regs *)&cmd)->regs[2] = tmp;
- ((struct pt_regs *)&cmd)->regs[7] = 0;
-
- __asm__ __volatile__(
- "move\t$29, %0\n\t"
- "j\to32_ret_from_sys_call"
- : /* No outputs */
- : "r" (&cmd));
- /* Unreached */
+#ifdef CONFIG_CPU_HAS_LLSC
+ __asm__(".set mips2\n\t"
+ "1:\n\t"
+ "ll %0,%5\n\t"
+ ".set push\n\t"
+ ".set noreorder\n\t"
+ "beq %0,%4,3f\n\t"
+ " move %3,%4\n"
+ ".set pop\n\t"
+ "2:\n\t"
+ "sc %3,%1\n\t"
+ "beqz %3,1b\n\t"
+ "3:\n\t"
+ ".set mips0\n\t"
+ ".section .fixup,\"ax\"\n"
+ "4:\n\t"
+ "li %2,%7\n\t"
+ "j 3b\n\t"
+ ".previous\n\t"
+ ".section __ex_table,\"a\"\n\t"
+ ".word 1b,4b\n\t"
+ ".word 2b,4b\n\t"
+ ".previous"
+ : "=&r" (ret), "=R" (*ptr), "=r" (err), "=&r" (tmp)
+ : "r" (val), "1" (*ptr), "2" (0), "i" (-EFAULT));
#else
- printk("sys_sysmips(MIPS_ATOMIC_SET, ...) not ready for !CONFIG_CPU_HAS_LLSC\n");
+ save_and_cli(tmp);
+ err = __get_user(ret, ptr);
+ if (ret != val)
+ err |= __put_user(val, ptr); /* No fault
+ unless unwriteable. */
+ restore_flags(tmp);
#endif
+
+ if (err) {
+ info.si_signo = SIGSEGV;
+ info.si_code = SEGV_MAPERR;
+ goto fault;
+ }
+
+ if ( (ret < 0) && (ret >= -EMAXERRNO) ) {
+ info.si_signo = SIGSYS;
+ info.si_code = 0;
+ goto fault;
+ }
+
+ return ret;
+
+fault:
+ /* Go back to SYSCALL. */
+ ((struct pt_regs *)&cmd)->cp0_epc -= 4;
+
+ info.si_addr = (void *)((struct pt_regs *)&cmd)->cp0_epc;
+ force_sig_info(info.si_signo, &info, current);
+
+ return 0;
}
case MIPS_FIXADE:
[-- Attachment #3: flo-fast-sysmips.0105X.X.patch --]
[-- Type: text/plain, Size: 4595 bytes --]
diff -Nur linux.orig/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
--- linux.orig/arch/mips/kernel/Makefile Mon Apr 9 00:23:08 2001
+++ linux/arch/mips/kernel/Makefile Mon Apr 9 00:23:34 2001
@@ -20,7 +20,7 @@
obj-y += branch.o process.o signal.o entry.o \
traps.o ptrace.o vm86.o ioport.o reset.o \
semaphore.o setup.o syscall.o sysmips.o \
- ipc.o scall_o32.o unaligned.o
+ ipc.o scall_o32.o unaligned.o fast-sysmips.o
obj-$(CONFIG_MODULES) += mips_ksyms.o
ifdef CONFIG_CPU_R3000
@@ -69,5 +69,6 @@
entry.o: entry.S
head.o: head.S
+fast-sysmips.o: fast-sysmips.S
include $(TOPDIR)/Rules.make
diff -Nur linux.orig/arch/mips/kernel/fast-sysmips.S linux/arch/mips/kernel/fast-sysmips.S
--- linux.orig/arch/mips/kernel/fast-sysmips.S Thu Jan 1 01:00:00 1970
+++ linux/arch/mips/kernel/fast-sysmips.S Mon Apr 9 00:28:20 2001
@@ -0,0 +1,85 @@
+/*
+ * MIPS_ATOMIC_SET asm implementation for ll/sc capable cpus
+ *
+ * This file is subject to the terms and conditions of the GNU General Public
+ * License. See the file "COPYING" in the main directory of this archive
+ * for more details.
+ *
+ * Copyright (C) 2001 Florian Lohoff <flo@rfc822.org>
+ *
+ */
+#include <asm/asm.h>
+#include <asm/mipsregs.h>
+#include <asm/regdef.h>
+#include <asm/stackframe.h>
+#include <asm/isadep.h>
+#include <asm/unistd.h>
+#include <asm/sysmips.h>
+#include <asm/offset.h>
+#include <asm/errno.h>
+
+#define PT_TRACESYS 0x00000002
+
+ EXPORT(fast_sysmips)
+
+ .set noreorder
+
+ li t0, MIPS_ATOMIC_SET
+ beq a0, t0, 1f
+ nop
+ j sys_sysmips
+ nop
+
+1:
+
+ # a0 - MIPS_ATOMIC_SET
+ # a1 - mem ptr
+ # a2 - value
+
+ addiu sp, sp, -8 # Reserve space
+ sw a0, (sp) # Save arg0
+
+ addiu a0, a1, 4 # addr+size
+ ori v0, a1, 4 # addr | size
+ lw v1, THREAD_CURDS(gp) # current->thread.current_ds
+ or v0, v0, a0 # addr | size | (addr+size)
+ and v1, v1, v0 # (mask)&(addr | size | (addr+size)
+ bltz v1, 5f
+ nop
+
+2:
+ ll v0, (a1)
+ move t0, a2
+ sc t0, (a1)
+ beqz t0, 2b
+ nop
+
+ sw v0, PT_R2+8(sp) # Result value
+ sw zero, PT_R7+8(sp) # Success indicator
+
+ lw t0, TASK_PTRACE(gp) # syscall tracing enabled?
+ andi t0, PT_TRACESYS
+ bnez t0, 3f
+ nop
+
+4:
+ lw a0, (sp) # Restore arg0
+ addiu sp, sp, 8 # Restore sp
+
+ j o32_ret_from_sys_call
+ nop
+
+3:
+ sw ra, 4(sp)
+ jal syscall_trace
+ nop
+ lw ra, 4(sp)
+ j 4b
+ nop
+
+5:
+ lw a0, (sp) # Restore arg0
+ addiu sp, sp, 8 # Restore sp
+ j ra
+ li v0, -EFAULT
+
diff -Nur linux.orig/arch/mips/kernel/irix5sys.h linux/arch/mips/kernel/irix5sys.h
--- linux.orig/arch/mips/kernel/irix5sys.h Mon Apr 9 00:16:29 2001
+++ linux/arch/mips/kernel/irix5sys.h Sun Apr 8 21:21:16 2001
@@ -69,7 +69,7 @@
SYS(irix_getgid, 0) /* 1047 getgid() V*/
SYS(irix_unimp, 0) /* 1048 (XXX IRIX 4 ssig) V*/
SYS(irix_msgsys, 6) /* 1049 sys_msgsys V*/
-SYS(sys_sysmips, 4) /* 1050 sysmips() HV*/
+SYS(fast_sysmips, 4) /* 1050 sysmips() HV*/
SYS(irix_unimp, 0) /* 1051 XXX sysacct() IV*/
SYS(irix_shmsys, 5) /* 1052 sys_shmsys V*/
SYS(irix_semsys, 0) /* 1053 sys_semsys V*/
diff -Nur linux.orig/arch/mips/kernel/syscalls.h linux/arch/mips/kernel/syscalls.h
--- linux.orig/arch/mips/kernel/syscalls.h Mon Apr 9 00:16:30 2001
+++ linux/arch/mips/kernel/syscalls.h Sun Apr 8 21:21:43 2001
@@ -163,7 +163,7 @@
SYS(sys_writev, 3)
SYS(sys_cacheflush, 3)
SYS(sys_cachectl, 3)
-SYS(sys_sysmips, 4)
+SYS(fast_sysmips, 4)
SYS(sys_ni_syscall, 0) /* 4150 */
SYS(sys_getsid, 1)
SYS(sys_fdatasync, 0)
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-06 22:04 ` Jun Sun
@ 2001-07-10 11:14 ` Carsten Langgaard
2001-07-10 17:31 ` H . J . Lu
0 siblings, 1 reply; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-10 11:14 UTC (permalink / raw)
To: Jun Sun; +Cc: ralf, vhouten, linux-mips, H . J . Lu
Thanks, that did the trick.
Now I would like to try to install H.J. Lu's RedHat7.1 RPM packages.
If I just do a:
rpm -Uvh --root /mnt/harddisk *.rpm
then it fails on a lot of dependencies. If I try to force the install like this:
rpm -Uvh --nodeps --force --root /mnt/harddisk *.rpm
then it actually install a lot of the RPMs, but still some fails, because it actually need
then dependencies.
If I try to redo the above it seems to go better the second time, because a lot of the
dependencies is solved (installed).
Is this really the way to install a set of RPMs like this or is there a better way?
/Carsten
Jun Sun wrote:
> Carsten Langgaard wrote:
> >
> > Hi Karel,
> >
> > I have tried the root-images tar-files: mipselroot-rh7-20010606 and
> > mipsroot-rh7.
> > The mipsroot-rh7 (bigendian) root image seem to work fine, but when
> > I use the mipselroot-rh7-20010606 (littleendian) I get an illegal
> > instruction.
> > [cat:179] Illegal instruction 7c010001 at 2ac8b20c ra=00000000.
> >
> > I'm using a 2.4.3 kernel.
> > Anyone got an idea ?
> >
> > /Carsten
> >
>
> Is the userland compiled with MIPS I option? I bet this is the same nasty
> MIPS_ATOMIC_SET bug.
>
> Currently, there are three fixes. One is from Florian, which only takes care
> of CPUs with ll/sc. Another is from Maceij, which introduces a new syscall,
> and some changes in glibc. The thrid is mine, a compromising one. It takes
> care of both ll/sc case and non-llsc case, has minimum change, and practically
> makes all programs happy.
>
> Ralf, please take at least one of the fixes. Even a not-so-good fix is better
> than no fix.
>
> Jun
>
> ------------------------------------------------------------------------
>
> This is a compromising fix for sysmips(MIPS_ATOMIC_SET, ...). It
> forces SIGSYS when the return value is a small negative value. This
> limit is OK for glibc.
>
> Jun
>
> diff -Nru linux/arch/mips/kernel/sysmips.c.orig linux/arch/mips/kernel/sysmips.c
> --- linux/arch/mips/kernel/sysmips.c.orig Mon Apr 23 11:32:54 2001
> +++ linux/arch/mips/kernel/sysmips.c Tue Jun 26 11:50:48 2001
> @@ -16,7 +16,7 @@
> #include <linux/sched.h>
> #include <linux/string.h>
> #include <linux/utsname.h>
> -
> +#include <linux/signal.h>
> #include <asm/cachectl.h>
> #include <asm/pgalloc.h>
> #include <asm/sysmips.h>
> @@ -75,53 +75,83 @@
> }
>
> case MIPS_ATOMIC_SET: {
> -#ifdef CONFIG_CPU_HAS_LLSC
> - unsigned int tmp;
> + int *ptr, val, ret, err, tmp;
> + struct siginfo info;
>
> - p = (int *) arg1;
> - errno = verify_area(VERIFY_WRITE, p, sizeof(*p));
> - if (errno)
> - return errno;
> - errno = 0;
> -
> - __asm__(".set\tpush\t\t\t# sysmips(MIPS_ATOMIC, ...)\n\t"
> - ".set\tmips2\n\t"
> - ".set\tnoat\n\t"
> - "1:\tll\t%0, %4\n\t"
> - "move\t$1, %3\n\t"
> - "2:\tsc\t$1, %1\n\t"
> - "beqz\t$1, 1b\n\t"
> - ".set\tpop\n\t"
> - ".section\t.fixup,\"ax\"\n"
> - "3:\tli\t%2, 1\t\t\t# error\n\t"
> - ".previous\n\t"
> - ".section\t__ex_table,\"a\"\n\t"
> - ".word\t1b, 3b\n\t"
> - ".word\t2b, 3b\n\t"
> - ".previous\n\t"
> - : "=&r" (tmp), "=o" (* (u32 *) p), "=r" (errno)
> - : "r" (arg2), "o" (* (u32 *) p), "2" (errno)
> - : "$1");
> + ptr = (int *)arg1;
> + val = (int)arg2;
>
> - if (errno)
> - return -EFAULT;
> + /* Don't emulate unaligned accesses. */
> + if ((int)ptr & 3) {
> + info.si_signo = SIGBUS;
> + info.si_code = BUS_ADRALN;
> + goto fault;
> + }
> +
> + /* A zero here saves us three instructions. */
> + err = verify_area(VERIFY_WRITE, ptr, 0);
> + if (err) {
> + info.si_signo = SIGSEGV;
> + info.si_code = SEGV_ACCERR;
> + goto fault;
> + }
>
> - /* We're skipping error handling etc. */
> - if (current->ptrace & PT_TRACESYS)
> - syscall_trace();
> -
> - ((struct pt_regs *)&cmd)->regs[2] = tmp;
> - ((struct pt_regs *)&cmd)->regs[7] = 0;
> -
> - __asm__ __volatile__(
> - "move\t$29, %0\n\t"
> - "j\to32_ret_from_sys_call"
> - : /* No outputs */
> - : "r" (&cmd));
> - /* Unreached */
> +#ifdef CONFIG_CPU_HAS_LLSC
> + __asm__(".set mips2\n\t"
> + "1:\n\t"
> + "ll %0,%5\n\t"
> + ".set push\n\t"
> + ".set noreorder\n\t"
> + "beq %0,%4,3f\n\t"
> + " move %3,%4\n"
> + ".set pop\n\t"
> + "2:\n\t"
> + "sc %3,%1\n\t"
> + "beqz %3,1b\n\t"
> + "3:\n\t"
> + ".set mips0\n\t"
> + ".section .fixup,\"ax\"\n"
> + "4:\n\t"
> + "li %2,%7\n\t"
> + "j 3b\n\t"
> + ".previous\n\t"
> + ".section __ex_table,\"a\"\n\t"
> + ".word 1b,4b\n\t"
> + ".word 2b,4b\n\t"
> + ".previous"
> + : "=&r" (ret), "=R" (*ptr), "=r" (err), "=&r" (tmp)
> + : "r" (val), "1" (*ptr), "2" (0), "i" (-EFAULT));
> #else
> - printk("sys_sysmips(MIPS_ATOMIC_SET, ...) not ready for !CONFIG_CPU_HAS_LLSC\n");
> + save_and_cli(tmp);
> + err = __get_user(ret, ptr);
> + if (ret != val)
> + err |= __put_user(val, ptr); /* No fault
> + unless unwriteable. */
> + restore_flags(tmp);
> #endif
> +
> + if (err) {
> + info.si_signo = SIGSEGV;
> + info.si_code = SEGV_MAPERR;
> + goto fault;
> + }
> +
> + if ( (ret < 0) && (ret >= -EMAXERRNO) ) {
> + info.si_signo = SIGSYS;
> + info.si_code = 0;
> + goto fault;
> + }
> +
> + return ret;
> +
> +fault:
> + /* Go back to SYSCALL. */
> + ((struct pt_regs *)&cmd)->cp0_epc -= 4;
> +
> + info.si_addr = (void *)((struct pt_regs *)&cmd)->cp0_epc;
> + force_sig_info(info.si_signo, &info, current);
> +
> + return 0;
> }
>
> case MIPS_FIXADE:
>
> ------------------------------------------------------------------------
> diff -Nur linux.orig/arch/mips/kernel/Makefile linux/arch/mips/kernel/Makefile
> --- linux.orig/arch/mips/kernel/Makefile Mon Apr 9 00:23:08 2001
> +++ linux/arch/mips/kernel/Makefile Mon Apr 9 00:23:34 2001
> @@ -20,7 +20,7 @@
> obj-y += branch.o process.o signal.o entry.o \
> traps.o ptrace.o vm86.o ioport.o reset.o \
> semaphore.o setup.o syscall.o sysmips.o \
> - ipc.o scall_o32.o unaligned.o
> + ipc.o scall_o32.o unaligned.o fast-sysmips.o
> obj-$(CONFIG_MODULES) += mips_ksyms.o
>
> ifdef CONFIG_CPU_R3000
> @@ -69,5 +69,6 @@
>
> entry.o: entry.S
> head.o: head.S
> +fast-sysmips.o: fast-sysmips.S
>
> include $(TOPDIR)/Rules.make
> diff -Nur linux.orig/arch/mips/kernel/fast-sysmips.S linux/arch/mips/kernel/fast-sysmips.S
> --- linux.orig/arch/mips/kernel/fast-sysmips.S Thu Jan 1 01:00:00 1970
> +++ linux/arch/mips/kernel/fast-sysmips.S Mon Apr 9 00:28:20 2001
> @@ -0,0 +1,85 @@
> +/*
> + * MIPS_ATOMIC_SET asm implementation for ll/sc capable cpus
> + *
> + * This file is subject to the terms and conditions of the GNU General Public
> + * License. See the file "COPYING" in the main directory of this archive
> + * for more details.
> + *
> + * Copyright (C) 2001 Florian Lohoff <flo@rfc822.org>
> + *
> + */
> +#include <asm/asm.h>
> +#include <asm/mipsregs.h>
> +#include <asm/regdef.h>
> +#include <asm/stackframe.h>
> +#include <asm/isadep.h>
> +#include <asm/unistd.h>
> +#include <asm/sysmips.h>
> +#include <asm/offset.h>
> +#include <asm/errno.h>
> +
> +#define PT_TRACESYS 0x00000002
> +
> + EXPORT(fast_sysmips)
> +
> + .set noreorder
> +
> + li t0, MIPS_ATOMIC_SET
> + beq a0, t0, 1f
> + nop
> + j sys_sysmips
> + nop
> +
> +1:
> +
> + # a0 - MIPS_ATOMIC_SET
> + # a1 - mem ptr
> + # a2 - value
> +
> + addiu sp, sp, -8 # Reserve space
> + sw a0, (sp) # Save arg0
> +
> + addiu a0, a1, 4 # addr+size
> + ori v0, a1, 4 # addr | size
> + lw v1, THREAD_CURDS(gp) # current->thread.current_ds
> + or v0, v0, a0 # addr | size | (addr+size)
> + and v1, v1, v0 # (mask)&(addr | size | (addr+size)
> + bltz v1, 5f
> + nop
> +
> +2:
> + ll v0, (a1)
> + move t0, a2
> + sc t0, (a1)
> + beqz t0, 2b
> + nop
> +
> + sw v0, PT_R2+8(sp) # Result value
> + sw zero, PT_R7+8(sp) # Success indicator
> +
> + lw t0, TASK_PTRACE(gp) # syscall tracing enabled?
> + andi t0, PT_TRACESYS
> + bnez t0, 3f
> + nop
> +
> +4:
> + lw a0, (sp) # Restore arg0
> + addiu sp, sp, 8 # Restore sp
> +
> + j o32_ret_from_sys_call
> + nop
> +
> +3:
> + sw ra, 4(sp)
> + jal syscall_trace
> + nop
> + lw ra, 4(sp)
> + j 4b
> + nop
> +
> +5:
> + lw a0, (sp) # Restore arg0
> + addiu sp, sp, 8 # Restore sp
> + j ra
> + li v0, -EFAULT
> +
> diff -Nur linux.orig/arch/mips/kernel/irix5sys.h linux/arch/mips/kernel/irix5sys.h
> --- linux.orig/arch/mips/kernel/irix5sys.h Mon Apr 9 00:16:29 2001
> +++ linux/arch/mips/kernel/irix5sys.h Sun Apr 8 21:21:16 2001
> @@ -69,7 +69,7 @@
> SYS(irix_getgid, 0) /* 1047 getgid() V*/
> SYS(irix_unimp, 0) /* 1048 (XXX IRIX 4 ssig) V*/
> SYS(irix_msgsys, 6) /* 1049 sys_msgsys V*/
> -SYS(sys_sysmips, 4) /* 1050 sysmips() HV*/
> +SYS(fast_sysmips, 4) /* 1050 sysmips() HV*/
> SYS(irix_unimp, 0) /* 1051 XXX sysacct() IV*/
> SYS(irix_shmsys, 5) /* 1052 sys_shmsys V*/
> SYS(irix_semsys, 0) /* 1053 sys_semsys V*/
> diff -Nur linux.orig/arch/mips/kernel/syscalls.h linux/arch/mips/kernel/syscalls.h
> --- linux.orig/arch/mips/kernel/syscalls.h Mon Apr 9 00:16:30 2001
> +++ linux/arch/mips/kernel/syscalls.h Sun Apr 8 21:21:43 2001
> @@ -163,7 +163,7 @@
> SYS(sys_writev, 3)
> SYS(sys_cacheflush, 3)
> SYS(sys_cachectl, 3)
> -SYS(sys_sysmips, 4)
> +SYS(fast_sysmips, 4)
> SYS(sys_ni_syscall, 0) /* 4150 */
> SYS(sys_getsid, 1)
> SYS(sys_fdatasync, 0)
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-10 11:14 ` Carsten Langgaard
@ 2001-07-10 17:31 ` H . J . Lu
2001-07-16 11:26 ` Carsten Langgaard
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-10 17:31 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: Jun Sun, ralf, vhouten, linux-mips
On Tue, Jul 10, 2001 at 01:14:12PM +0200, Carsten Langgaard wrote:
> Thanks, that did the trick.
> Now I would like to try to install H.J. Lu's RedHat7.1 RPM packages.
> If I just do a:
> rpm -Uvh --root /mnt/harddisk *.rpm
Those rpms have to be installed in the right order. I have a set up
to do that. I will see what I can do.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Illegal instruction
2001-07-10 17:31 ` H . J . Lu
@ 2001-07-16 11:26 ` Carsten Langgaard
2001-07-16 21:28 ` Updates on RedHat 7.1/mips H . J . Lu
0 siblings, 1 reply; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-16 11:26 UTC (permalink / raw)
To: H . J . Lu; +Cc: Jun Sun, ralf, vhouten, linux-mips
"H . J . Lu" wrote:
> On Tue, Jul 10, 2001 at 01:14:12PM +0200, Carsten Langgaard wrote:
> > Thanks, that did the trick.
> > Now I would like to try to install H.J. Lu's RedHat7.1 RPM packages.
> > If I just do a:
> > rpm -Uvh --root /mnt/harddisk *.rpm
>
> Those rpms have to be installed in the right order. I have a set up
> to do that. I will see what I can do.
Thanks, please do.
Another thing, I can see your distribution is lacking kernel header
files, I guess they are needed to do a native compile of the source RPMs.
Are you only cross compiling the RPMs.
It would be great, if you could put together a RPM containing the kernel
header files.
>
> H.J.
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Updates on RedHat 7.1/mips
2001-07-16 11:26 ` Carsten Langgaard
@ 2001-07-16 21:28 ` H . J . Lu
2001-07-17 19:16 ` Carsten Langgaard
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-16 21:28 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: Jun Sun, ralf, vhouten, linux-mips
On Mon, Jul 16, 2001 at 01:26:32PM +0200, Carsten Langgaard wrote:
> "H . J . Lu" wrote:
> > > Now I would like to try to install H.J. Lu's RedHat7.1 RPM packages.
> > > If I just do a:
> > > rpm -Uvh --root /mnt/harddisk *.rpm
> >
> > Those rpms have to be installed in the right order. I have a set up
> > to do that. I will see what I can do.
>
> Thanks, please do.
They are in install.tar.bz2 now.
> Another thing, I can see your distribution is lacking kernel header
> files, I guess they are needed to do a native compile of the source RPMs.
I added gdb and kernel-headers. I also updated gcc, glibc and binutils.
The toolchain rpms are updated.
H.J.
------
My mini-port of RedHat 7.1 is at
ftp://oss.sgi.com/pub/linux/mips/redhat/7.1/
you should be able to put a small RedHat 7.1 on the mips/mipsel box and
compile the rest of RedHat 7.1 yourselves.
Here are something you should know:
1. The cross compiler hosted on RedHat 7.1/ia32 is provided as a
toolchain rpm. The binary rpms for the mips and mipsel cross compilers
are included. You will need glibc 2.2.3-11 or above to use those
rpms. The glibc x86 binary rpms under RPMS/i386 should be ok.
2. You have to find a way to put those rpms on your machine. I use
network boot and NFS root to do it.
3. install.tar.bz2 has some scripts to prepare NFS root and install
RedHat 7.1 on a hard drive.
Thanks.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-16 21:28 ` Updates on RedHat 7.1/mips H . J . Lu
@ 2001-07-17 19:16 ` Carsten Langgaard
2001-07-17 19:29 ` H . J . Lu
0 siblings, 1 reply; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-17 19:16 UTC (permalink / raw)
To: H . J . Lu; +Cc: Jun Sun, ralf, vhouten, linux-mips
"H . J . Lu" wrote:
> On Mon, Jul 16, 2001 at 01:26:32PM +0200, Carsten Langgaard wrote:
> > "H . J . Lu" wrote:
> > > > Now I would like to try to install H.J. Lu's RedHat7.1 RPM packages.
> > > > If I just do a:
> > > > rpm -Uvh --root /mnt/harddisk *.rpm
> > >
> > > Those rpms have to be installed in the right order. I have a set up
> > > to do that. I will see what I can do.
> >
> > Thanks, please do.
>
> They are in install.tar.bz2 now.
Thanks a lot, that look like something we have been needing for a long time
> > Another thing, I can see your distribution is lacking kernel header
> > files, I guess they are needed to do a native compile of the source RPMs.
>
> I added gdb and kernel-headers. I also updated gcc, glibc and binutils.
> The toolchain rpms are updated.
Now that I'm at it :-)
Could you add a Perl rpm to you distribution, this also seems to be needed to
build the RPMs natively.
I also would like to do a cross build, but how do I do that ?
Do I have to change all the spec files, to set the target arch to MIPS, or is
there a easier and better way to do that ?
I guess if I just install the SRPMs and the cross toolchain, and try to build
out of that I will simply build for the build platform, which is i386.
>
>
> H.J.
> ------
> My mini-port of RedHat 7.1 is at
>
> ftp://oss.sgi.com/pub/linux/mips/redhat/7.1/
>
> you should be able to put a small RedHat 7.1 on the mips/mipsel box and
> compile the rest of RedHat 7.1 yourselves.
>
> Here are something you should know:
>
> 1. The cross compiler hosted on RedHat 7.1/ia32 is provided as a
> toolchain rpm. The binary rpms for the mips and mipsel cross compilers
> are included. You will need glibc 2.2.3-11 or above to use those
> rpms. The glibc x86 binary rpms under RPMS/i386 should be ok.
> 2. You have to find a way to put those rpms on your machine. I use
> network boot and NFS root to do it.
> 3. install.tar.bz2 has some scripts to prepare NFS root and install
> RedHat 7.1 on a hard drive.
>
> Thanks.
>
> H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 19:16 ` Carsten Langgaard
@ 2001-07-17 19:29 ` H . J . Lu
2001-07-17 19:50 ` Daniel Jacobowitz
2001-07-18 7:13 ` Carsten Langgaard
0 siblings, 2 replies; 23+ messages in thread
From: H . J . Lu @ 2001-07-17 19:29 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: Jun Sun, ralf, vhouten, linux-mips
On Tue, Jul 17, 2001 at 09:16:05PM +0200, Carsten Langgaard wrote:
> Could you add a Perl rpm to you distribution, this also seems to be needed to
> build the RPMs natively.
Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
perl yourself. You may need to build/install the tcsh rpm first.
>
> I also would like to do a cross build, but how do I do that ?
> Do I have to change all the spec files, to set the target arch to MIPS, or is
> there a easier and better way to do that ?
> I guess if I just install the SRPMs and the cross toolchain, and try to build
> out of that I will simply build for the build platform, which is i386.
You need my patched `rpm' to do cross build. You also need some
specicial set up. I am enclosng a message of mine. I will see if
I can cleanup my cross build environment and upload it.
H.J.
-----
> they work great! Thanks for all your hard work. Now, I would like
> to be able to build some RPMs as well. I have never cross-built
> RPMs before. I took the SRPMS for make and tried:
>
> rpm -ba make.spec --target=mipsel
>
> This did not do anything and built nothing. Is there a FAQ that
> I can read on cross building RPMS in addition to the documentation
> on http://www.rpm.org/ ? Do you have any quick pointers? Thanks
> again.
Although my source rpms do support cross compile, FYI, all my
mips/mipsel rpms are cross compiled from ia32 machines, the
unpatched rpm, that is /bin/rpm, doesn't support cross compile.
In my RedHat 7.1, there are i386 rpm binaries which support
cross compile. I have a setup to cross build rpms to mips/mipsel.
Make sure your rpm sees
%__ar %{_target_prefix}-linux-ar
%__as %{_target_prefix}-linux-as
%__cc %{_target_prefix}-linux-gcc
%__cxx %{_target_prefix}-linux-c++
%__ld %{_target_prefix}-linux-ld
%__nm %{_target_prefix}-linux-nm
%__objcopy %{_target_prefix}-linux-objcopy
%__objdump %{_target_prefix}-linux-objdump
%__ranlib %{_target_prefix}-linux-ranlib
%__strip %{_target_prefix}-linux-strip
and do
# rpm --target=mips --define '_target_prefix mips'
or
# rpm --target=mipsel --define '_target_prefix mipsel'
BTW, you alao need to rebuild binutils with
# rpm --define 'ENABLE_ALL_TARGETS 1' -ta binutils-2.11.90.0.23.tar.gz
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 19:29 ` H . J . Lu
@ 2001-07-17 19:50 ` Daniel Jacobowitz
2001-07-17 19:57 ` H . J . Lu
2001-07-18 7:13 ` Carsten Langgaard
1 sibling, 1 reply; 23+ messages in thread
From: Daniel Jacobowitz @ 2001-07-17 19:50 UTC (permalink / raw)
To: H . J . Lu; +Cc: Jun Sun, linux-mips
On Tue, Jul 17, 2001 at 12:29:02PM -0700, H . J . Lu wrote:
> On Tue, Jul 17, 2001 at 09:16:05PM +0200, Carsten Langgaard wrote:
> > Could you add a Perl rpm to you distribution, this also seems to be needed to
> > build the RPMs natively.
>
> Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> perl yourself. You may need to build/install the tcsh rpm first.
It's not yet available for MIPS (later this week), but MontaVista Journeyman
contains the patches to cross-compile Perl. It's not pretty, though.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 19:50 ` Daniel Jacobowitz
@ 2001-07-17 19:57 ` H . J . Lu
2001-07-17 20:09 ` Ilya Volynets
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-17 19:57 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: Jun Sun, linux-mips
On Tue, Jul 17, 2001 at 12:50:27PM -0700, Daniel Jacobowitz wrote:
> >
> > Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> > perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> > mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> > zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> > perl yourself. You may need to build/install the tcsh rpm first.
>
> It's not yet available for MIPS (later this week), but MontaVista Journeyman
> contains the patches to cross-compile Perl. It's not pretty, though.
>
That is a reason why I didn't bother with cross-compile Perl :-). The
next thing on my todo list is to cross compile XFree86 :-(.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 19:57 ` H . J . Lu
@ 2001-07-17 20:09 ` Ilya Volynets
2001-07-17 20:11 ` H . J . Lu
0 siblings, 1 reply; 23+ messages in thread
From: Ilya Volynets @ 2001-07-17 20:09 UTC (permalink / raw)
To: H . J . Lu; +Cc: linux-mips
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 17 July 2001 12:57, H . J . Lu wrote:
> On Tue, Jul 17, 2001 at 12:50:27PM -0700, Daniel Jacobowitz wrote:
> > > Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> > > perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> > > mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> > > zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> > > perl yourself. You may need to build/install the tcsh rpm first.
> >
> > It's not yet available for MIPS (later this week), but MontaVista
> > Journeyman contains the patches to cross-compile Perl. It's not pretty,
> > though.
>
> That is a reason why I didn't bother with cross-compile Perl :-). The
> next thing on my todo list is to cross compile XFree86 :-(.
If you can get cross-compiling full XFree86, you'll be a hero of all times.
It shouldn't be hard to get it with KDriveArchitecture & TinyX enabled.
I was working on it a while ago, and here are few pointers:
Some tools have to be run natively (i.e. xkbcomp), but also need to
be installed on target. I din't find a rule that does both. I think new
rule is needed.
gcc-3.0 crashes when compiling some parts of Xserver and Xlib,
with very obscure bug. Minimal test case I came up with is
~45(!) lines long. Keith filed report to gcc team on my behalf,
but there seems to be no responce. I do not know if your
gcc has same problem, but someone mentioned similar problem
with 2.9x.y series on this list not so long ago.
Hmm... I can't remember any other interesting things at this moment, but if I
will, I'll follow up...
Ilya.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjtUm18ACgkQtKh84cA8u2ll+QCfSjexRpQ2H7Qa16JYrun/vvVd
vCQAoIKb1BRxJ/508SWu9uHEP0okhH00
=kWTa
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 20:09 ` Ilya Volynets
@ 2001-07-17 20:11 ` H . J . Lu
2001-07-18 3:52 ` Arnaldo Carvalho de Melo
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-17 20:11 UTC (permalink / raw)
To: Ilya Volynets; +Cc: linux-mips
On Tue, Jul 17, 2001 at 01:09:00PM -0700, Ilya Volynets wrote:
>
> I was working on it a while ago, and here are few pointers:
> Some tools have to be run natively (i.e. xkbcomp), but also need to
> be installed on target. I din't find a rule that does both. I think new
> rule is needed.
I am aware of those. I want to delay it as much as I can.
>
> gcc-3.0 crashes when compiling some parts of Xserver and Xlib,
> with very obscure bug. Minimal test case I came up with is
> ~45(!) lines long. Keith filed report to gcc team on my behalf,
> but there seems to be no responce. I do not know if your
> gcc has same problem, but someone mentioned similar problem
> with 2.9x.y series on this list not so long ago.
>
Don't bother with gcc-3.0. I won't use it myself for building X.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 20:11 ` H . J . Lu
@ 2001-07-18 3:52 ` Arnaldo Carvalho de Melo
2001-07-18 4:01 ` Ilya Volynets
0 siblings, 1 reply; 23+ messages in thread
From: Arnaldo Carvalho de Melo @ 2001-07-18 3:52 UTC (permalink / raw)
To: H . J . Lu; +Cc: Ilya Volynets, linux-mips
Em Tue, Jul 17, 2001 at 01:11:46PM -0700, H . J . Lu escreveu:
> On Tue, Jul 17, 2001 at 01:09:00PM -0700, Ilya Volynets wrote:
> >
> > I was working on it a while ago, and here are few pointers:
> > Some tools have to be run natively (i.e. xkbcomp), but also need to
> > be installed on target. I din't find a rule that does both. I think new
> > rule is needed.
>
> I am aware of those. I want to delay it as much as I can.
recent messages to the XFree86 mailing lists has the recipe to x-compile
XFree86, IIRC Keith Packard did the work
> >
> > gcc-3.0 crashes when compiling some parts of Xserver and Xlib,
> > with very obscure bug. Minimal test case I came up with is
> > ~45(!) lines long. Keith filed report to gcc team on my behalf,
> > but there seems to be no responce. I do not know if your
> > gcc has same problem, but someone mentioned similar problem
> > with 2.9x.y series on this list not so long ago.
> >
>
> Don't bother with gcc-3.0. I won't use it myself for building X.
>
>
> H.J.
--
- Arnaldo
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-18 3:52 ` Arnaldo Carvalho de Melo
@ 2001-07-18 4:01 ` Ilya Volynets
0 siblings, 0 replies; 23+ messages in thread
From: Ilya Volynets @ 2001-07-18 4:01 UTC (permalink / raw)
To: Arnaldo Carvalho de Melo, H . J . Lu; +Cc: linux-mips
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Those messages are about compiling using TinyX and KDrive, which
works with only minor modifications. Thing is, it is not what is really needed.
On Tuesday 17 July 2001 20:52, Arnaldo Carvalho de Melo wrote:
> Em Tue, Jul 17, 2001 at 01:11:46PM -0700, H . J . Lu escreveu:
> > On Tue, Jul 17, 2001 at 01:09:00PM -0700, Ilya Volynets wrote:
> > > I was working on it a while ago, and here are few pointers:
> > > Some tools have to be run natively (i.e. xkbcomp), but also need to
> > > be installed on target. I din't find a rule that does both. I think new
> > > rule is needed.
> >
> > I am aware of those. I want to delay it as much as I can.
>
> recent messages to the XFree86 mailing lists has the recipe to x-compile
> XFree86, IIRC Keith Packard did the work
>
> > > gcc-3.0 crashes when compiling some parts of Xserver and Xlib,
> > > with very obscure bug. Minimal test case I came up with is
> > > ~45(!) lines long. Keith filed report to gcc team on my behalf,
> > > but there seems to be no responce. I do not know if your
> > > gcc has same problem, but someone mentioned similar problem
> > > with 2.9x.y series on this list not so long ago.
> >
> > Don't bother with gcc-3.0. I won't use it myself for building X.
> >
> >
> > H.J.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.4 (GNU/Linux)
Comment: For info see http://www.gnupg.org
iEYEARECAAYFAjtVChMACgkQtKh84cA8u2nRTACgvPDSNX0E62POj2W+QkntYE9l
pzIAnAjjprS4qWgUfELszqT94T+XGV0C
=tJST
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-17 19:29 ` H . J . Lu
2001-07-17 19:50 ` Daniel Jacobowitz
@ 2001-07-18 7:13 ` Carsten Langgaard
2001-07-18 15:11 ` H . J . Lu
1 sibling, 1 reply; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-18 7:13 UTC (permalink / raw)
To: H . J . Lu; +Cc: Jun Sun, ralf, vhouten, linux-mips
"H . J . Lu" wrote:
> On Tue, Jul 17, 2001 at 09:16:05PM +0200, Carsten Langgaard wrote:
> > Could you add a Perl rpm to you distribution, this also seems to be needed to
> > build the RPMs natively.
>
> Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> perl yourself. You may need to build/install the tcsh rpm first.
It look like there is a cross dependence, the build of tcsh failed with the
following message:
/var/tmp/rpm-tmp.7250: /usr/bin/perl: No such file or directory
error: Bad exit status from /var/tmp/rpm-tmp.7250 (%build)
So tcsh is needed to build perl and perl is needed to build tcsh :-(
>
> >
> > I also would like to do a cross build, but how do I do that ?
> > Do I have to change all the spec files, to set the target arch to MIPS, or is
> > there a easier and better way to do that ?
> > I guess if I just install the SRPMs and the cross toolchain, and try to build
> > out of that I will simply build for the build platform, which is i386.
>
> You need my patched `rpm' to do cross build. You also need some
> specicial set up. I am enclosng a message of mine. I will see if
> I can cleanup my cross build environment and upload it.
>
> H.J.
> -----
> > they work great! Thanks for all your hard work. Now, I would like
> > to be able to build some RPMs as well. I have never cross-built
> > RPMs before. I took the SRPMS for make and tried:
> >
> > rpm -ba make.spec --target=mipsel
> >
> > This did not do anything and built nothing. Is there a FAQ that
> > I can read on cross building RPMS in addition to the documentation
> > on http://www.rpm.org/ ? Do you have any quick pointers? Thanks
> > again.
>
> Although my source rpms do support cross compile, FYI, all my
> mips/mipsel rpms are cross compiled from ia32 machines, the
> unpatched rpm, that is /bin/rpm, doesn't support cross compile.
> In my RedHat 7.1, there are i386 rpm binaries which support
> cross compile. I have a setup to cross build rpms to mips/mipsel.
> Make sure your rpm sees
>
> %__ar %{_target_prefix}-linux-ar
> %__as %{_target_prefix}-linux-as
> %__cc %{_target_prefix}-linux-gcc
> %__cxx %{_target_prefix}-linux-c++
> %__ld %{_target_prefix}-linux-ld
> %__nm %{_target_prefix}-linux-nm
> %__objcopy %{_target_prefix}-linux-objcopy
> %__objdump %{_target_prefix}-linux-objdump
> %__ranlib %{_target_prefix}-linux-ranlib
> %__strip %{_target_prefix}-linux-strip
>
How do I do that ?
>
> and do
>
> # rpm --target=mips --define '_target_prefix mips'
>
> or
>
> # rpm --target=mipsel --define '_target_prefix mipsel'
>
> BTW, you alao need to rebuild binutils with
>
> # rpm --define 'ENABLE_ALL_TARGETS 1' -ta binutils-2.11.90.0.23.tar.gz
>
> H.J.
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-18 7:13 ` Carsten Langgaard
@ 2001-07-18 15:11 ` H . J . Lu
2001-07-18 15:23 ` Carsten Langgaard
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-18 15:11 UTC (permalink / raw)
To: Carsten Langgaard; +Cc: Jun Sun, ralf, vhouten, linux-mips
On Wed, Jul 18, 2001 at 09:13:20AM +0200, Carsten Langgaard wrote:
> "H . J . Lu" wrote:
>
> > On Tue, Jul 17, 2001 at 09:16:05PM +0200, Carsten Langgaard wrote:
> > > Could you add a Perl rpm to you distribution, this also seems to be needed to
> > > build the RPMs natively.
> >
> > Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> > perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> > mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> > zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> > perl yourself. You may need to build/install the tcsh rpm first.
>
> It look like there is a cross dependence, the build of tcsh failed with the
> following message:
>
> /var/tmp/rpm-tmp.7250: /usr/bin/perl: No such file or directory
> error: Bad exit status from /var/tmp/rpm-tmp.7250 (%build)
>
> So tcsh is needed to build perl and perl is needed to build tcsh :-(
>
It is ok since the tcsh binary has been built. Just install it to
/bin/tcsh and build the perl rpm. You may have to
# rpm --nodeps --force --rebuild perl-xxx.src.rpm
You only have to do those the first time.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-18 15:11 ` H . J . Lu
@ 2001-07-18 15:23 ` Carsten Langgaard
2001-07-18 20:53 ` Seth Mos
0 siblings, 1 reply; 23+ messages in thread
From: Carsten Langgaard @ 2001-07-18 15:23 UTC (permalink / raw)
To: H . J . Lu; +Cc: Jun Sun, ralf, vhouten, linux-mips
"H . J . Lu" wrote:
> On Wed, Jul 18, 2001 at 09:13:20AM +0200, Carsten Langgaard wrote:
> > "H . J . Lu" wrote:
> >
> > > On Tue, Jul 17, 2001 at 09:16:05PM +0200, Carsten Langgaard wrote:
> > > > Could you add a Perl rpm to you distribution, this also seems to be needed to
> > > > build the RPMs natively.
> > >
> > > Perl has to be built natively. I uploaded mysql-3.23.36-1.1.src.rpm,
> > > perl-5.6.0-12.1.src.rpm, apache-1.3.19-5.src.rpm,
> > > mod_perl-1.24_01-2.src.rpm, tcsh-6.10-5.src.rpm and
> > > zsh-3.0.8-8.src.rpm. Just installed my RedHat 7.1. Then you can build
> > > perl yourself. You may need to build/install the tcsh rpm first.
> >
> > It look like there is a cross dependence, the build of tcsh failed with the
> > following message:
> >
> > /var/tmp/rpm-tmp.7250: /usr/bin/perl: No such file or directory
> > error: Bad exit status from /var/tmp/rpm-tmp.7250 (%build)
> >
> > So tcsh is needed to build perl and perl is needed to build tcsh :-(
> >
>
> It is ok since the tcsh binary has been built. Just install it to
> /bin/tcsh and build the perl rpm. You may have to
>
> # rpm --nodeps --force --rebuild perl-xxx.src.rpm
>
> You only have to do those the first time.
I got through the tcsh and perl build, but now it fails on glibc.
make -s -j2 -C iconvdata others
make[2]: Entering directory `/usr/src/redhat/BUILD/glibc-2.2.3/iconvdata'
make[2]: warning: -jN forced in submake: disabling jobserver mode.
In file included from 8bit-gap.c:33,
from iso8859-15.c:28:
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260:
numeric constant with no digits
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260: parse
error before `nan'
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260:
numeric constant with no digits
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260: parse
error before `nan'
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:260: (near
initialization for `from_idx[1].idx')
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:261: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:261:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:261: (near
initialization for `from_idx[2].idx')
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:262: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:262:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:262: (near
initialization for `from_idx[3].idx')
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:263: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:263:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:263: (near
initialization for `from_idx[4].idx')
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:264: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:264:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:264: (near
initialization for `from_idx[5].idx')
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:265: `nan'
undeclared here (not in a function)
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:265:
initializer element is not constant
/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.h:265: (near
initialization for `from_idx[6].idx')
make[2]: ***
[/usr/src/redhat/BUILD/glibc-2.2.3/build-mipsel-linux/iconvdata/iso8859-15.os] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/usr/src/redhat/BUILD/glibc-2.2.3/iconvdata'
make[1]: *** [iconvdata/others] Error 2
make[1]: Leaving directory `/usr/src/redhat/BUILD/glibc-2.2.3'
make: *** [all] Error 2
error: Bad exit status from /var/tmp/rpm-tmp.98017 (%build)
RPM build errors:
Bad exit status from /var/tmp/rpm-tmp.98017 (%build)
>
> H.J.
--
_ _ ____ ___ Carsten Langgaard Mailto:carstenl@mips.com
|\ /|||___)(___ MIPS Denmark Direct: +45 4486 5527
| \/ ||| ____) Lautrupvang 4B Switch: +45 4486 5555
TECHNOLOGIES 2750 Ballerup Fax...: +45 4486 5556
Denmark http://www.mips.com
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-18 15:23 ` Carsten Langgaard
@ 2001-07-18 20:53 ` Seth Mos
2001-07-19 0:36 ` H . J . Lu
0 siblings, 1 reply; 23+ messages in thread
From: Seth Mos @ 2001-07-18 20:53 UTC (permalink / raw)
To: linux-mips; +Cc: H . J . Lu
I am having trouble getting the mipsel packages installed using the
installer provided for 7.1.
I have hooked up a second disk to my i386 workstatition that will house
the filesystem for my mipsel box. Once everything is installed I will put
this disk back in my Qube2 for testing. In the worst case scenario I will
need to boot with the 2.0 kernel that came with the cube.
I have the original disk for the Qube2 so it isn't a big problem if it
takes 50 attempts. I have a lot of patience ;-)
Am I correct to assume that I need to use the install.i386.hd on my
workstation to install the mipsel packages on the second harddrive (hdd in
my case)
I have tried this approach using both the Makefile approach and by running
the install.i386.hd script.
Traceback (innermost, last):
File "./findrpm", line 5, in ?
import rpm
ImportError: No module named rpm
Does this ring any bells?
The mipsel packages are located in the RPMS directory which is in the same
directory as the installer and I edited the Makefile and changed ROOT and
REDHAT-ROOT
I wonder if anyone can provide a basic root tarbal which I can use to set
up the basics after which i can start adding stuff.
If I get it into a decent state I will probably make a dump of the fs so
other people with a Qube (1 or 2) can easily clone it.
I was working to use a 2.4 kernel on a standard Qube but
that was a big problem since 2.4 does not compile with the compiler that
came with it and the glibc did not have large file support.
A fs that I would like to put on the Qube is XFS which I already use on my
own i386 home machines and production machines at work.
Since XFS is also tested on mip64 Irix (IIRC) ai64 PPC ai32 and alpha
under linux I expect that it will probably more work but it is more
resilient and faster recovering after crashes.
So if anyone can give advice on installing using the toolkit or provide a
bootable dump image or root tarbal I would be most grateful.
The qube2 comes with a boot loader that understands ext2 and loads the
linux kernel it finds on the system it will probably make it easier to
boot afterwards.
Cheers
Seth
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-18 20:53 ` Seth Mos
@ 2001-07-19 0:36 ` H . J . Lu
2001-07-19 21:03 ` Seth Mos
0 siblings, 1 reply; 23+ messages in thread
From: H . J . Lu @ 2001-07-19 0:36 UTC (permalink / raw)
To: Seth Mos; +Cc: linux-mips
On Wed, Jul 18, 2001 at 10:53:22PM +0200, Seth Mos wrote:
>
> I am having trouble getting the mipsel packages installed using the
> installer provided for 7.1.
>
>
> I have hooked up a second disk to my i386 workstatition that will house
> the filesystem for my mipsel box. Once everything is installed I will put
> this disk back in my Qube2 for testing. In the worst case scenario I will
> need to boot with the 2.0 kernel that came with the cube.
>
> I have the original disk for the Qube2 so it isn't a big problem if it
> takes 50 attempts. I have a lot of patience ;-)
>
> Am I correct to assume that I need to use the install.i386.hd on my
> workstation to install the mipsel packages on the second harddrive (hdd in
> my case)
No. It should be install.mipsel.nfs. install.mipsel.hd is for the
native mipsel machine install.
>
> Traceback (innermost, last):
> File "./findrpm", line 5, in ?
> import rpm
> ImportError: No module named rpm
>
> Does this ring any bells?
You need to install the rpm-python rpm.
> The mipsel packages are located in the RPMS directory which is in the same
> directory as the installer and I edited the Makefile and changed ROOT and
> REDHAT-ROOT
Sure.
>
> I wonder if anyone can provide a basic root tarbal which I can use to set
> up the basics after which i can start adding stuff.
>
install.mipsel.nfs is used to create a NFS root tree for mipsel. If
you tar it up, you get what you are asking for.
H.J.
^ permalink raw reply [flat|nested] 23+ messages in thread
* Re: Updates on RedHat 7.1/mips
2001-07-19 0:36 ` H . J . Lu
@ 2001-07-19 21:03 ` Seth Mos
0 siblings, 0 replies; 23+ messages in thread
From: Seth Mos @ 2001-07-19 21:03 UTC (permalink / raw)
To: H . J . Lu; +Cc: linux-mips
At 17:36 18-7-2001 -0700, H . J . Lu wrote:
>On Wed, Jul 18, 2001 at 10:53:22PM +0200, Seth Mos wrote:
> >
> > I am having trouble getting the mipsel packages installed using the
> > installer provided for 7.1.
> >
> >
> > I have hooked up a second disk to my i386 workstatition that will house
> > the filesystem for my mipsel box. Once everything is installed I will put
> > this disk back in my Qube2 for testing. In the worst case scenario I will
> > need to boot with the 2.0 kernel that came with the cube.
> >
> > I have the original disk for the Qube2 so it isn't a big problem if it
> > takes 50 attempts. I have a lot of patience ;-)
> >
> > Am I correct to assume that I need to use the install.i386.hd on my
> > workstation to install the mipsel packages on the second harddrive (hdd in
> > my case)
>
>No. It should be install.mipsel.nfs. install.mipsel.hd is for the
>native mipsel machine install.
Thank you, it worked :-)
> > Traceback (innermost, last):
> > File "./findrpm", line 5, in ?
> > import rpm
> > ImportError: No module named rpm
> >
> > Does this ring any bells?
>
>You need to install the rpm-python rpm.
And again, thank you.
>install.mipsel.nfs is used to create a NFS root tree for mipsel. If
>you tar it up, you get what you are asking for.
Will do once it works.
Everythinhg seems to be installed like it should and I copied the 2.0.34
cobalt kernel to /boot on the Qube2. I have enabled the serial console of
the Qube2 and see the firmware scroll along.
BOOTLOADER ramcode: selected partition /dev/hda1
Decompressing done
Executing bootloader kernel...
Jump_to_Real_Kernel: disk error, trying BFD again.
BOOTLOADER ramcode: selected partition /dev/hdc1
etc.. Qubes don't have the second IDE controller so this is nonsense ;-)
Does anybody know what's missing? Do I need to format the ext2 root fs in a
special way? Do I need to pass on other bootoptions and if so. How do I get
to a command line prompt of the firmware?
I see that the NetBSD people did that to make it boot another kernel.
I thought that the firmware from the Qubes just boot the vmlinux.gz image
that it finds in the /boot directory on hda1?
Any help appreciated.
Cheers
--
Seth
Every program has two purposes one for which
it was written and another for which it wasn't
I use the last kind.
^ permalink raw reply [flat|nested] 23+ messages in thread
end of thread, other threads:[~2001-07-19 21:03 UTC | newest]
Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2001-07-06 8:15 Illegal instruction Carsten Langgaard
2001-07-06 9:27 ` Houten K.H.C. van (Karel)
2001-07-06 11:42 ` Maciej W. Rozycki
2001-07-06 13:26 ` Dan Aizenstros
2001-07-06 22:04 ` Jun Sun
2001-07-10 11:14 ` Carsten Langgaard
2001-07-10 17:31 ` H . J . Lu
2001-07-16 11:26 ` Carsten Langgaard
2001-07-16 21:28 ` Updates on RedHat 7.1/mips H . J . Lu
2001-07-17 19:16 ` Carsten Langgaard
2001-07-17 19:29 ` H . J . Lu
2001-07-17 19:50 ` Daniel Jacobowitz
2001-07-17 19:57 ` H . J . Lu
2001-07-17 20:09 ` Ilya Volynets
2001-07-17 20:11 ` H . J . Lu
2001-07-18 3:52 ` Arnaldo Carvalho de Melo
2001-07-18 4:01 ` Ilya Volynets
2001-07-18 7:13 ` Carsten Langgaard
2001-07-18 15:11 ` H . J . Lu
2001-07-18 15:23 ` Carsten Langgaard
2001-07-18 20:53 ` Seth Mos
2001-07-19 0:36 ` H . J . Lu
2001-07-19 21:03 ` Seth Mos
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox