Page MenuHomeFreeBSD

D40945.1787964923.diff
No OneTemporary

Size
3 KB
Referenced Files
None
Subscribers
None

D40945.1787964923.diff

diff --git a/Makefile.inc1 b/Makefile.inc1
--- a/Makefile.inc1
+++ b/Makefile.inc1
@@ -1082,6 +1082,9 @@
-p ${WORLDTMP}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${WORLDTMP}/usr/include/i386
+.endif
+.if ${TARGET_ARCH} == "aarch64"
+ mkdir -p ${WORLDTMP}/usr/include/arm
.endif
ln -sf ${.CURDIR}/sys ${WORLDTMP}
.if ${MK_DEBUG_FILES} != "no"
@@ -1418,6 +1421,9 @@
.if ${TARGET_ARCH} == "amd64"
-mkdir ${DESTDIR}/${DISTDIR}/${dist}/usr/include/i386
.endif
+.if ${TARGET_ARCH} == "aarch64"
+ -mkdir ${DESTDIR}/${DISTDIR}/${dist}/usr/include/arm
+.endif
.if ${MK_DEBUG_FILES} != "no"
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.debug.dist \
-p ${DESTDIR}/${DISTDIR}/${dist}/usr/lib >/dev/null
@@ -1449,6 +1455,9 @@
.if ${TARGET_ARCH} == "amd64"
echo "./${dist}/usr/include/i386 type=dir uname=root gname=wheel mode=0755" >> ${METALOG}
.endif
+.if ${TARGET_ARCH} == "aarch64"
+ echo "./${dist}/usr/include/arm type=dir uname=root gname=wheel mode=0755" >> ${METALOG}
+.endif
.for libcompat in ${libcompats}
${IMAKEENV} ${DISTR_MTREE} -C -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist | \
sed -e 's#^\./#./${dist}/usr/#' >> ${METALOG}
@@ -2902,6 +2911,9 @@
-p ${NXBDESTDIR}/usr/include >/dev/null
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${NXBDESTDIR}/usr/include/i386
+.endif
+.if ${TARGET_ARCH} == "aarch64"
+ mkdir -p ${NXBDESTDIR}/usr/include/arm
.endif
${_+_}cd ${.CURDIR}; ${NXBMAKE} \
DESTDIR=${NXBDESTDIR} \
@@ -3591,6 +3603,9 @@
.if ${TARGET_ARCH} == "amd64"
mkdir -p ${XDDESTDIR}/usr/include/i386
.endif
+.if ${TARGET_ARCH} == "aarch64"
+ mkdir -p ${XDDESTDIR}/usr/include/arm
+.endif
.for libcompat in ${libcompats}
${DESTDIR_MTREE} -f ${.CURDIR}/etc/mtree/BSD.lib${libcompat}.dist \
-p ${XDDESTDIR}/usr >/dev/null
diff --git a/Makefile.libcompat b/Makefile.libcompat
--- a/Makefile.libcompat
+++ b/Makefile.libcompat
@@ -4,7 +4,7 @@
__<${_this:T}>__:
# Makefile for the compatibility libraries.
-# - 32-bit compat libraries on PowerPC, and AMD64.
+# - 32-bit compat libraries on PowerPC, AArch64, and AMD64.
.if defined(_LIBCOMPATS)
diff --git a/lib/Makefile b/lib/Makefile
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -203,7 +203,8 @@
SUBDIR.${MK_BHYVE}+= libvmmapi
.endif
-.if ${MACHINE_ARCH} != "powerpc"
+.if ${MACHINE_ARCH} != "powerpc" && \
+ (${TARGET_ARCH} != "aarch64" || !defined(COMPAT_32BIT))
SUBDIR.${MK_OPENMP}+= libomp
.endif
.if !defined(COMPAT_32BIT) && ${MK_USB} != "no"
diff --git a/share/mk/bsd.compat.mk b/share/mk/bsd.compat.mk
--- a/share/mk/bsd.compat.mk
+++ b/share/mk/bsd.compat.mk
@@ -63,6 +63,25 @@
LIB32_MACHINE_ARCH= powerpc
LIB32WMAKEFLAGS= \
LD="${XLD} -m elf32ppc_fbsd"
+
+.elif ${COMPAT_ARCH} == "aarch64"
+HAS_COMPAT=32
+.if empty(COMPAT_CPUTYPE)
+LIB32CPUFLAGS= -march="armv7"
+.else
+LIB32CPUFLAGS= -mcpu=${COMPAT_CPUTYPE}
+.endif
+
+LIB32CPUFLAGS+= -m32
+.if ${COMPAT_COMPILER_TYPE} == "gcc"
+.else
+LIB32CPUFLAGS+= -target armv7-unknown-freebsd${OS_REVISION}-gnueabihf
+.endif
+
+LIB32_MACHINE= arm
+LIB32_MACHINE_ARCH= armv7
+LIB32WMAKEFLAGS= \
+ LD="${XLD} -m armelf_fbsd"
.endif
LIB32WMAKEFLAGS+= NM="${XNM}"
@@ -124,7 +143,9 @@
LIB${_LIBCOMPAT}WMAKEENV+= MACHINE_ARCH=${LIB${_LIBCOMPAT}_MACHINE_ARCH}
# -B is needed to find /usr/lib32/crti.o for gcc.
-LIB${_LIBCOMPAT}CFLAGS+= -B${WORLDTMP}/usr/lib${_libcompat}
+# -L should be implied by -B, but is needed for clang on arm64.
+LIB${_LIBCOMPAT}CFLAGS+= -B${WORLDTMP}/usr/lib${_libcompat} \
+ -L${WORLDTMP}/usr/lib${_libcompat}
.endfor
.if defined(USE_COMPAT)
diff --git a/share/mk/src.opts.mk b/share/mk/src.opts.mk
--- a/share/mk/src.opts.mk
+++ b/share/mk/src.opts.mk
@@ -297,8 +297,8 @@
.else
__DEFAULT_NO_OPTIONS+=LLDB
.endif
-# LIB32 is supported on amd64 and powerpc64
-.if (${__T} == "amd64" || ${__T} == "powerpc64")
+# LIB32 is supported on amd64, aarch64, and powerpc64
+.if (${__T} == "amd64" || ${__T} == "aarch64" || ${__T} == "powerpc64")
__DEFAULT_YES_OPTIONS+=LIB32
.else
BROKEN_OPTIONS+=LIB32

File Metadata

Mime Type
text/plain
Expires
Sat, Aug 29, 12:55 AM (12 h, 53 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
29481763
Default Alt Text
D40945.1787964923.diff (3 KB)

Event Timeline