Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/external/gpl3/gcc/lib/libgcc add support for arm64 lse.S.



details:   https://anonhg.NetBSD.org/src/rev/851c8fcb709b
branches:  trunk
changeset: 982568:851c8fcb709b
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Apr 17 10:54:46 2021 +0000

description:
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.

diffstat:

 external/gpl3/gcc/lib/libgcc/Makefile.inc    |  42 ++++++++++++++++++++++++++--
 external/gpl3/gcc/lib/libgcc/libgcc/Makefile |   5 ++-
 2 files changed, 42 insertions(+), 5 deletions(-)

diffs (83 lines):

diff -r 5d11e3138532 -r 851c8fcb709b external/gpl3/gcc/lib/libgcc/Makefile.inc
--- a/external/gpl3/gcc/lib/libgcc/Makefile.inc Sat Apr 17 10:53:18 2021 +0000
+++ b/external/gpl3/gcc/lib/libgcc/Makefile.inc Sat Apr 17 10:54:46 2021 +0000
@@ -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 @@
 .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 @@
        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.
 
diff -r 5d11e3138532 -r 851c8fcb709b external/gpl3/gcc/lib/libgcc/libgcc/Makefile
--- a/external/gpl3/gcc/lib/libgcc/libgcc/Makefile      Sat Apr 17 10:53:18 2021 +0000
+++ b/external/gpl3/gcc/lib/libgcc/libgcc/Makefile      Sat Apr 17 10:54:46 2021 +0000
@@ -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 @@
 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}



Home | Main Index | Thread Index | Old Index