This patch provides support for building on PA-RISC. Please CC me on
any followups, as I am not subscribed to the list.
diff -Nur klibc-0.115/klibc/arch/parisc/Makefile.inc
klibc/klibc/arch/parisc/Makefile.inc
--- klibc-0.115/klibc/arch/parisc/Makefile.inc 2002-08-13 00:04:47.000000000
-0400
+++ klibc/klibc/arch/parisc/Makefile.inc 2004-04-08 09:56:21.333944000 -0400
@@ -7,4 +7,9 @@
# accordingly.
#
+ARCHOBJS = \
+ arch/$(ARCH)/setjmp.o
+
+ARCHOOBJS = $(patsubst %o,%.lo,%(ARCHOBJS))
+
archclean:
diff -Nur klibc-0.115/klibc/arch/parisc/crt0.S klibc/klibc/arch/parisc/crt0.S
--- klibc-0.115/klibc/arch/parisc/crt0.S 1969-12-31 19:00:00.000000000 -0500
+++ klibc/klibc/arch/parisc/crt0.S 2004-04-08 09:56:21.413944000 -0400
@@ -0,0 +1,34 @@
+ .align 4
+
+ .import $global$, data
+ .import __libc_init, code
+
+ .global _start
+ .export _start, ENTRY
+ .type _start,@function
+
+ .proc
+ .callinfo
+
+_start:
+/* extend the stack by 64-bytes */
+ ldo 64(%sp), %sp
+
+/* %r25 = argc
+ * %r24 = argv
+ * envp = argv + (argc + 1)
+ * elfdata = (argv - 4)
+ */
+ ldo -4(%r24), %r26
+
+/* load global data */
+ ldil L%$global$, %dp
+ ldo R%$global$(%dp), %dp
+
+/* branch to __libc_init */
+ bl __libc_init,%r2
+ nop
+/* break miserably if we ever return */
+ iitlbp %r0,(%r0) /* illegal instruction */
+ nop
+ .procend
diff -Nur klibc-0.115/klibc/arch/parisc/include/klibc/archsetjmp.h
klibc/klibc/arch/parisc/include/klibc/archsetjmp.h
--- klibc-0.115/klibc/arch/parisc/include/klibc/archsetjmp.h 1969-12-31
19:00:00.000000000 -0500
+++ klibc/klibc/arch/parisc/include/klibc/archsetjmp.h 2004-04-08
09:56:21.393944000 -0400
@@ -0,0 +1,12 @@
+/*
+ * arch/parisc/include/klibc/archsetjmp.h
+ *
+ */
+
+#ifndef _KLIBC_ARCHSETJMP_H
+#define _KLIBC_ARCHSETJMP_H
+
+typedef double jmp_buf[21];
+
+#endif
+
diff -Nur klibc-0.115/klibc/arch/parisc/include/klibc/archsignal.h
klibc/klibc/arch/parisc/include/klibc/archsignal.h
--- klibc-0.115/klibc/arch/parisc/include/klibc/archsignal.h 2003-11-23
19:37:07.000000000 -0500
+++ klibc/klibc/arch/parisc/include/klibc/archsignal.h 2004-04-08
09:56:21.353944000 -0400
@@ -8,6 +8,17 @@
#ifndef _KLIBC_ARCHSIGNAL_H
#define _KLIBC_ARCHSIGNAL_H
-/* No special stuff for this architecture */
+#define _NSIG 64
+#define _NSIG_SZ (_NSIG / LONG_BIT)
+
+typedef struct {
+ unsigned long sig[_NSIG_SZ];
+} sigset_t;
+
+struct sigaction {
+ __sighandler_t sa_handler;
+ unsigned long sa_flags;
+ sigset_t sa_mask;
+};
#endif
diff -Nur klibc-0.115/klibc/arch/parisc/setjmp.S
klibc/klibc/arch/parisc/setjmp.S
--- klibc-0.115/klibc/arch/parisc/setjmp.S 1969-12-31 19:00:00.000000000 -0500
+++ klibc/klibc/arch/parisc/setjmp.S 2004-04-08 09:56:21.443944000 -0400
@@ -0,0 +1,88 @@
+/*
+ * parisc specific setjmp/longjmp routines
+ *
+ */
+
+ .text
+ .align 4
+ .global setjmp
+ .export setjmp, code
+ .proc
+ .callinfo
+setjmp:
+ stw %r3,0(%r26)
+ stw %r4,8(%r26)
+ stw %r5,12(%r26)
+ stw %r6,16(%r26)
+ stw %r7,20(%r26)
+ stw %r8,24(%r26)
+ stw %r9,28(%r26)
+ stw %r10,32(%r26)
+ stw %r11,36(%r26)
+ stw %r12,40(%r26)
+ stw %r13,44(%r26)
+ stw %r14,48(%r26)
+ stw %r15,52(%r26)
+ stw %r16,56(%r26)
+ stw %r17,60(%r26)
+ stw %r18,64(%r26)
+ stw %r19,68(%r26)
+ stw %dp,72(%r26)
+ stw %r30,76(%r26)
+ stw %rp,80(%r26)
+ ldo 88(%r26),%r19
+ fstd,ma %fr12,8(%r19)
+ fstd,ma %fr13,8(%r19)
+ fstd,ma %fr14,8(%r19)
+ fstd,ma %fr15,8(%r19)
+ fstd,ma %fr16,8(%r19)
+ fstd,ma %fr17,8(%r19)
+ fstd,ma %fr18,8(%r19)
+ fstd,ma %fr19,8(%r19)
+ fstd,ma %fr20,8(%r19)
+ fstd %fr21,0(%r19)
+ bv %r0(%rp)
+ copy %r0,%r28
+ .procend
+
+ .text
+ .align 4
+ .global longjmp
+ .export longjmp, code
+ .proc
+ .callinfo
+longjmp:
+ ldw 0(%r26),%r3
+ ldw 8(%r26),%r4
+ ldw 12(%r26),%r5
+ ldw 16(%r26),%r6
+ ldw 20(%r26),%r7
+ ldw 24(%r26),%r8
+ ldw 28(%r26),%r9
+ ldw 32(%r26),%r10
+ ldw 36(%r26),%r11
+ ldw 40(%r26),%r12
+ ldw 44(%r26),%r13
+ ldw 48(%r26),%r14
+ ldw 52(%r26),%r15
+ ldw 56(%r26),%r16
+ ldw 60(%r26),%r17
+ ldw 64(%r26),%r18
+ ldw 68(%r26),%r19
+ ldw 72(%r26),%r27
+ ldw 76(%r26),%r30
+ ldw 80(%r26),%rp
+ ldo 88(%r26),%r20
+ fldd,ma 8(%r20),%fr12
+ fldd,ma 8(%r20),%fr13
+ fldd,ma 8(%r20),%fr14
+ fldd,ma 8(%r20),%fr15
+ fldd,ma 8(%r20),%fr16
+ fldd,ma 8(%r20),%fr17
+ fldd,ma 8(%r20),%fr18
+ fldd,ma 8(%r20),%fr19
+ fldd,ma 8(%r20),%fr20
+ fldd 0(%r20),%fr21
+ bv %r0(%rp)
+ copy %r25,%r28
+ .procend
Regards,
--
Kyle McMartin