Module Name: src Committed By: mrg Date: Sat Apr 17 10:54:47 UTC 2021
Modified Files: src/external/gpl3/gcc/lib/libgcc: Makefile.inc src/external/gpl3/gcc/lib/libgcc/libgcc: Makefile Log Message: add support for arm64 lse.S. arm64 userland much happier now. /usr/bin/gcc as gcc 10 on arm64 is fine, build is complete, though i did not test xsrc yet. To generate a diff of this commit: cvs rdiff -u -r1.47 -r1.48 src/external/gpl3/gcc/lib/libgcc/Makefile.inc cvs rdiff -u -r1.29 -r1.30 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/external/gpl3/gcc/lib/libgcc/Makefile.inc diff -u src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.47 src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.48 --- src/external/gpl3/gcc/lib/libgcc/Makefile.inc:1.47 Mon Apr 12 00:05:55 2021 +++ src/external/gpl3/gcc/lib/libgcc/Makefile.inc Sat Apr 17 10:54:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile.inc,v 1.47 2021/04/12 00:05:55 mrg Exp $ +# $NetBSD: Makefile.inc,v 1.48 2021/04/17 10:54:46 mrg Exp $ LIBGCC_MACHINE_ARCH?=${MACHINE_ARCH:S/earmv5/earm/} GCC_MACHINE_SUBDIR=${MACHINE_CPU:C/powerpc.*/rs6000/:C/x86_64/i386/} @@ -30,9 +30,11 @@ CPPFLAGS+= ${G_INTERNAL_CFLAGS:M-DHAVE_C .if ${LIBGCC_MACHINE_ARCH} == "powerpc" || \ ${LIBGCC_MACHINE_ARCH} == "sh3el" || \ ${LIBGCC_MACHINE_ARCH} == "sh3eb" || \ - ${LIBGCC_MACHINE_ARCH} == "m68000" + ${LIBGCC_MACHINE_ARCH} == "m68000" || \ + ${LIBGCC_MACHINE_ARCH} == "aarch64" || \ + ${LIBGCC_MACHINE_ARCH} == "aarch64eb" _TRADITIONAL_CPP= -COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} -c +COMPILE.S= ${CC} ${AFLAGS} ${CPPFLAGS} ${CPPFLAGS.${.IMPSRC:T}} -c .endif .if ${LIBGCC_MACHINE_ARCH} == "powerpc" @@ -166,6 +168,40 @@ ${LIB1ASMFUNCS}: ${.CURDIR}/Makefile printf '#define L${.PREFIX}\n#include <${G_LIB1ASMSRC}>\n' >${.TARGET} .endif +.if ${LIB} == "gcc" && \ + (${LIBGCC_MACHINE_ARCH} == "aarch64" || \ + ${LIBGCC_MACHINE_ARCH} == "aarch64be") # { +# XXX lse.S objects are placed directly into "libgcc-objects" for GCC, and +# are not pulled out by mknative-gcc easily. +. for s in 1 2 4 8 16 +. for m in 1 2 3 4 +. for n in cas +LSE_NAMES+= ${n}_${s}_${m} +CPPFLAGS.${n}_${s}_${m}+= -DL_${n} -DSIZE=${s} -DMODEL=${m} +. endfor +. endfor +. endfor + +. for s in 1 2 4 8 +. for m in 1 2 3 4 +. for n in swp ldadd ldclr ldeor ldset +LSE_NAMES+= ${n}_${s}_${m} +CPPFLAGS.${n}_${s}_${m}+= -DL_${n} -DSIZE=${s} -DMODEL=${m} +. endfor +. endfor +. endfor + +LSE_SRC= ${GNUHOSTDIST}/libgcc/config/aarch64/lse.S + +${LSE_NAMES:=.o}: ${LSE_SRC} Makefile + ${_MKTARGET_COMPILE} + ${COMPILE.S} ${CPPFLAGS.${.TARGET:T:.o=}} -o ${.TARGET} ${LSE_SRC} + +# lse-init.c currently compiles to nothing for us +G_LIB2ADD+= ${GNUHOSTDIST}/libgcc/config/aarch64/lse-init.c + +.endif # } arm64 + # Use dynamic sources to arrange for the C file to be the first dependency # so ${.IMPSRC} will work. Index: src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile diff -u src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.29 src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.30 --- src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile:1.29 Mon Apr 12 00:05:55 2021 +++ src/external/gpl3/gcc/lib/libgcc/libgcc/Makefile Sat Apr 17 10:54:46 2021 @@ -1,4 +1,4 @@ -# $NetBSD: Makefile,v 1.29 2021/04/12 00:05:55 mrg Exp $ +# $NetBSD: Makefile,v 1.30 2021/04/17 10:54:46 mrg Exp $ REQUIRETOOLS= yes NOLINT= # defined @@ -32,7 +32,8 @@ LIB2ADD_EDITED= ${G_LIB2ADD:T:S/.asm/.S/ SRCS+= ${LIB2FUNCS} ${LIB2FUNCS_ST} ${LIB2DIVMOD} \ ${LIB2ADD_EDITED} \ ${LIB2ADD_HACK:T:S/.asm/.S/} \ - ${G_LIB2ADD_ST:T} ${LIB1ASMFUNCS} + ${G_LIB2ADD_ST:T} ${LIB1ASMFUNCS} \ + ${LSE_NAMES:=.o} .if ${MKPIC} == "no" .if empty(LIBGCC_MACHINE_ARCH:Mearm*) SRCS+= ${LIB2_EH} ${LIB2_EHASM}