Index: lib/libc/quad/quad.h =================================================================== --- lib/libc/quad/quad.h +++ lib/libc/quad/quad.h @@ -103,3 +103,7 @@ u_quad_t __umoddi3(u_quad_t a, u_quad_t b); typedef unsigned int qshift_t; + +quad_t __ashldi3(quad_t, qshift_t); +quad_t __ashrdi3(quad_t, qshift_t); +quad_t __lshrdi3(quad_t, qshift_t); Index: stand/defs.mk =================================================================== --- stand/defs.mk +++ stand/defs.mk @@ -33,6 +33,7 @@ SYSDIR= ${SRCTOP}/sys UBOOTSRC= ${BOOTSRC}/uboot ZFSSRC= ${SASRC}/zfs +LIBCSRC= ${SRCTOP}/lib/libc BOOTOBJ= ${OBJTOP}/stand Index: stand/i386/boot2/Makefile =================================================================== --- stand/i386/boot2/Makefile +++ stand/i386/boot2/Makefile @@ -78,7 +78,9 @@ boot2.bin: boot2.out ${OBJCOPY} -S -O binary boot2.out ${.TARGET} -boot2.out: ${BTXCRT} boot2.o sio.o +# For __ashldi3 +.PATH: ${LIBCSRC}/quad +boot2.out: ${BTXCRT} boot2.o sio.o ashldi3.o ${LD} ${LD_FLAGS} -Ttext ${ORG2} -o ${.TARGET} ${.ALLSRC} SRCS= boot2.c boot2.h Index: stand/libsa/Makefile =================================================================== --- stand/libsa/Makefile +++ stand/libsa/Makefile @@ -9,7 +9,6 @@ .include LIBSA_CPUARCH?=${MACHINE_CPUARCH} -LIBC_SRC= ${SRCTOP}/lib/libc LIB?= sa @@ -21,12 +20,12 @@ # private (pruned) versions of libc string functions SRCS+= strcasecmp.c -.PATH: ${LIBC_SRC}/net +.PATH: ${LIBCSRC}/net SRCS+= ntoh.c # string functions from libc -.PATH: ${LIBC_SRC}/string +.PATH: ${LIBCSRC}/string SRCS+= bcmp.c bcopy.c bzero.c ffs.c fls.c \ memccpy.c memchr.c memcmp.c memcpy.c memmove.c memset.c \ qdivrem.c strcat.c strchr.c strcmp.c strcpy.c stpcpy.c stpncpy.c \ @@ -34,7 +33,7 @@ strnlen.c strpbrk.c strrchr.c strsep.c strspn.c strstr.c strtok.c swab.c # stdlib functions from libc -.PATH: ${LIBC_SRC}/stdlib +.PATH: ${LIBCSRC}/stdlib SRCS+= abs.c strtol.c strtoll.c strtoul.c strtoull.c # common boot code @@ -42,7 +41,7 @@ SRCS+= subr_boot.c .if ${MACHINE_CPUARCH} == "arm" -.PATH: ${LIBC_SRC}/arm/gen +.PATH: ${LIBCSRC}/arm/gen # Do not generate movt/movw, because the relocation fixup for them does not # translate to the -Bsymbolic -pie format required by self_reloc() in loader(8). @@ -68,22 +67,19 @@ .endif .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "riscv" -.PATH: ${LIBC_SRC}/${MACHINE_CPUARCH}/gen +.PATH: ${LIBCSRC}/${MACHINE_CPUARCH}/gen .endif -.if ${MACHINE_CPUARCH} == "powerpc" -.PATH: ${LIBC_SRC}/quad +.PATH: ${LIBCSRC}/quad +.if ${MACHINE_CPUARCH} != "riscv" SRCS+= ashldi3.c ashrdi3.c lshrdi3.c -SRCS+= syncicache.c .endif - -.if ${MACHINE_CPUARCH} == "mips" -.PATH: ${LIBC_SRC}/quad -SRCS+= ashldi3.c ashrdi3.c lshrdi3.c +.if ${MACHINE_CPUARCH} == "powerpc" +SRCS+= syncicache.c .endif # uuid functions from libc -.PATH: ${LIBC_SRC}/uuid +.PATH: ${LIBCSRC}/uuid SRCS+= uuid_create_nil.c uuid_equal.c uuid_from_string.c uuid_is_nil.c uuid_to_string.c # _setjmp/_longjmp Index: stand/libsa/quad.h =================================================================== --- stand/libsa/quad.h +++ stand/libsa/quad.h @@ -101,14 +101,8 @@ u_quad_t __udivdi3(u_quad_t a, u_quad_t b); u_quad_t __umoddi3(u_quad_t a, u_quad_t b); -/* - * XXX - * Compensate for gcc 1 vs gcc 2. Gcc 1 defines ?sh?di3's second argument - * as u_quad_t, while gcc 2 correctly uses int. Unfortunately, we still use - * both compilers. - */ -#if __GNUC__ >= 2 typedef unsigned int qshift_t; -#else -typedef u_quad_t qshift_t; -#endif + +quad_t __ashldi3(quad_t, qshift_t); +quad_t __ashrdi3(quad_t, qshift_t); +quad_t __lshrdi3(quad_t, qshift_t);