Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F157156380
D36421.id111108.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D36421.id111108.diff
View Options
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
@@ -66,6 +66,12 @@
LIB32CFLAGS= -DCOMPAT_32BIT
LIB32DTRACE= ${DTRACE} -32
LIB32WMAKEFLAGS+= -DCOMPAT_32BIT
+LIB32_MACHINE_ABI= ${MACHINE_ABI:N*64} long32 ptr32
+.if ${COMPAT_ARCH} == "amd64"
+LIB32_MACHINE_ABI+= time32
+.else
+LIB32_MACHINE_ABI+= time64
+.endif
# -------------------------------------------------------------------
# In the program linking case, select LIBCOMPAT
@@ -95,7 +101,7 @@
# Set defaults based on type.
libcompat= ${_LIBCOMPAT:tl}
_LIBCOMPAT_MAKEVARS= _OBJTOP TMP CPUFLAGS CFLAGS CXXFLAGS LDFLAGS \
- _MACHINE _MACHINE_ARCH \
+ _MACHINE _MACHINE_ARCH _MACHINE_ABI \
WMAKEENV WMAKEFLAGS WMAKE WORLDTMP
.for _var in ${_LIBCOMPAT_MAKEVARS}
.if !empty(LIB${_LIBCOMPAT}${_var})
diff --git a/share/mk/bsd.cpu.mk b/share/mk/bsd.cpu.mk
--- a/share/mk/bsd.cpu.mk
+++ b/share/mk/bsd.cpu.mk
@@ -362,3 +362,41 @@
CFLAGS += ${CFLAGS.${MACHINE_ARCH}}
CXXFLAGS += ${CXXFLAGS.${MACHINE_ARCH}}
+#
+# MACHINE_ABI is a list of properties about the ABI used for MACHINE_ARCH.
+# The following properties are indicated with one of the follow values:
+#
+# Byte order: big-endian, little-endian
+# Floating point ABI: soft-float, hard-float
+# Size of long (size_t, etc): long32, long64
+# Pointer type: ptr32, ptr64
+# Size of time_t: time32, time64
+#
+.if (${MACHINE} == "arm" && (defined(CPUTYPE) && ${CPUTYPE:M*soft*})) || \
+ (${MACHINE_ARCH} == "powerpc" && (defined(CPUTYPE) && ${CPUTYPE} == "e500")) || \
+ ${MACHINE_ARCH:Mriscv*sf*}
+MACHINE_ABI+= soft-float
+.else
+MACHINE_ABI+= hard-float
+.endif
+# Currently all 64-bit architectures include 64 in their name (see arch(7)).
+.if ${MACHINE_ARCH:M*64*}
+MACHINE_ABI+= long64
+.else
+MACHINE_ABI+= long32
+.endif
+.if ${MACHINE_ABI:Mlong64}
+MACHINE_ABI+= ptr64
+.else
+MACHINE_ABI+= ptr32
+.endif
+.if ${MACHINE_ARCH} == "i386"
+MACHINE_ABI+= time32
+.else
+MACHINE_ABI+= time64
+.endif
+.if ${MACHINE_ARCH:Mpowerpc*} && !${MACHINE_ARCH:M*le}
+MACHINE_ABI+= big-endian
+.else
+MACHINE_ABI+= little-endian
+.endif
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Tue, May 19, 8:48 PM (8 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33290511
Default Alt Text
D36421.id111108.diff (2 KB)
Attached To
Mode
D36421: Introduce MACHINE_ABI as a list of ABI properties
Attached
Detach File
Event Timeline
Log In to Comment