]> Zhao Yanbai Git Server - minix.git/commitdiff
ARM: can build with llvm, switch to EABI 30/2930/7
authorBen Gras <ben@minix3.org>
Thu, 11 Dec 2014 14:00:57 +0000 (15:00 +0100)
committerBen Gras <ben@minix3.org>
Fri, 12 Dec 2014 12:04:56 +0000 (13:04 +0100)
. bitcode fixes
. switch to compiler-rt instead of netbsd libc functions
  or libgcc for support functions for both x86 and arm
. minor build fixes
. allow  build with llvm without crossbuilding llvm itself
. can now build minix/arm using llvm and eabi - without C++
  support for now (hence crossbuilding llvm itself is turned off
  for minix/arm)

Change-Id: If5c44ef766f5b4fc4394d4586ecc289927a0d6eb

38 files changed:
common/lib/libc/Makefile.inc
common/lib/libc/arch/arm/gen/divide.S [deleted file]
common/lib/libc/arch/arm/gen/divsi3.S [deleted file]
common/lib/libc/arch/arm/gen/modsi3.S [deleted file]
common/lib/libc/arch/arm/gen/udivsi3.S [deleted file]
common/lib/libc/arch/arm/gen/umodsi3.S [deleted file]
common/lib/libc/arch/arm/string/memset.S
distrib/sets/lists/minix/md.evbarm
distrib/sets/lists/minix/mi
external/bsd/Makefile
external/bsd/llvm/dist/clang/lib/Driver/ToolChain.cpp
external/bsd/nvi/dist/common/put.c
external/bsd/nvi/usr.bin/nvi/Makefile
lib/Makefile
lib/libc/Makefile
lib/libc/arch/arm/Makefile.inc
lib/libc/arch/arm/gen/Makefile.inc
lib/libc/compiler_rt/Makefile.inc
lib/libc/dlfcn/dlfcn_elf.c
lib/libcurses/Makefile
lib/libm/Makefile
lib/librmt/Makefile
lib/librmt/rmtlib.c
lib/libutil/sockaddr_snprintf.c
minix/drivers/sensors/bmp085/Makefile
minix/kernel/Makefile
minix/kernel/arch/earm/Makefile.inc
minix/kernel/arch/earm/phys_memset.S
minix/lib/libminc/Makefile
minix/lib/libminc/arch/earm/Makefile.libc.inc
minix/servers/is/dmp_pm.c
minix/servers/is/dmp_rs.c
releasetools/arm_sdimage.sh
share/mk/bsd.own.mk
sys/external/bsd/compiler_rt/dist/lib/int_lib.h
sys/external/bsd/compiler_rt/dist/lib/modsi3.c
sys/lib/libunwind/Makefile.inc
usr.bin/tic/tic.c

index 94ae1819bad73ca73b1ee54d924787c861f67f9c..d31411d51bb732f3a60306875ff102fe3cf4ebe3 100644 (file)
@@ -2,7 +2,7 @@
 
 COMMON_DIR:=${.PARSEDIR}
 .if defined(__MINIX)
-COMMON_CODEDIRS=atomic gen inet md net quad stdlib string 
+COMMON_CODEDIRS=atomic gen inet md net stdlib string
 .else
 COMMON_CODEDIRS=atomic gen gmon inet md net quad stdlib string sys
 .endif
diff --git a/common/lib/libc/arch/arm/gen/divide.S b/common/lib/libc/arch/arm/gen/divide.S
deleted file mode 100644 (file)
index c5b7a8a..0000000
+++ /dev/null
@@ -1,381 +0,0 @@
-/*     $NetBSD: divide.S,v 1.4 2013/08/19 03:47:06 matt Exp $  */
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#ifndef __ARM_ARCH_EXT_IDIV__
-
-#include <machine/asm.h>
-
-/* 
- * stack is aligned as there's a possibility of branching to .L_overflow
- * which makes a C call
- */
-
-_ARM_ENTRY(__udivide)                  /* r0 = r0 / r1; r1 = r0 % r1 */
-       eor     r0, r1, r0 
-       eor     r1, r0, r1 
-       eor     r0, r1, r0 
-                                       /* r0 = r1 / r0; r1 = r1 % r0 */
-       cmp     r0, #1
-       bcc     .L_overflow
-       beq     .L_divide_l0
-       mov     ip, #0
-       movs    r1, r1
-       bpl     .L_divide_l1
-       orr     ip, ip, #0x20000000     /* ip bit 0x20000000 = -ve r1 */
-       movs    r1, r1, lsr #1
-       orrcs   ip, ip, #0x10000000     /* ip bit 0x10000000 = bit 0 of r1 */
-       b       .L_divide_l1
-
-.L_divide_l0:                          /* r0 == 1 */
-       mov     r0, r1
-       mov     r1, #0
-       RET
-END(__udivide)
-
-_ARM_ENTRY(__divide)                   /* r0 = r0 / r1; r1 = r0 % r1 */
-       eor     r0, r1, r0 
-       eor     r1, r0, r1 
-       eor     r0, r1, r0 
-                                       /* r0 = r1 / r0; r1 = r1 % r0 */
-       cmp     r0, #1
-       bcc     .L_overflow
-       beq     .L_divide_l0
-       ands    ip, r0, #0x80000000
-       rsbmi   r0, r0, #0
-       ands    r2, r1, #0x80000000
-       eor     ip, ip, r2
-       rsbmi   r1, r1, #0
-       orr     ip, r2, ip, lsr #1      /* ip bit 0x40000000 = -ve division */
-                                       /* ip bit 0x80000000 = -ve remainder */
-
-.L_divide_l1:
-       mov     r2, #1
-       mov     r3, #0
-
-       /*
-        * If the highest bit of the dividend is set, we have to be
-        * careful when shifting the divisor. Test this. 
-        */
-       movs    r1,r1
-       bpl     .L_old_code
-
-       /*
-        * At this point, the highest bit of r1 is known to be set.
-        * We abuse this below in the tst instructions.
-        */
-       tst     r1, r0 /*, lsl #0 */
-       bmi     .L_divide_b1
-       tst     r1, r0, lsl #1
-       bmi     .L_divide_b2
-       tst     r1, r0, lsl #2
-       bmi     .L_divide_b3
-       tst     r1, r0, lsl #3
-       bmi     .L_divide_b4
-       tst     r1, r0, lsl #4
-       bmi     .L_divide_b5
-       tst     r1, r0, lsl #5
-       bmi     .L_divide_b6
-       tst     r1, r0, lsl #6
-       bmi     .L_divide_b7
-       tst     r1, r0, lsl #7
-       bmi     .L_divide_b8
-       tst     r1, r0, lsl #8
-       bmi     .L_divide_b9
-       tst     r1, r0, lsl #9
-       bmi     .L_divide_b10
-       tst     r1, r0, lsl #10
-       bmi     .L_divide_b11
-       tst     r1, r0, lsl #11
-       bmi     .L_divide_b12
-       tst     r1, r0, lsl #12
-       bmi     .L_divide_b13
-       tst     r1, r0, lsl #13
-       bmi     .L_divide_b14
-       tst     r1, r0, lsl #14
-       bmi     .L_divide_b15
-       tst     r1, r0, lsl #15
-       bmi     .L_divide_b16
-       tst     r1, r0, lsl #16
-       bmi     .L_divide_b17
-       tst     r1, r0, lsl #17
-       bmi     .L_divide_b18
-       tst     r1, r0, lsl #18
-       bmi     .L_divide_b19
-       tst     r1, r0, lsl #19
-       bmi     .L_divide_b20
-       tst     r1, r0, lsl #20
-       bmi     .L_divide_b21
-       tst     r1, r0, lsl #21
-       bmi     .L_divide_b22
-       tst     r1, r0, lsl #22
-       bmi     .L_divide_b23
-       tst     r1, r0, lsl #23
-       bmi     .L_divide_b24
-       tst     r1, r0, lsl #24
-       bmi     .L_divide_b25
-       tst     r1, r0, lsl #25
-       bmi     .L_divide_b26
-       tst     r1, r0, lsl #26
-       bmi     .L_divide_b27
-       tst     r1, r0, lsl #27
-       bmi     .L_divide_b28
-       tst     r1, r0, lsl #28
-       bmi     .L_divide_b29
-       tst     r1, r0, lsl #29
-       bmi     .L_divide_b30
-       tst     r1, r0, lsl #30
-       bmi     .L_divide_b31
-/*
- * instead of:
- *     tst     r1, r0, lsl #31
- *     bmi     .L_divide_b32
- */
-       b       .L_divide_b32
-
-.L_old_code:
-       cmp     r1, r0
-       bcc     .L_divide_b0
-       cmp     r1, r0, lsl #1
-       bcc     .L_divide_b1
-       cmp     r1, r0, lsl #2
-       bcc     .L_divide_b2
-       cmp     r1, r0, lsl #3
-       bcc     .L_divide_b3
-       cmp     r1, r0, lsl #4
-       bcc     .L_divide_b4
-       cmp     r1, r0, lsl #5
-       bcc     .L_divide_b5
-       cmp     r1, r0, lsl #6
-       bcc     .L_divide_b6
-       cmp     r1, r0, lsl #7
-       bcc     .L_divide_b7
-       cmp     r1, r0, lsl #8
-       bcc     .L_divide_b8
-       cmp     r1, r0, lsl #9
-       bcc     .L_divide_b9
-       cmp     r1, r0, lsl #10
-       bcc     .L_divide_b10
-       cmp     r1, r0, lsl #11
-       bcc     .L_divide_b11
-       cmp     r1, r0, lsl #12
-       bcc     .L_divide_b12
-       cmp     r1, r0, lsl #13
-       bcc     .L_divide_b13
-       cmp     r1, r0, lsl #14
-       bcc     .L_divide_b14
-       cmp     r1, r0, lsl #15
-       bcc     .L_divide_b15
-       cmp     r1, r0, lsl #16
-       bcc     .L_divide_b16
-       cmp     r1, r0, lsl #17
-       bcc     .L_divide_b17
-       cmp     r1, r0, lsl #18
-       bcc     .L_divide_b18
-       cmp     r1, r0, lsl #19
-       bcc     .L_divide_b19
-       cmp     r1, r0, lsl #20
-       bcc     .L_divide_b20
-       cmp     r1, r0, lsl #21
-       bcc     .L_divide_b21
-       cmp     r1, r0, lsl #22
-       bcc     .L_divide_b22
-       cmp     r1, r0, lsl #23
-       bcc     .L_divide_b23
-       cmp     r1, r0, lsl #24
-       bcc     .L_divide_b24
-       cmp     r1, r0, lsl #25
-       bcc     .L_divide_b25
-       cmp     r1, r0, lsl #26
-       bcc     .L_divide_b26
-       cmp     r1, r0, lsl #27
-       bcc     .L_divide_b27
-       cmp     r1, r0, lsl #28
-       bcc     .L_divide_b28
-       cmp     r1, r0, lsl #29
-       bcc     .L_divide_b29
-       cmp     r1, r0, lsl #30
-       bcc     .L_divide_b30
-.L_divide_b32:
-       cmp     r1, r0, lsl #31
-       subhs   r1, r1,r0, lsl #31
-       addhs   r3, r3,r2, lsl #31
-.L_divide_b31:
-       cmp     r1, r0, lsl #30
-       subhs   r1, r1,r0, lsl #30
-       addhs   r3, r3,r2, lsl #30
-.L_divide_b30:
-       cmp     r1, r0, lsl #29
-       subhs   r1, r1,r0, lsl #29
-       addhs   r3, r3,r2, lsl #29
-.L_divide_b29:
-       cmp     r1, r0, lsl #28
-       subhs   r1, r1,r0, lsl #28
-       addhs   r3, r3,r2, lsl #28
-.L_divide_b28:
-       cmp     r1, r0, lsl #27
-       subhs   r1, r1,r0, lsl #27
-       addhs   r3, r3,r2, lsl #27
-.L_divide_b27:
-       cmp     r1, r0, lsl #26
-       subhs   r1, r1,r0, lsl #26
-       addhs   r3, r3,r2, lsl #26
-.L_divide_b26:
-       cmp     r1, r0, lsl #25
-       subhs   r1, r1,r0, lsl #25
-       addhs   r3, r3,r2, lsl #25
-.L_divide_b25:
-       cmp     r1, r0, lsl #24
-       subhs   r1, r1,r0, lsl #24
-       addhs   r3, r3,r2, lsl #24
-.L_divide_b24:
-       cmp     r1, r0, lsl #23
-       subhs   r1, r1,r0, lsl #23
-       addhs   r3, r3,r2, lsl #23
-.L_divide_b23:
-       cmp     r1, r0, lsl #22
-       subhs   r1, r1,r0, lsl #22
-       addhs   r3, r3,r2, lsl #22
-.L_divide_b22:
-       cmp     r1, r0, lsl #21
-       subhs   r1, r1,r0, lsl #21
-       addhs   r3, r3,r2, lsl #21
-.L_divide_b21:
-       cmp     r1, r0, lsl #20
-       subhs   r1, r1,r0, lsl #20
-       addhs   r3, r3,r2, lsl #20
-.L_divide_b20:
-       cmp     r1, r0, lsl #19
-       subhs   r1, r1,r0, lsl #19
-       addhs   r3, r3,r2, lsl #19
-.L_divide_b19:
-       cmp     r1, r0, lsl #18
-       subhs   r1, r1,r0, lsl #18
-       addhs   r3, r3,r2, lsl #18
-.L_divide_b18:
-       cmp     r1, r0, lsl #17
-       subhs   r1, r1,r0, lsl #17
-       addhs   r3, r3,r2, lsl #17
-.L_divide_b17:
-       cmp     r1, r0, lsl #16
-       subhs   r1, r1,r0, lsl #16
-       addhs   r3, r3,r2, lsl #16
-.L_divide_b16:
-       cmp     r1, r0, lsl #15
-       subhs   r1, r1,r0, lsl #15
-       addhs   r3, r3,r2, lsl #15
-.L_divide_b15:
-       cmp     r1, r0, lsl #14
-       subhs   r1, r1,r0, lsl #14
-       addhs   r3, r3,r2, lsl #14
-.L_divide_b14:
-       cmp     r1, r0, lsl #13
-       subhs   r1, r1,r0, lsl #13
-       addhs   r3, r3,r2, lsl #13
-.L_divide_b13:
-       cmp     r1, r0, lsl #12
-       subhs   r1, r1,r0, lsl #12
-       addhs   r3, r3,r2, lsl #12
-.L_divide_b12:
-       cmp     r1, r0, lsl #11
-       subhs   r1, r1,r0, lsl #11
-       addhs   r3, r3,r2, lsl #11
-.L_divide_b11:
-       cmp     r1, r0, lsl #10
-       subhs   r1, r1,r0, lsl #10
-       addhs   r3, r3,r2, lsl #10
-.L_divide_b10:
-       cmp     r1, r0, lsl #9
-       subhs   r1, r1,r0, lsl #9
-       addhs   r3, r3,r2, lsl #9
-.L_divide_b9:
-       cmp     r1, r0, lsl #8
-       subhs   r1, r1,r0, lsl #8
-       addhs   r3, r3,r2, lsl #8
-.L_divide_b8:
-       cmp     r1, r0, lsl #7
-       subhs   r1, r1,r0, lsl #7
-       addhs   r3, r3,r2, lsl #7
-.L_divide_b7:
-       cmp     r1, r0, lsl #6
-       subhs   r1, r1,r0, lsl #6
-       addhs   r3, r3,r2, lsl #6
-.L_divide_b6:
-       cmp     r1, r0, lsl #5
-       subhs   r1, r1,r0, lsl #5
-       addhs   r3, r3,r2, lsl #5
-.L_divide_b5:
-       cmp     r1, r0, lsl #4
-       subhs   r1, r1,r0, lsl #4
-       addhs   r3, r3,r2, lsl #4
-.L_divide_b4:
-       cmp     r1, r0, lsl #3
-       subhs   r1, r1,r0, lsl #3
-       addhs   r3, r3,r2, lsl #3
-.L_divide_b3:
-       cmp     r1, r0, lsl #2
-       subhs   r1, r1,r0, lsl #2
-       addhs   r3, r3,r2, lsl #2
-.L_divide_b2:
-       cmp     r1, r0, lsl #1
-       subhs   r1, r1,r0, lsl #1
-       addhs   r3, r3,r2, lsl #1
-.L_divide_b1:
-       cmp     r1, r0
-       subhs   r1, r1, r0
-       addhs   r3, r3, r2
-.L_divide_b0:
-
-       tst     ip, #0x20000000
-       bne     .L_udivide_l1
-       mov     r0, r3
-       cmp     ip, #0
-       rsbmi   r1, r1, #0
-       movs    ip, ip, lsl #1
-       bicmi   r0, r0, #0x80000000     /* Fix incase we divided 0x80000000 */
-       rsbmi   r0, r0, #0
-       RET
-
-.L_udivide_l1:
-       tst     ip, #0x10000000
-       mov     r1, r1, lsl #1
-       orrne   r1, r1, #1
-       mov     r3, r3, lsl #1
-       cmp     r1, r0
-       subhs   r1, r1, r0
-       addhs   r3, r3, r2
-       mov     r0, r3
-       RET
-
-.L_overflow:
-#if !defined(_KERNEL) && !defined(_STANDALONE)
-#ifdef __ARM_EABI__
-       mov     r0, r1                          /* return quotient */
-       b       PLT_SYM(__aeabi_idiv0)
-#else
-       mov     r0, #8                  /* SIGFPE */
-       bl      PLT_SYM(_C_LABEL(raise))        /* raise it */
-       mov     r0, #0
-       RET
-#endif
-#else
-       /* XXX should cause a fatal error */
-       mvn     r0, #0
-       RET
-#endif
-
-END(__divide)
-
-#endif /* __ARM_ARCH_EXT_IDIV__ */
diff --git a/common/lib/libc/arch/arm/gen/divsi3.S b/common/lib/libc/arch/arm/gen/divsi3.S
deleted file mode 100644 (file)
index f9320eb..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-/*     $NetBSD: divsi3.S,v 1.13 2013/09/12 15:36:14 joerg Exp $        */
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-#if defined(__thumb__) && !defined(_ARM_ARCH_T2)
-ARM_ENTRY(__divsi3)
-#else
-ENTRY(__divsi3)
-#endif
-#if defined(__ARM_ARCH_EXT_IDIV__)
-# if defined(__ARM_EABI__)
-       mov     r3, r0          @ save for mls
-# endif
-       sdiv    r0, r0, r1
-# if defined(__ARM_EABI__)
-       mls     r1, r0, r1, r3  @ return modulus in r1
-# endif
-       RET
-#elif defined(__ARM_EABI__) && defined(_LIBC)
-       cmp     r1, #0          @ dividing by 0?
-       beq     .Ldiv0          @ call __aeabi_idiv0
-       ldr     r2, .Lhwdiv_present
-#ifdef __PIC__
-       add     r2, r2, pc      @ pc = &.LPIC0
-# endif
-       ldr     r2, [r2]
-.LPIC0:        cmp     r2, #0
-       beq     __divide
-       mov     r3, r0
-# if defined(__ARM_ARCH_EXT_IDIV__)
-       sdiv    r0, r0, r1
-       mls     r1, r0, r1, r3  @ return modulus in r1
-# elif defined(__thumb__) && defined(_ARM_ARCH_T2)
-       .inst.w 0xfb90f0f1
-       .inst.w 0xfb003111
-# else
-       .inst   0xe710f110
-       .inst   0xe0613190
-# endif
-       RET
-
-       .align  0
-.Lhwdiv_present:
-       .word   REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-
-       .align  0
-.Ldiv0:        push    {r0, lr}        /* save r0 */
-       cmp     r0, #0
-       mvnge   r0, #0x80000000 /* INT_MAX = 0x7fffffff */
-       movlt   r0, #0x80000000 /* INT_MIN = 0x80000000 */
-       bl      _C_LABEL(__aeabi_idiv0)
-       pop     {r1, pc}        /* restore r0 as r1 */
-#else /* !__ARM_EABI__ */
-       b       __divide
-#endif
-END(__divsi3)
-
-#if defined(__ARM_EABI__)
-STRONG_ALIAS(__aeabi_idivmod, __divsi3)
-STRONG_ALIAS(__aeabi_idiv, __divsi3)
-#if defined(PIC_SYMVER)
-       .symver __aeabi_idiv,__aeabi_idiv@@GCC_3.5
-       .symver __aeabi_idivmod,__aeabi_idivmod@@GCC_3.5
-#endif
-#endif
diff --git a/common/lib/libc/arch/arm/gen/modsi3.S b/common/lib/libc/arch/arm/gen/modsi3.S
deleted file mode 100644 (file)
index 5d8c610..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*     $NetBSD: modsi3.S,v 1.4 2013/08/15 21:40:11 matt Exp $  */
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-#ifndef __ARM_EABI__
-/* 
- * stack is aligned as there's a possibility of branching to .L_overflow
- * which makes a C call
- */
-
-ENTRY(__modsi3)
-#ifdef __ARM_ARCH_EXT_IDIV__
-       sdiv    r3, r0, r1
-       mls     r0, r3, r1, r0
-#else
-       str     lr, [sp, #-8]!  /* push lr */
-       bl      PIC_SYM(__divsi3, PLT)
-       mov     r0, r1
-       ldr     lr, [sp], #8    /* pop lr */
-#endif
-       RET
-END(__modsi3)
-
-#endif
diff --git a/common/lib/libc/arch/arm/gen/udivsi3.S b/common/lib/libc/arch/arm/gen/udivsi3.S
deleted file mode 100644 (file)
index 5e6a77a..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*     $NetBSD: udivsi3.S,v 1.9 2013/09/12 15:36:14 joerg Exp $        */
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-#if defined(__ARM_EABI__) && defined(__thumb__) && !defined(_ARM_ARCH_T2)
-ARM_ENTRY(__udivsi3)
-#else
-ENTRY(__udivsi3)
-#endif
-#if defined(__ARM_ARCH_EXT_IDIV__)
-# if defined(__ARM_EABI__)
-       mov     r3, r0          @ save for mls
-# endif
-       udiv    r0, r0, r1
-# if defined(__ARM_EABI__)
-       mls     r1, r0, r1, r3  @ return modulus in r1
-# endif
-       RET
-#elif defined(__ARM_EABI__) && defined(_LIBC)
-       cmp     r1, #0
-       beq     .Ldiv0
-       ldr     r2, .Lhwdiv_present
-#ifdef __PIC__
-       add     r2, r2, pc      /* pc = &.LPIC0 */
-# endif
-       ldr     r2, [r2]
-.LPIC0:        cmp     r2, #0
-       beq     __udivide
-       mov     r3, r0
-# if defined(__ARM_ARCH_EXT_IDIV__)
-       udiv    r0, r0, r1
-       mls     r1, r0, r1, r3  /* return modulus in r1 */
-# elif defined(__thumb__) && defined(_ARM_ARCH_T2)
-       .inst.w 0xfbb0f0f1
-       .inst.w 0xfb003111
-# else
-       .inst   0xe730f110
-       .inst   0xe0613190
-# endif
-       RET
-
-       .align 0
-.Lhwdiv_present:
-       .word   REL_SYM(_libc_arm_hwdiv_present, .LPIC0)
-
-       /* Handle divide by zero */
-       .align  0
-.Ldiv0:        push    {r0, lr}        /* save r0 */
-       mvns    r0, #0          /* thumb2 */
-       bl      _C_LABEL(__aeabi_idiv0)
-       pop     {r1, pc}        /* restore r0 as r1 */
-#else
-       b       __udivide
-#endif
-END(__udivsi3)
-
-#ifdef __ARM_EABI__
-STRONG_ALIAS(__aeabi_uidivmod, __udivsi3)
-STRONG_ALIAS(__aeabi_uidiv, __udivsi3)
-#endif
diff --git a/common/lib/libc/arch/arm/gen/umodsi3.S b/common/lib/libc/arch/arm/gen/umodsi3.S
deleted file mode 100644 (file)
index 35f5da2..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*     $NetBSD: umodsi3.S,v 1.4 2013/08/15 21:40:11 matt Exp $ */
-
-/*
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-
-#include <machine/asm.h>
-
-#ifndef __ARM_EABI__
-/* 
- * stack is aligned as there's a possibility of branching to .L_overflow
- * which makes a C call
- */
-
-ENTRY(__umodsi3)
-#ifdef __ARM_ARCH_EXT_IDIV__
-       udiv    r3, r0, r1
-       mls     r0, r3, r1, r0
-#else
-       str     lr, [sp, #-8]!  /* push lr */
-       bl      PIC_SYM(__udivsi3, PLT)
-       mov     r0, r1
-       ldr     lr, [sp], #8    /* pop lr */
-#endif
-       RET
-END(__umodsi3)
-#endif
index 500ddfef4af56547f4fbd9191397982bf9f614cd..5b1281bb73f5dc31bbb08971e9a4b6bae68a469b 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.S,v 1.6 2013/11/30 21:09:11 joerg Exp $ */
+/*     $NetBSD: memset.S,v 1.7 2013/12/02 21:21:33 joerg Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
 
 #include <machine/asm.h>
 
-#if defined(__ARM_EABI__) && !defined(BZER0)
-STRONG_ALIAS(__aeabi_memset, memset)
+#if defined(__ARM_EABI__) && !defined(_BZERO)
+ENTRY(__aeabi_memset)
+       mov     r3, r1
+       mov     r1, r2
+       mov     r2, r3
+       b       memset
+END(__aeabi_memset)
+STRONG_ALIAS(__aeabi_memset4, __aeabi_memset)
+STRONG_ALIAS(__aeabi_memset8, __aeabi_memset)
+
+ENTRY(__aeabi_memclr)
+       mov     r2, r1
+       mov     r1, #0
+       b       memset
+END(__aeabi_memclr)
+STRONG_ALIAS(__aeabi_memclr4, __aeabi_memclr)
+STRONG_ALIAS(__aeabi_memclr8, __aeabi_memclr)
 #endif
 
 /*
index b99548b03d94fd8e56b61c50ff4718a46ad40c82..78c2704c39a19c0378168c3df052b46b5d370edb 100644 (file)
 ./usr/include/i386                     minix-sys
 ./usr/lib/libclkconf.a                 minix-sys
 ./usr/lib/libclkconf_pic.a             minix-sys
-./usr/lib/libc_vfp.a                   minix-sys
-./usr/lib/libc_vfp_pic.a               minix-sys
-./usr/lib/libc_vfp.so.0.0              minix-sys
-./usr/lib/libc_vfp.so.0                        minix-sys
-./usr/lib/libc_vfp.so                  minix-sys
-./usr/lib/libgcc_eh.a                  minix-sys
+./usr/lib/libc_vfp.a                   minix-sys       obsolete
+./usr/lib/libc_vfp_pic.a               minix-sys       obsolete
+./usr/lib/libc_vfp.so.0.0              minix-sys       obsolete
+./usr/lib/libc_vfp.so.0                        minix-sys       obsolete
+./usr/lib/libc_vfp.so                  minix-sys       obsolete
+./usr/lib/libgcc_eh.a                  minix-sys       gcccmds
 ./usr/lib/libgpio.a                    minix-sys
 ./usr/lib/libgpio_pic.a                        minix-sys
 ./usr/lib/libi2cdriver.a               minix-sys
index bf2d36920ba809db81700420b3957bdadbd918c4..320c424f5046ea239634910c7abbdba22dcc31bb 100644 (file)
 ./usr/bin/bzip2                                minix-sys
 ./usr/bin/bzip2recover                 minix-sys
 ./usr/bin/c++                          minix-sys       gcccmds
-./usr/bin/c++                          minix-sys       llvm
+./usr/bin/c++                          minix-sys       llvm,llvmcmds
 ./usr/bin/cal                          minix-sys
 ./usr/bin/calendar                     minix-sys
 ./usr/bin/cawf                         minix-sys
 ./usr/bin/cc                           minix-sys       gcccmds
-./usr/bin/cc                           minix-sys       llvm
+./usr/bin/cc                           minix-sys       llvm,llvmcmds
 ./usr/bin/cc1                          minix-sys       gcccmds
 ./usr/bin/cc1obj                       minix-sys       gcccmds
 ./usr/bin/cc1plus                      minix-sys       gcccmds
 ./usr/bin/chsh                         minix-sys
 ./usr/bin/ci                           minix-sys
 ./usr/bin/cksum                                minix-sys
-./usr/bin/clang++                      minix-sys       llvm
-./usr/bin/clang                                minix-sys       llvm
-./usr/bin/clang-cpp                    minix-sys       llvm
-./usr/bin/clang-tblgen                 minix-sys       llvm
+./usr/bin/clang++                      minix-sys       llvm,llvmcmds
+./usr/bin/clang                                minix-sys       llvm,llvmcmds
+./usr/bin/clang-cpp                    minix-sys       llvm,llvmcmds
+./usr/bin/clang-tblgen                 minix-sys       llvm,llvmcmds
 ./usr/bin/cleantmp                     minix-sys
 ./usr/bin/clear                                minix-sys
 ./usr/bin/cmp                          minix-sys
 ./usr/bin/compress                     minix-sys
 ./usr/bin/cpio                         minix-sys
 ./usr/bin/cpp                          minix-sys       gcccmds
-./usr/bin/cpp                          minix-sys       llvm
+./usr/bin/cpp                          minix-sys       llvm,llvmcmds
 ./usr/bin/cprofalyze                   minix-sys       obsolete
 ./usr/bin/crc                          minix-sys
 ./usr/bin/cron                         minix-sys
 ./usr/bin/lessecho                     minix-sys
 ./usr/bin/lesskey                      minix-sys
 ./usr/bin/lex                          minix-sys
-./usr/bin/llvm-tblgen                  minix-sys       llvm
+./usr/bin/llvm-tblgen                  minix-sys       llvm,llvmcmds
 ./usr/bin/loadfont                     minix-sys
 ./usr/bin/loadramdisk                  minix-sys
 ./usr/bin/lock                         minix-sys
 ./usr/include/cdbr.h                   minix-sys
 ./usr/include/cdbw.h                   minix-sys
 ./usr/include/clang-3.4                        minix-sys
-./usr/include/clang-3.4/ammintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/avx2intrin.h   minix-sys       llvm
-./usr/include/clang-3.4/avxintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/bmi2intrin.h   minix-sys       llvm
-./usr/include/clang-3.4/bmiintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/emmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/f16cintrin.h   minix-sys       llvm
-./usr/include/clang-3.4/fma4intrin.h   minix-sys       llvm
-./usr/include/clang-3.4/fmaintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/immintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/lzcntintrin.h  minix-sys       llvm
-./usr/include/clang-3.4/mm3dnow.h      minix-sys       llvm
-./usr/include/clang-3.4/mmintrin.h     minix-sys       llvm
-./usr/include/clang-3.4/mm_malloc.h    minix-sys       llvm
-./usr/include/clang-3.4/nmmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/pmmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/popcntintrin.h minix-sys       llvm
-./usr/include/clang-3.4/prfchwintrin.h minix-sys       llvm
-./usr/include/clang-3.4/rdseedintrin.h minix-sys       llvm
-./usr/include/clang-3.4/rtmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/shaintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/smmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/tbmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/tmmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/__wmmintrin_aes.h      minix-sys       llvm
-./usr/include/clang-3.4/wmmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/__wmmintrin_pclmul.h   minix-sys       llvm
-./usr/include/clang-3.4/x86intrin.h    minix-sys       llvm
-./usr/include/clang-3.4/xmmintrin.h    minix-sys       llvm
-./usr/include/clang-3.4/xopintrin.h    minix-sys       llvm
+./usr/include/clang-3.4/ammintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/avx2intrin.h   minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/avxintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/bmi2intrin.h   minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/bmiintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/emmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/f16cintrin.h   minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/fma4intrin.h   minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/fmaintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/immintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/lzcntintrin.h  minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/mm3dnow.h      minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/mmintrin.h     minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/mm_malloc.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/nmmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/pmmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/popcntintrin.h minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/prfchwintrin.h minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/rdseedintrin.h minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/rtmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/shaintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/smmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/tbmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/tmmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/__wmmintrin_aes.h      minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/wmmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/__wmmintrin_pclmul.h   minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/x86intrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/xmmintrin.h    minix-sys       llvm,llvmcmds
+./usr/include/clang-3.4/xopintrin.h    minix-sys       llvm,llvmcmds
 ./usr/include/compat                   minix-sys
 ./usr/include/compat/machine           minix-sys
 ./usr/include/complex.h                        minix-sys
 ./usr/include/ulimit.h                 minix-sys
 ./usr/include/unctrl.h                 minix-sys
 ./usr/include/unistd.h                 minix-sys
-./usr/include/unwind.h                 minix-sys       llvm
+./usr/include/unwind.h                 minix-sys       llvm,llvmcmds
 ./usr/include/util.h                   minix-sys
 ./usr/include/utime.h                  minix-sys
 ./usr/include/utmp.h                   minix-sys
 ./usr/lib/bc/libc.a                    minix-sys       bitcode
 ./usr/lib/bc/libc++.a                  minix-sys       bitcode
 ./usr/lib/bc/libchardriver.a           minix-sys       bitcode
-./usr/lib/bc/libcompat_minix.a         minix-sys       bitcode obsolete
+./usr/lib/bc/libcompat_minix.a         minix-sys       bitcode,obsolete
 ./usr/lib/bc/libcrypt.a                        minix-sys       bitcode
 ./usr/lib/bc/libcurses.a               minix-sys       bitcode
 ./usr/lib/bc/libddekit.a               minix-sys       bitcode
 ./usr/lib/bc/libddekit_usb_server.a    minix-sys       bitcode
 ./usr/lib/bc/libdevman.a               minix-sys       bitcode
 ./usr/lib/bc/libedit.a                 minix-sys       bitcode
+./usr/lib/bc/libevent.a                        minix-sys       bitcode
+./usr/lib/bc/libexpat.a                        minix-sys       bitcode
+./usr/lib/bc/libfsdriver.a             minix-sys       bitcode
+./usr/lib/bc/libpci.a                  minix-sys       bitcode
 ./usr/lib/bc/libelf.a                  minix-sys       bitcode
 ./usr/lib/bc/libexec.a                 minix-sys       bitcode
 ./usr/lib/bc/libexecinfo.a             minix-sys       bitcode
 ./usr/lib/bc/libmenu.a                 minix-sys       bitcode
 ./usr/lib/bc/libminc.a                 minix-sys       bitcode
 ./usr/lib/bc/libminixfs.a              minix-sys       bitcode
-./usr/lib/bc/libminlib.a               minix-sys       bitcode obsolete
+./usr/lib/bc/libminlib.a               minix-sys       bitcode,obsolete
 ./usr/lib/bc/libmthread.a              minix-sys       bitcode
 ./usr/lib/bc/libnetdriver.a            minix-sys       bitcode
 ./usr/lib/bc/libnetsock.a              minix-sys       bitcode
 ./usr/share/doc/usd/03.shell/t3                minix-sys
 ./usr/share/doc/usd/03.shell/t4                minix-sys
 ./usr/share/doc/usd/03.shell/t.mac     minix-sys
-./usr/share/examples                   minix-sys       atf
+./usr/share/examples                   minix-sys
 ./usr/share/examples/atf               minix-sys       atf
 ./usr/share/examples/atf/atf-run.hooks minix-sys       atf,!kyua
 ./usr/share/examples/atf/tests-results.css     minix-sys       atf,!kyua
index 1b4650723f3afcb6d081556832d1b9fdb8d8818f..40200a9643d3a70ece6cee5d1269a6ff33d20df2 100644 (file)
@@ -29,7 +29,9 @@ SUBDIR+= openldap
 SUBDIR+= libc++
 .endif
 .if (${MKLLVM} != "no")
+.if (${MKLLVMCMDS} != "no")
 SUBDIR+= llvm
+.endif # (${MKLLVMCMDS} != "no")
 .endif
 .if (${MKPCC} != "no")
 SUBDIR+= pcc
index faa06b68e03c347eac5b95bf1c685914df9477c1..e054dc5c8d1b039e726fa8fbc633b1c991a35bfb 100644 (file)
@@ -280,8 +280,14 @@ std::string ToolChain::ComputeLLVMTriple(const ArgList &Args,
     // Thumb2 is the default for V7 on Darwin.
     //
     // FIXME: Thumb should just be another -target-feaure, not in the triple.
+#if 1
+    // Minix/ARM-specific force to ARMv7 and EABI.
+    StringRef Suffix = "v7";
+    Triple.setEnvironment(llvm::Triple::EABI);
+#else
     StringRef Suffix =
       getLLVMArchSuffixForARM(getARMTargetCPU(Args, Triple));
+#endif
     bool ThumbDefault = Suffix.startswith("v6m") ||
       (Suffix.startswith("v7") && getTriple().isOSDarwin());
     std::string ArchName = "arm";
index 237e08a04d979be8327a4157f118b375490813bf..eed65737d4b3a8965dbf60d5f2ecfe3984031ee5 100644 (file)
@@ -30,7 +30,7 @@ static const char sccsid[] = "Id: put.c,v 10.18 2001/06/25 15:19:11 skimo Exp  (
  * put --
  *     Put text buffer contents into the file.
  *
- * PUBLIC: int put __P((SCR *, CB *, CHAR_T *, MARK *, MARK *, int));
+ * PUBLIC: int put __P((SCR *, CB *, ARG_CHAR_T *, MARK *, MARK *, int));
  */
 int
 put(SCR *sp, CB *cbp, ARG_CHAR_T *namep, MARK *cp, MARK *rp, int append)
index 4c902cbf7dcaffe09a2eeb0d7c8dfc500abc65de..65d8603ca89dc74453d9aefeb616cb5fa3cac0f0 100644 (file)
@@ -2,6 +2,11 @@
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+#/usr/minix/src-clang/external/bsd/nvi/dist/ex/ex.c:533:18: error: comparison of integers of different signs: 'CHAR_T' (aka 'unsigned int') and 'ARG_CHAR_T' (aka 'int') [-Werror,-Wsign-compare]
+NOCLANGERROR=yes
+.endif
+
 USE_WIDECHAR?=yes
 
 CWARNFLAGS.clang+=     -Wno-uninitialized -Wno-format-security
index aa3dce34e0115f57dc33ae64a3fc5f6d00e99425..936b1404ee733710aa70d58e34ee3766ff08d3cd 100644 (file)
@@ -98,9 +98,11 @@ SUBDIR+=     \
 .if (${MACHINE_CPU} == "arm")
 LIBC_MACHINE_ARCH?=${MACHINE_ARCH}
 .if empty(LIBC_MACHINE_ARCH:M*hf*)
+.if !defined(__MINIX)
 SUBDIR+=       libc_vfp
 .endif
 .endif
+.endif
 .if (${MKRUMP} != "no")
 SUBDIR+=       librumpclient
 .endif
index 32775fb03afa1bbaff4bcaa3e2287f8ac20edc8d..a587a259ce85bd393c906ddb04003657e72df7ff 100644 (file)
@@ -68,7 +68,7 @@ SUBDIR+= pkgconfig
 .include "${.CURDIR}/db/Makefile.inc"
 .include "${.CURDIR}/citrus/Makefile.inc"
 .include "${.CURDIR}/compat-43/Makefile.inc"
-.if ${HAVE_LIBGCC} == "no"
+.if ${HAVE_LIBGCC} == "no" || defined(__MINIX)
 .include "${.CURDIR}/compiler_rt/Makefile.inc"
 .endif
 .include "${.CURDIR}/dlfcn/Makefile.inc"
@@ -89,7 +89,7 @@ SUBDIR+= pkgconfig
 .include "${.CURDIR}/net/Makefile.inc"
 .include "${.CURDIR}/nameser/Makefile.inc"
 .include "${.CURDIR}/nls/Makefile.inc"
-.if (${MACHINE_ARCH} != "alpha") && (${ARCHSUBDIR} != "sparc64")
+.if (${MACHINE_ARCH} != "alpha") && (${ARCHSUBDIR} != "sparc64") && !defined(__MINIX)
 .include "${.CURDIR}/quad/Makefile.inc"
 .endif
 .if (${USE_LIBTRE} == "yes")
@@ -116,9 +116,10 @@ SUBDIR+= pkgconfig
 .include "${.CURDIR}/tls/Makefile.inc"
 .endif
 .include "${.CURDIR}/sys/Makefile.inc"
-.if ${HAVE_LIBGCC} == "no"
+.if ${HAVE_LIBGCC} == "no" && ${MACHINE_ARCH} != "earm" && defined(__MINIX)
+# Currently unavailable on minix/arm - BJG
 .include "${NETBSDSRCDIR}/sys/lib/libunwind/Makefile.inc"
-.endif
+.endif # ${HAVE_LIBGCC} == "no" && ${MACHINE_ARCH} != "earm" && defined(__MINIX)
 .include "${.CURDIR}/uuid/Makefile.inc"
 .if (${MKYP} != "no")
 .include "${.CURDIR}/yp/Makefile.inc"
index bef93afc453b68749b8f6368ffba1b33fdcdb3d9..a9e3fbc7c33d4e26d75697283930822cd7078338 100644 (file)
@@ -13,10 +13,6 @@ AFLAGS+= -marm
 CPPFLAGS += -I.
 
 .if !empty(LIBC_MACHINE_ARCH:Mearm*)
-SRCS+= __aeabi_ldivmod.S __aeabi_uldivmod.S
-SRCS+= __aeabi_lcmp.c __aeabi_ulcmp.c
-SRCS+= fixunsgen_ieee754.c fixunssfsi_ieee754.c
-SRCS+= fixunsgen64_ieee754.c fixunsdfsi_ieee754.c
 SRCS+= arm_initfini.c
 .endif
 
@@ -26,7 +22,7 @@ CPPFLAGS += -DSOFTFLOAT
 # for earm, use the 64-bit softfloat
 .if ${LIBC_MACHINE_ARCH} == "arm" || ${LIBC_MACHINE_ARCH} == "armeb"
 SOFTFLOAT_BITS=32
-#SRCS+=        floatunsidf_ieee754.c floatunsisf_ieee754.c
+SRCS+= floatunsidf_ieee754.c floatunsisf_ieee754.c
 .endif
 
 .include <softfloat/Makefile.inc>
index ea8985c1c3cb58e7862d4307a26a82d725f95e6b..2137811721568f4d18527180e435b8af629f1030 100644 (file)
@@ -1,7 +1,7 @@
 # $NetBSD: Makefile.inc,v 1.25 2013/08/21 03:09:39 matt Exp $
 
-SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c divide.S divsi3.S \
-       fabs.c flt_rounds.c udivsi3.S
+SRCS+= alloca.S byte_swap_2.S byte_swap_4.S bswap64.c \
+       fabs.c flt_rounds.c 
 
 CPUFLAGS.divide.S+=            -marm
 
@@ -16,8 +16,6 @@ SRCS+=        signbitf_ieee754.c signbitd_ieee754.c
 .if !empty(LIBC_MACHINE_ARCH:Mearm*)
 SRCS+= __aeabi_fcmpun.c __aeabi_dcmpun.c
 SRCS+= __aeabi_idiv0.c __aeabi_ldiv0.c
-.else
-SRCS+= modsi3.S umodsi3.S
 .endif
 
 SRCS+= nanf.c
index b7183e40f4ba74f2c2738d5e42a1283249899e61..2f19eeb0d9fe31c1ce0152d1ae5f4f28a65f4ecb 100644 (file)
@@ -10,11 +10,16 @@ COMPILER_RT_CPU_DIR=        ${COMPILER_RT_SRCDIR}/lib/${MACHINE_CPU}
 COMPILER_RT_ARCH_DIR=  ${COMPILER_RT_SRCDIR}/lib/${MACHINE_ARCH}
 .endif
 
+.if defined(__MINIX)
+LIBC_MACHINE_CPU?=      ${MACHINE_CPU}
+.endif # defined(__MINIX) 
 
-.if !defined(__MINIX)
+.if !empty(LIBC_MACHINE_ARCH:Mearm*) && defined(__MINIX)
+# BJG - we skip these for minix/x86 as the .S versions give problems
+# for dynamic binaries.
 .PATH: ${COMPILER_RT_CPU_DIR}
 .PATH: ${COMPILER_RT_ARCH_DIR}
-.endif # !defined(__MINIX)
+.endif # .if !empty(LIBC_MACHINE_ARCH:Mearm*) && defined(__MINIX)
 .PATH: ${COMPILER_RT_SRCDIR}/lib
 
 # Complex support needs parts of libm
@@ -25,127 +30,190 @@ COMPILER_RT_ARCH_DIR=     ${COMPILER_RT_SRCDIR}/lib/${MACHINE_ARCH}
 #      divdc3.c \
 #      divsc3.c
 
+# Implemented on top of our atomic interface.
+#GENERIC_SRCS+= atomic.c
+
+.if ${HAVE_LIBGCC_EH:Uyes} == "no"
 GENERIC_SRCS+= \
-       absvdi2.c \
-       absvsi2.c \
-       absvti2.c \
+       gcc_personality_v0.c
+.endif
+
+.if 0
+# Conflicts with soft-float
+GENERIC_SRCS+= \
+       comparedf2.c \
+       comparesf2.c \
        adddf3.c \
        addsf3.c \
-       addvdi3.c \
+       addtf3.c \
+       divdf3.c \
+       divsf3.c \
+       divtf3.c \
+       extendsfdf2.c \
+       extendsftf2.c \
+       extenddftf2.c \
+       fixdfsi.c \
+       fixdfti.c \
+       fixsfsi.c \
+       fixsfti.c \
+       floatsidf.c \
+       floatsisf.c \
+       floatunsidf.c \
+       floatunsisf.c \
+       muldf3.c \
+       mulsf3.c \
+       multf3.c \
+       subdf3.c \
+       subsf3.c \
+       subtf3.c \
+       truncdfsf2.c \
+       trunctfdf2.c \
+       trunctfsf2.c
+.endif
+
+GENERIC_SRCS+= \
+       absvsi2.c \
+       absvti2.c \
        addvsi3.c \
        addvti3.c \
-       ashldi3.c \
        ashlti3.c \
-       ashrdi3.c \
        ashrti3.c \
-       atomic.c \
-       clzdi2.c \
-       clzsi2.c \
        clzti2.c \
-       cmpdi2.c \
        cmpti2.c \
-       comparedf2.c \
-       comparesf2.c \
-       ctzdi2.c \
-       ctzsi2.c \
        ctzti2.c \
-       divdf3.c \
-       divdi3.c \
-       divmoddi4.c \
-       divmodsi4.c \
-       divsf3.c \
-       divsi3.c \
        divti3.c \
-       extendsfdf2.c \
-       ffsdi2.c \
        ffsti2.c \
-       fixdfdi.c \
-       fixdfsi.c \
-       fixdfti.c \
        fixsfdi.c \
-       fixsfsi.c \
-       fixsfti.c \
+       fixdfdi.c \
        fixunsdfdi.c \
        fixunsdfsi.c \
-       fixunsdfti.c \
        fixunssfdi.c \
        fixunssfsi.c \
-       fixunssfti.c \
        fixunsxfdi.c \
        fixunsxfsi.c \
-       fixunsxfti.c \
        fixxfdi.c \
-       fixxfti.c \
        floatdidf.c \
        floatdisf.c \
        floatdixf.c \
-       floatsidf.c \
-       floatsisf.c \
-       floattidf.c \
-       floattisf.c \
-       floattixf.c \
        floatundidf.c \
        floatundisf.c \
        floatundixf.c \
-       floatunsidf.c \
-       floatunsisf.c \
-       floatuntidf.c \
-       floatuntisf.c \
-       floatuntixf.c \
-       gcc_personality_v0.c \
        int_util.c \
-       lshrdi3.c \
        lshrti3.c \
-       moddi3.c \
-       modsi3.c \
        modti3.c \
        muldc3.c \
-       muldf3.c \
-       muldi3.c \
-       mulodi4.c \
        mulosi4.c \
        muloti4.c \
-       mulsf3.c \
        multi3.c \
-       mulvdi3.c \
        mulvsi3.c \
        mulvti3.c \
        negdf2.c \
-       negdi2.c \
        negsf2.c \
        negti2.c \
-       negvdi2.c \
        negvsi2.c \
        negvti2.c \
-       paritydi2.c \
        paritysi2.c \
        parityti2.c \
-       popcountdi2.c \
        popcountsi2.c \
        popcountti2.c \
        powidf2.c \
        powisf2.c \
        powitf2.c \
        powixf2.c \
-       subdf3.c \
-       subsf3.c \
-       subvdi3.c \
        subvsi3.c \
        subvti3.c \
-       truncdfsf2.c \
-       ucmpdi2.c \
        ucmpti2.c \
-       udivdi3.c \
-       udivmoddi4.c \
-       udivmodsi4.c \
        udivmodti4.c \
-       udivsi3.c \
        udivti3.c \
-       umoddi3.c \
-       umodsi3.c \
        umodti3.c
 
-.if ${MACHINE_ARCH} == "powerpc"
+.if ${MACHINE_ARCH} != "aarch64"
+GENERIC_SRCS+= \
+       fixunsdfti.c \
+       fixunssfti.c \
+       fixunsxfti.c \
+       fixxfti.c \
+       floattidf.c \
+       floattisf.c \
+       floattixf.c \
+       floatuntidf.c \
+       floatuntisf.c \
+       floatuntixf.c
+.endif
+
+# These have h/w instructions which are always used.
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "aarch64" \
+    && ${LIBC_MACHINE_CPU} != "powerpc" && ${LIBC_MACHINE_CPU} != "or1k"
+GENERIC_SRCS+= \
+       clzsi2.c
+.endif
+
+# These have h/w instructions which are always used.
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_ARCH} != "vax" \
+    && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_CPU} != "powerpc" \
+    && ${LIBC_MACHINE_CPU} != "or1k"
+GENERIC_SRCS+= \
+       ctzsi2.c
+.endif
+
+# These have h/w instructions which are always used.
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc" \
+    && ${LIBC_MACHINE_CPU} != "aarch64" && ${LIBC_MACHINE_ARCH} != "vax"
+GENERIC_SRCS+= \
+       divmodsi4.c \
+       divsi3.c \
+       modsi3.c \
+       udivmodsi4.c \
+       umodsi3.c
+
+. if ${LIBC_MACHINE_CPU} != "sh3"
+# On sh3 __udivsi3 is gcc "millicode" with special calling convention
+# (less registers clobbered than usual).  Each DSO that needs it gets
+# its own hidden copy from libgcc.a.
+GENERIC_SRCS+= \
+       udivsi3.c
+. endif
+.endif
+
+
+GENERIC_SRCS+= \
+       absvdi2.c \
+       addvdi3.c \
+       mulodi4.c \
+       mulvdi3.c \
+       negvdi2.c \
+       paritydi2.c \
+       popcountdi2.c \
+       subvdi3.c
+
+# These have h/w instructions which are always used.
+.if ${LIBC_MACHINE_ARCH} != "alpha" && ${LIBC_MACHINE_CPU} != "powerpc64" \
+    && ${LIBC_MACHINE_ARCH} != "aarch64" && ${LIBC_MACHINE_CPU} != "or1k"
+GENERIC_SRCS+= \
+       clzdi2.c \
+       ctzdi2.c \
+       ffsdi2.c
+.endif
+
+# Don't need these on 64-bit machines.
+.if empty(LIBC_MACHINE_ARCH:M*64*) && ${LIBC_MACHINE_ARCH} != "alpha"
+GENERIC_SRCS+= \
+       cmpdi2.c \
+       ashldi3.c \
+       ashrdi3.c \
+       divdi3.c \
+       divmoddi4.c \
+       lshrdi3.c \
+       moddi3.c \
+       muldi3.c \
+       negdi2.c \
+       ucmpdi2.c \
+       udivdi3.c \
+       udivmoddi4.c \
+       umoddi3.c
+.endif
+
+.if ${LIBC_MACHINE_ARCH} == "powerpc" || ${LIBC_MACHINE_ARCH} == "powerpc64"
 GENERIC_SRCS+= \
        fixtfdi.c \
        fixunstfdi.c \
@@ -157,6 +225,30 @@ GENERIC_SRCS+= \
        gcc_qsub.c
 .endif
 
+.if ${LIBC_MACHINE_CPU} == "aarch64"
+GENERIC_SRCS+= \
+       clear_cache.c
+.endif
+
+.if ${LIBC_MACHINE_CPU} == "arm"
+.if !empty(LIBC_MACHINE_ARCH:Mearm*)
+GENERIC_SRCS+= \
+       aeabi_idivmod.S \
+       aeabi_ldivmod.S \
+       aeabi_uidivmod.S \
+       aeabi_uldivmod.S
+.endif
+GENERIC_SRCS+= \
+       clear_cache.c
+# Not yet, overlaps with softfloat
+#      aeabi_dcmp.S \
+#      aeabi_fcmp.S
+# Not yet, requires ARMv6
+#GENERIC_SRCS+= \
+#      bswapdi2.S \
+#      bswapsi2.S
+.endif
+
 .if !defined(__MINIX)
 .for src in ${GENERIC_SRCS}
 .  if exists(${COMPILER_RT_CPU_DIR}/${src:R}.S) || \
@@ -164,14 +256,26 @@ GENERIC_SRCS+= \
 SRCS+= ${src:R}.S
 .  else
 SRCS+= ${src}
-COPTS.${src}+= -Wno-error=missing-prototypes
+.    if ${src:E} != "cc"
+COPTS.${src}+= -Wno-missing-prototypes \
+               -Wno-old-style-definition \
+               -Wno-strict-prototypes \
+               -Wno-uninitialized \
+               -Wno-cast-qual
+.    endif
 .  endif
 .endfor
 .else
 # For MINIX: do not pull in the assembly symbols, as they are not PIC ready
 .for src in ${GENERIC_SRCS}
 SRCS+= ${src}
-COPTS.${src}+= -Wno-error=missing-prototypes
+.    if ${src:E} != "cc"
+COPTS.${src}+= -Wno-missing-prototypes \
+               -Wno-old-style-definition \
+               -Wno-strict-prototypes \
+               -Wno-uninitialized \
+               -Wno-cast-qual
+.    endif
 .endfor
 
 .for src in muldc3.c
index 8543d273180ea637c9079f7a8724af92a3e370ee..89001056125eeb8fcd28d13d82c556c1ce567324 100644 (file)
@@ -191,7 +191,9 @@ dl_iterate_phdr(int (*callback)(struct dl_phdr_info *, size_t, void *),
                 * and smaller and such stores are atomic.
                 */
                dl_iterate_phdr_setup();
+#ifndef __minix
                membar_producer();
+#endif
                setup_done = true;
        }
 
index c229adc763cef34f3b83cef370566f51f3cb496d..59f050973d54ce30af17681e6f73c5234f83e9dc 100644 (file)
@@ -3,7 +3,12 @@
 
 .include <bsd.own.mk>
 
+.if defined(__MINIX)
+# /usr/minix/src-clang/lib/libcurses/get_wch.c:646:15: error: comparison of unsigned expression < 0 is always false [-Werror,-Wtautological-compare]
+WARNS=0
+.else
 WARNS= 2
+.endif
 
 CPPFLAGS+=-I${.CURDIR} -I${NETBSDSRCDIR}/lib/libterminfo
 .if defined(DEBUG_CURSES)
index 82edaaaeacbada19f6f42cf811e165822fe654b0..e9c32bc760653a00ee091ec063e82f9bf3a4e246 100644 (file)
@@ -340,11 +340,8 @@ MLINKS+=fdim.3 fdimf.3
 COPTS.compat_cabs.c+=  ${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
 COPTS.compat_cabsf.c+= ${${ACTIVE_CC} == "clang":? -Wno-incompatible-library-redeclaration :}
 
-.include "${.CURDIR}/gen/Makefile.inc"
-
-.if ${HAVE_LIBGCC} == "no"
 .include "${.CURDIR}/compiler_rt/Makefile.inc"
-.endif
+.include "${.CURDIR}/gen/Makefile.inc"
 
 .include <bsd.lib.mk>
 .include <bsd.subdir.mk>
index b87178739d524923dafea56cf511d4f87ff29fdb..9addd02b0277988d5e5f673096ae4513b82fb175 100644 (file)
@@ -9,6 +9,13 @@ LIB=           rmt
 SRCS=          rmtlib.c
 MAN=           rmtops.3
 
+.if defined(__MINIX)
+# rmtlib.c:451:50: error: format specifies type 'size_t' (aka 'unsigned long') \
+# but the argument has type 'size_t' (aka 'unsigned int') [-Werror,-Wformat]
+WARNS=0
+CFLAGS+=-Wno-format
+.endif
+
 .if !defined(__MINIX)
 CPPFLAGS+=     -D_REENTRANT
 .endif # !defined(__MINIX)
index cadeab398467b47a09d520658627f31fc2674c39..6a0c0ba7c531bd605aea0524f0b7ceea7d6aac54 100644 (file)
@@ -453,7 +453,7 @@ _rmt_write(int fildes, const void *buf, size_t nbyte)
                return -1;
 
        pstat = signal(SIGPIPE, SIG_IGN);
-       if ((size_t)write(WRITE(fildes), buf, nbyte) == nbyte) {
+       if ((size_t)write(WRITE(fildes), buf, nbyte) == (size_t) nbyte) {
                signal(SIGPIPE, pstat);
                return status(fildes);
        }
index ed21020c8fde654ccd0154a4a5408815351e22fc..d4a6ce7c29412369f9a39c5f18364e090a32d214 100644 (file)
@@ -226,7 +226,7 @@ sockaddr_snprintf(char * const sbuf, const size_t len, const char * const fmt,
 #if !defined(__minix)
                        (void)snprintf(nbuf, sizeof(nbuf), "%d", sa->sa_len);
 #else
-                       (void)snprintf(nbuf, sizeof(nbuf), "%d", len);
+                       (void)snprintf(nbuf, sizeof(nbuf), "%zu", len);
 #endif /* !defined(__minix) */
                        ADDS(nbuf);
                        break;
index 1b2ceacc462580649c6f871e4b13e24393449483..5e8ec32b8e4ee2d255547aa2db3e10ccbfe4b518 100644 (file)
@@ -7,4 +7,6 @@ LDADD+= -li2cdriver -lchardriver -lsys -ltimers
 
 CPPFLAGS+=     -I${NETBSDSRCDIR}
 
+NOCLANGERROR=yes
+
 .include <minix.service.mk>
index eee010077cf5731081780e349084325c47d03d95..0f1de8d655dd82687b453e1245145a4310f8493f 100644 (file)
@@ -5,6 +5,11 @@ PROG=          kernel
 BINDIR=                /usr/sbin
 MAN=
 
+.if ${MACHINE_ARCH} == "earm" && ${MKLLVM:Uno} == "yes"
+# BJG - problems with optimisation of the kernel by llvm 
+DBG=-O0
+.endif
+
 .include "arch/${MACHINE_ARCH}/Makefile.inc"
 
 SRCS+= clock.c cpulocals.c interrupt.c main.c proc.c system.c \
index 6f0baa6b195137bb9dde3c8b2cb64ba35294bf7b..18456d943e99cf44850ab1638c41f1af6b50ba5b 100644 (file)
@@ -17,9 +17,10 @@ stacktrace.o:        ${NETBSDSRCDIR}/minix/lib/libsys/stacktrace.c
 MINC_OBJS_UNPAGED= atoi.o \
        printf.o subr_prf.o \
        strcmp.o strcpy.o strlen.o strncmp.o \
-       memcpy.o memmove.o memset.o \
-       udivdi3.o umoddi3.o qdivrem.o
-MINC_OBJS_UNPAGED+= __aeabi_ldiv0.o __aeabi_idiv0.o __aeabi_uldivmod.o divide.o divsi3.o udivsi3.o umodsi3.o
+       memcpy.o memmove.o memset.o 
+MINC_OBJS_UNPAGED+= divsi3.o udivsi3.o umodsi3.o \
+       umoddi3.o udivmoddi4.o aeabi_uidivmod.o \
+       udivmodsi4.o aeabi_uldivmod.o
 atoi.o:                ${NETBSDSRCDIR}/minix/lib/libminc/atoi.c
 printf.o:      ${NETBSDSRCDIR}/sys/lib/libsa/printf.c
 subr_prf.o:    ${NETBSDSRCDIR}/sys/lib/libsa/subr_prf.c
@@ -30,26 +31,18 @@ strlen.o:   ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strlen.S
 strcpy.o:      ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strcpy.S
 strcmp.o:      ${NETBSDSRCDIR}/common/lib/libc/arch/arm/string/strcmp.S
 
-#strcat.o:     ${NETBSDSRCDIR}/common/lib/libc/string/strcat.c
-__aeabi_idiv0.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/__aeabi_idiv0.c
-__aeabi_ldiv0.o:       ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/__aeabi_ldiv0.c
-__aeabi_uldivmod.o:    ${NETBSDSRCDIR}/common/lib/libc/arch/arm/quad/__aeabi_uldivmod.S
-divide.o:      ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/divide.S
-divsi3.o:      ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/divsi3.S
-udivsi3.o:     ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/udivsi3.S
-umodsi3.o:     ${NETBSDSRCDIR}/common/lib/libc/arch/arm/gen/umodsi3.S
+divsi3.o:      ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/divsi3.c
+udivsi3.o:     ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/udivsi3.c
+umodsi3.o:     ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/umodsi3.c
+umoddi3.o:     ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/umoddi3.c
+udivmoddi4.o:  ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/udivmoddi4.c
+udivmodsi4.o:          ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/arm/udivmodsi4.S
+aeabi_uidivmod.o:      ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/arm/aeabi_uidivmod.S
+aeabi_uldivmod.o:      ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/arm/aeabi_uldivmod.S
 
 # the following is required by pre_init.c
 strncmp.o:     ${NETBSDSRCDIR}/common/lib/libc/string/strncmp.c
 
-# these are required by kprintn.o:
-udivdi3.o:     ${NETBSDSRCDIR}/common/lib/libc/quad/udivdi3.c
-umoddi3.o:     ${NETBSDSRCDIR}/common/lib/libc/quad/umoddi3.c
-qdivrem.o:     ${NETBSDSRCDIR}/common/lib/libc/quad/qdivrem.c
-
-CPPFLAGS.__aeabi_idiv0.c+= -D_STANDALONE
-CPPFLAGS.__aeabi_ldiv0.c+= -D_STANDALONE
-
 # LSC: putchar and kputc have the same signature. A bit hackish.
 CPPFLAGS.subr_prf.c+= -Dputchar=kputc
 
index c3200230e40d5399cc895f415bac852c2e1146b6..b3645fb318a4793b081a8818351ef9f2ac872f90 100644 (file)
@@ -1,4 +1,4 @@
-/*     $NetBSD: memset.S,v 1.1 2005/12/20 19:28:49 christos Exp $      */
+/*     $NetBSD: memset.S,v 1.7 2013/12/02 21:21:33 joerg Exp $ */
 
 /*
  * Copyright 2003 Wasabi Systems, Inc.
 
 #include <machine/asm.h>
 
+#if 0  && defined(__minix)
+#if defined(__ARM_EABI__) && !defined(_BZERO)
+ENTRY(__aeabi_memset)
+       mov     r3, r1
+       mov     r1, r2
+       mov     r2, r3
+       b       memset
+END(__aeabi_memset)
+STRONG_ALIAS(__aeabi_memset4, __aeabi_memset)
+STRONG_ALIAS(__aeabi_memset8, __aeabi_memset)
+
+ENTRY(__aeabi_memclr)
+       mov     r2, r1
+       mov     r1, #0
+       b       memset
+END(__aeabi_memclr)
+STRONG_ALIAS(__aeabi_memclr4, __aeabi_memclr)
+STRONG_ALIAS(__aeabi_memclr8, __aeabi_memclr)
+#endif
+#endif /* #if 0  && defined(__minix) */
+
 /*
  * memset: Sets a block of memory to the specified value
  *
@@ -107,7 +128,7 @@ ENTRY(memset)
 #ifndef _BZERO
        orr     r3, r3, r3, lsl #8      /* Extend value to 16-bits */
 #endif
-#ifdef __XSCALE__
+#ifdef _ARM_ARCH_DWORD_OK
        tst     ip, #0x04               /* Quad-align for Xscale */
 #else
        cmp     r1, #0x10
@@ -115,7 +136,7 @@ ENTRY(memset)
 #ifndef _BZERO
        orr     r3, r3, r3, lsl #16     /* Extend value to 32-bits */
 #endif
-#ifdef __XSCALE__
+#ifdef _ARM_ARCH_DWORD_OK
        subne   r1, r1, #0x04           /* Quad-align if necessary */
        strne   r3, [ip], #0x04
        cmp     r1, #0x10
@@ -128,40 +149,40 @@ ENTRY(memset)
        /* Do 128 bytes at a time */
 .Lmemset_loop128:
        subs    r1, r1, #0x80
-#ifdef __XSCALE__
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
+#ifdef _ARM_ARCH_DWORD_OK
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
 #else
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
 #endif
        bgt     .Lmemset_loop128
 #if defined(__minix)
@@ -174,16 +195,16 @@ ENTRY(memset)
        /* Do 32 bytes at a time */
 .Lmemset_loop32:
        subs    r1, r1, #0x20
-#ifdef __XSCALE__
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
+#ifdef _ARM_ARCH_DWORD_OK
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
 #else
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
 #endif
        bgt     .Lmemset_loop32
 #if defined(__minix)
@@ -194,15 +215,15 @@ ENTRY(memset)
        adds    r1, r1, #0x10           /* Partially adjust for extra sub */
 
        /* Deal with 16 bytes or more */
-#ifdef __XSCALE__
-       strged  r2, [ip], #0x08
-       strged  r2, [ip], #0x08
+#ifdef _ARM_ARCH_DWORD_OK
+       strdge  r2, r3, [ip], #0x08
+       strdge  r2, r3, [ip], #0x08
 #else
-       stmgeia ip!, {r2-r3}
-       stmgeia ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
+       stmiage ip!, {r2-r3}
 #endif
 #if defined(__minix)
-       moveq   r0, #0
+       moveq   r0, #0
 #endif
        RETc(eq)                        /* Zero length so just exit */
 
@@ -218,7 +239,7 @@ ENTRY(memset)
 #endif
        RETc(eq)                        /* Zero length so just exit */
 
-#ifdef __XSCALE__
+#ifdef _ARM_ARCH_DWORD_OK
        /* Compensate for 64-bit alignment check */
        adds    r1, r1, #0x04
 #if defined(__minix)
@@ -231,8 +252,8 @@ ENTRY(memset)
 #endif
 
        strb    r3, [ip], #0x01         /* Set 1 byte */
-       strgeb  r3, [ip], #0x01         /* Set another byte */
-       strgtb  r3, [ip]                /* and a third */
+       strbge  r3, [ip], #0x01         /* Set another byte */
+       strbgt  r3, [ip]                /* and a third */
 #if defined(__minix)
        mov     r0, #0
 #endif
@@ -242,9 +263,9 @@ ENTRY(memset)
        rsb     r2, r2, #0x004
        strb    r3, [ip], #0x01         /* Set 1 byte */
        cmp     r2, #0x02
-       strgeb  r3, [ip], #0x01         /* Set another byte */
+       strbge  r3, [ip], #0x01         /* Set another byte */
        sub     r1, r1, r2
-       strgtb  r3, [ip], #0x01         /* and a third */
+       strbgt  r3, [ip], #0x01         /* and a third */
        cmp     r1, #0x04               /* More than 4 bytes left? */
        bge     .Lmemset_wordaligned    /* Yup */
 
@@ -256,12 +277,21 @@ ENTRY(memset)
        RETc(eq)                                /* Zero length so exit */
        strb    r3, [ip], #0x01         /* Set 1 byte */
        cmp     r1, #0x02
-       strgeb  r3, [ip], #0x01         /* Set another byte */
-       strgtb  r3, [ip]                /* and a third */
+       strbge  r3, [ip], #0x01         /* Set another byte */
+       strbgt  r3, [ip]                /* and a third */
 #if defined(__minix)
-       mov     r0, #0
+       mov     r0, #0
 #endif
        RET                             /* Exit */
+#ifdef _BZERO
+END(bzero)
+#else
+#if !defined(__minix)
+END(memset)
+#else
+END(phys_memset)
+#endif
+#endif
 
 #if defined(__minix)
 LABEL(memset_fault)            /* kernel can send us here */
index 21a859e7af2a8feaf5fcd9ed0b39a150312dc21e..3432de78b530a0902657ba725206b2bfe236a940 100644 (file)
@@ -127,12 +127,22 @@ CPPFLAGS.sha2.c+= -D_STANDALONE
 CPPFLAGS.sha2.c+=      -I${NETBSDSRCDIR}/sys
 
 .for f in \
-       ashrdi3.o divdi3.o lshldi3.o lshrdi3.o moddi3.o \
-       udivdi3.o umoddi3.o qdivrem.o
-${f} ${f:C/\.o/.bc/}:  ${LIBCOMMONCDIR}/quad/${f:C/\.o/.c/}
+       ashrdi3.o divdi3.o lshrdi3.o moddi3.o \
+       udivdi3.o umoddi3.o umodsi3.o udivsi3.o \
+       udivmoddi4.o divsi3.o modsi3.o divmoddi4.o \
+       divmodsi4.o udivmodsi4.o #qdivrem.o lshldi3.o 
+${f} ${f:C/\.o/.bc/}:  ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/${f:C/\.o/.c/}
 OBJS+= ${f}
 CLEANFILES+= ${f}
 
+COPTS+=  -Wno-missing-prototypes \
+                -Wno-old-style-definition \
+                -Wno-strict-prototypes \
+                -Wno-uninitialized \
+                -Wno-cast-qual
+
+
+
 .if ${USE_BITCODE:Uno} == "yes"
 OBJS+= ${f:C/\.o/.bc/}
 CLEANFILES+= ${f:C/\.o/.bc/}
index 2fd3cac4861ad0b0fc5e10d050602b838b288dfd..3d01bafbda1a5c8bfb9cbeaf04109baef777d4df 100644 (file)
@@ -11,7 +11,7 @@ CLEANFILES+= ${f}
 .endfor
 
 .for f in \
-       byte_swap_2.o byte_swap_4.o divsi3.o divide.o udivsi3.o
+       byte_swap_2.o byte_swap_4.o 
 ${f}:  ${LIBCOMMONCARCHDIR}/gen/${f:C/\.o/.S/}
 OBJS+= ${f}
 CLEANFILES+= ${f}
@@ -29,12 +29,12 @@ CLEANFILES+= ${f}
 CPPFLAGS.__aeabi_idiv0.c+= -D_STANDALONE
 CPPFLAGS.__aeabi_ldiv0.c+= -D_STANDALONE
 
-.for f in \
-       __aeabi_ldivmod.o __aeabi_uldivmod.o
-${f}:  ${LIBCOMMONCARCHDIR}/quad/${f:C/\.o/.S/}
-OBJS+= ${f}
-CLEANFILES+= ${f}
-.endfor
+#.for f in \
+#      __aeabi_ldivmod.o __aeabi_uldivmod.o
+#${f}: ${LIBCOMMONCARCHDIR}/quad/${f:C/\.o/.S/}
+#OBJS+=        ${f}
+#CLEANFILES+= ${f}
+#.endfor
 
 .for f in \
        memcmp.o memcpy.o memmove.o memset.o \
@@ -72,6 +72,13 @@ OBJS+=       ${f}
 CLEANFILES+= ${f}
 .endfor
 
+.for f in \
+       aeabi_uidivmod.o aeabi_ldivmod.o aeabi_uldivmod.o aeabi_idivmod.o
+${f}:  ${NETBSDSRCDIR}/sys/external/bsd/compiler_rt/dist/lib/arm/${f:C/\.o/.S/}
+OBJS+= ${f}
+CLEANFILES+= ${f}
+.endfor
+
 .for f in \
        fpgetround.o fpsetround.o fpgetmask.o fpsetmask.o \
        fpgetsticky.o fpsetsticky.o
index 1cbd8d3948aa974746dab917bb20105b4df03bf9..596c780951281f37a33a6d52e511d5f5b336ed84 100644 (file)
@@ -94,7 +94,8 @@ void sigaction_dmp()
                mp->mp_ignore.__bits[0], mp->mp_catch.__bits[0],
                mp->mp_sigmask.__bits[0]);
        printf("%08x  ", mp->mp_sigpending.__bits[0]);
-       if (mp->mp_flags & ALARM_ON) printf("%8lu", mp->mp_timer.tmr_exp_time-uptime);
+       if (mp->mp_flags & ALARM_ON) printf("%8lu",
+               (unsigned long) (mp->mp_timer.tmr_exp_time-uptime));
        else printf("       -");
        printf("\n");
   }
index 8ca64dacd12fb518d51ac45a716cbf98174b9447..1562590d73d8b82d9cd15b00c9d4b1a97bd6bb5d 100644 (file)
@@ -42,10 +42,11 @@ void rproc_dmp()
        rpub = &rprocpub[i];
        if (! (rp->r_flags & RS_IN_USE)) continue;
        if (++n > 22) break;
-       printf("%13s %9d %5d %6s %4d %4ld %8lu %5dx %s",
+       printf("%13s %9d %5d %6s %4d %4lu %8u %5dx %s",
                rpub->label, rpub->endpoint, rp->r_pid,
                s_flags_str(rp->r_flags, rpub->sys_flags), rpub->dev_nr,
-               rp->r_period, rp->r_alive_tm, rp->r_restarts,
+               (unsigned long) rp->r_period,
+               (unsigned int) rp->r_alive_tm, rp->r_restarts,
                rp->r_args
        );
        printf("\n");
index 98876094ab58c32f1739adac6c2d6d0c45ba8607..ae771d9f34e4ba6df2ee7f8b9745d3b3da7c7e3e 100755 (executable)
@@ -28,6 +28,8 @@ fi
 : ${RELEASETOOLSDIR=./releasetools/}
 : ${FSTAB=${DESTDIR}/etc/fstab}
 : ${BUILDVARS=-V MKGCCCMDS=yes -V MKLLVM=no}
+# These BUILDVARS are for building with LLVM:
+#: ${BUILDVARS=-V MKLIBCXX=no -V MKKYUA=no -V MKATF=no -V MKLLVMCMDS=no}
 : ${BUILDSH=build.sh}
 : ${CREATE_IMAGE_ONLY=0}
 : ${RC=minix_x86.rc}
index 95bbf8d01919fe2dcb23a7f05c6d32ec190e2508..f9ef81655ef1217a126589847588839f318b953f 100644 (file)
@@ -1151,7 +1151,7 @@ _MKVARS.yes= \
 
 #MINIX-specific vars
 _MKVARS.yes+= \
-       MKSYSDEBUG MKLIVEUPDATE MKLWIP
+       MKSYSDEBUG MKLIVEUPDATE MKLWIP MKLLVMCMDS
 .if (${MACHINE_ARCH} == "i386")
 _MKVARS.yes+= \
        MKWATCHDOG MKACPI MKAPIC MKDEBUGREG MKINSTALLBOOT MKPCI
index a87426c513c6670442ac153dc1f827ab6c374205..5c49d817182d15282ae9179228f62321dfd36cf4 100644 (file)
 /* Include internal utility function declarations. */
 #include "int_util.h"
 
+#ifdef __minix
+/* missing prototypes causing build problems */
+COMPILER_RT_ABI di_int __ashrdi3(di_int a, si_int b);
+COMPILER_RT_ABI di_int __divdi3(di_int a, di_int b);
+COMPILER_RT_ABI di_int __divmoddi4(di_int a, di_int b, di_int* rem);
+COMPILER_RT_ABI si_int __divmodsi4(si_int a, si_int b, si_int* rem);
+COMPILER_RT_ABI si_int __divsi3(si_int a, si_int b);
+COMPILER_RT_ABI si_int __modsi3(si_int a, si_int b);
+COMPILER_RT_ABI di_int __lshrdi3(di_int a, si_int b);
+COMPILER_RT_ABI di_int __moddi3(di_int a, di_int b);
+COMPILER_RT_ABI du_int __udivdi3(du_int a, du_int b);
+COMPILER_RT_ABI du_int __udivmoddi4(du_int a, du_int b, du_int* rem);
+COMPILER_RT_ABI su_int __udivmodsi4(su_int a, su_int b, su_int* rem);
+COMPILER_RT_ABI su_int __udivsi3(su_int n, su_int d);
+COMPILER_RT_ABI du_int __umoddi3(du_int a, du_int b);
+COMPILER_RT_ABI su_int __umodsi3(su_int a, su_int b);
+#endif
+
 #endif /* INT_LIB_H */
index d16213c49038a5c5d2fb5d97b703c9f60b86305c..e935cfc7bbbd1468d324822b6c44d4ba07903ed0 100644 (file)
 
 #include "int_lib.h"
 
+#ifdef __minix
+si_int COMPILER_RT_ABI __divsi3(si_int a, si_int b);
+#else
 su_int COMPILER_RT_ABI __divsi3(si_int a, si_int b);
+#endif
 
 /* Returns: a % b */
 
index 1195ef6a978550637f8968293f44d9dd6a65cad7..22b909652308ad0ce5c908c514345012dcb13a0b 100644 (file)
@@ -5,6 +5,10 @@
 SRCS+= libunwind.cxx \
        unwind_registers.S
 
+.if defined(__MINIX) && (${MACHINE_ARCH} == "earm")
+SRCS+= aeabi_unwind.c
+.endif
+
 INCS+= unwind.h
 
 .if ${HAVE_GCC:U48} == "4"
index 675556ec2f891a86a897b9bdc5ff1d6d14241db3..ef9d9ca2199e0833164d4553f28ee99bb8877739 100644 (file)
@@ -429,7 +429,11 @@ print_dump(int argc, char **argv)
                }
                if (col != 0)
                        printf("\",\n");
+#ifdef __minix
+               printf("\t\t%zu\n", (size_t) len);
+#else
                printf("\t\t%zu\n", len);
+#endif
                printf("\t}");
                if (i + 1 < argc)
                        printf(",");