Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F159363751
D20261.id57391.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
3 KB
Referenced Files
None
Subscribers
None
D20261.id57391.diff
View Options
Index: Makefile.inc1
===================================================================
--- Makefile.inc1
+++ Makefile.inc1
@@ -795,6 +795,7 @@
${TARGET_ARCH} == "powerpc64" || ${TARGET_ARCH:Mmips64*} != "")
LIBCOMPAT= 32
.include "Makefile.libcompat"
+CROSSENV+=LIB32LD=${LIB32LD}
.elif ${MK_LIBSOFT} != "no" && ${TARGET_ARCH:Marmv[67]*} != ""
LIBCOMPAT= SOFT
.include "Makefile.libcompat"
Index: Makefile.libcompat
===================================================================
--- Makefile.libcompat
+++ Makefile.libcompat
@@ -8,6 +8,12 @@
# -------------------------------------------------------------------
# 32 bit world
+
+
+# Determines linker used for 32-bit compatibility
+.include "Makefile.libcompat.inc1"
+
+
.if ${TARGET_ARCH} == "amd64"
.if empty(TARGET_CPUTYPE)
LIB32CPUFLAGS= -march=i686 -mmmx -msse -msse2
@@ -24,7 +30,7 @@
MACHINE_CPU="i686 mmx sse sse2"
LIB32WMAKEFLAGS= \
AS="${XAS} --32" \
- LD="${XLD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" \
+ LD="${LIB32LD} -m elf_i386_fbsd -L${LIBCOMPATTMP}/usr/lib32" \
OBJCOPY="${XOBJCOPY}"
.elif ${TARGET_ARCH} == "powerpc64"
@@ -33,10 +39,24 @@
.else
LIB32CPUFLAGS= -mcpu=${TARGET_CPUTYPE}
.endif
+
+.if ${WANT_COMPILER_TYPE} == gcc || \
+ (defined(X_COMPILER_TYPE) && ${X_COMPILER_TYPE} == gcc)
LIB32CPUFLAGS+= -m32
+.else
+LIB32CPUFLAGS+= -target powerpc-unknown-freebsd13.0
+
+.if ${LIB32LD} == "ld.bfd"
+LIB32CPUFLAGS+= -fuse-ld=bfd
+.else
+LIB32CPUFLAGS+= -fuse-ld=${LIB32LD}
+.endif
+
+.endif
+
LIB32WMAKEENV= MACHINE=powerpc MACHINE_ARCH=powerpc
LIB32WMAKEFLAGS= \
- LD="${XLD} -m elf32ppc_fbsd" \
+ LD="${LIB32LD} -m elf32ppc_fbsd" \
OBJCOPY="${XOBJCOPY}"
.elif ${TARGET_ARCH:Mmips64*} != ""
@@ -57,9 +77,9 @@
LIB32CPUFLAGS+= -mabi=32
LIB32WMAKEENV= MACHINE=mips MACHINE_ARCH=mips
.if ${TARGET_ARCH:Mmips64el*} != ""
-LIB32WMAKEFLAGS= LD="${XLD} -m elf32ltsmip_fbsd"
+LIB32WMAKEFLAGS= LD="${LIB32LD} -m elf32ltsmip_fbsd"
.else
-LIB32WMAKEFLAGS= LD="${XLD} -m elf32btsmip_fbsd"
+LIB32WMAKEFLAGS= LD="${LIB32LD} -m elf32btsmip_fbsd"
.endif
LIB32WMAKEFLAGS+= OBJCOPY="${XOBJCOPY}"
.endif
Index: Makefile.libcompat.inc1
===================================================================
--- /dev/null
+++ Makefile.libcompat.inc1
@@ -0,0 +1,18 @@
+# $FreeBSD$
+
+# Currently LLD support for PowerPC 32-bit is not complete,
+# so falling back to ld.bfd
+.if ${TARGET_ARCH} == "powerpc64" && ${LINKER_TYPE} == "lld"
+.if defined(CROSS_TOOLCHAIN)
+.if !defined(CROSS_BINUTILS_PREFIX)
+.error 32 bit binaries on PowerPC64 requires binutils linker ld.bfd. Please set CROSS_BINUTILS_PREFIX.
+.else
+LIB32LD?=${LOCALBASE}/bin/${CROSS_BINUTILS_PREFIX}-ld.bfd
+.endif # if !defined(CROSS_BINUTILS_PREFIX)
+.else # Native build
+LIB32LD?=ld.bfd
+.endif
+.info LIB32: using ${LIB32LD} as linker for LIB32
+.endif
+
+LIB32LD?=${XLD}
Index: stand/defs.mk
===================================================================
--- stand/defs.mk
+++ stand/defs.mk
@@ -93,6 +93,10 @@
# or powerpc64.
.if ${MACHINE_ARCH} == "powerpc64"
CFLAGS+= -m32 -mcpu=powerpc
+# Use same linker used to link 32 bit binaries
+.if ${LINKER_TYPE} == "lld"
+CFLAGS+= -fuse-ld=${LIB32LD}
+.endif
.endif
# For amd64, there's a bit of mixed bag. Some of the tree (i386, lib*32) is
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jun 14, 7:54 AM (12 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
33941687
Default Alt Text
D20261.id57391.diff (3 KB)
Attached To
Mode
D20261: [PowerPC64] Use ld.bfd to build LIB32 and STAND - when using llvm
Attached
Detach File
Event Timeline
Log In to Comment