Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152979807
D7837.id20389.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
D7837.id20389.diff
View Options
Index: share/mk/bsd.ld-emulation.mk
===================================================================
--- /dev/null
+++ share/mk/bsd.ld-emulation.mk
@@ -0,0 +1,19 @@
+# $FreeBSD$
+
+LD_EMULATION_aarch64=aarch64elf
+LD_EMULATION_amd64=elf_x86_64_fbsd
+LD_EMULATION_arm=armelf_fbsd
+LD_EMULATION_armeb=armelf_fbsd
+LD_EMULATION_armv6=armelf_fbsd
+LD_EMULATION_i386=elf_i386_fbsd
+LD_EMULATION_mips= elf32btsmip_fbsd
+LD_EMULATION_mips64= elf64btsmip_fbsd
+LD_EMULATION_mipsel= elf32ltsmip_fbsd
+LD_EMULATION_mips64el= elf64ltsmip_fbsd
+LD_EMULATION_mipsn32= elf32btsmipn32_fbsd
+LD_EMULATION_mipsn32el= elf32btsmipn32_fbsd # I don't think this is a thing that works
+LD_EMULATION_powerpc= elf32ppc_fbsd
+LD_EMULATION_powerpc64= elf32ppc_fbsd
+LD_EMULATION_riscv= elf32ppc_fbsd
+LD_EMULATION_sparc64= elf32ppc_fbsd
+LD_EMULATION=${LD_EMULATION_${MACHINE_ARCH}}
Index: sys/conf/kern.pre.mk
===================================================================
--- sys/conf/kern.pre.mk
+++ sys/conf/kern.pre.mk
@@ -17,6 +17,7 @@
.include <bsd.own.mk>
.include <bsd.compiler.mk>
+.include <bsd.ld-emulation.mk>
.include "kern.opts.mk"
# The kernel build always occurs in the object directory which is .CURDIR.
@@ -119,7 +120,7 @@
NORMAL_FW= uudecode -o ${.TARGET} ${.ALLSRC}
NORMAL_FWO= ${LD} -b binary --no-warn-mismatch -d -warn-common -r \
- -o ${.TARGET} ${.ALLSRC:M*.fw}
+ -m ${LD_EMULATION} -o ${.TARGET} ${.ALLSRC:M*.fw}
# Common for dtrace / zfs
CDDL_CFLAGS= -DFREEBSD_NAMECACHE -nostdinc -I$S/cddl/compat/opensolaris -I$S/cddl/contrib/opensolaris/uts/common -I$S -I$S/cddl/contrib/opensolaris/common ${CFLAGS} -Wno-unknown-pragmas -Wno-missing-prototypes -Wno-undef -Wno-strict-prototypes -Wno-cast-qual -Wno-parentheses -Wno-redundant-decls -Wno-missing-braces -Wno-uninitialized -Wno-unused -Wno-inline -Wno-switch -Wno-pointer-arith -Wno-unknown-pragmas
Index: sys/conf/kmod.mk
===================================================================
--- sys/conf/kmod.mk
+++ sys/conf/kmod.mk
@@ -74,6 +74,7 @@
# do this after bsd.own.mk.
.include "kern.opts.mk"
.include <bsd.compiler.mk>
+.include <bsd.ld-emulation.mk>
.include "config.mk"
# Search for kernel source tree in standard places.
@@ -171,11 +172,13 @@
@${ECHO} ${_firmw:C/\:.*$//} ${.ALLSRC:M*${_firmw:C/\:.*$//}}
@if [ -e ${_firmw:C/\:.*$//} ]; then \
${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \
- -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \
+ -m ${LD_EMULATION} -r -d \
+ -o ${.TARGET} ${_firmw:C/\:.*$//}; \
else \
ln -s ${.ALLSRC:M*${_firmw:C/\:.*$//}} ${_firmw:C/\:.*$//}; \
${LD} -b binary --no-warn-mismatch ${_LDFLAGS} \
- -r -d -o ${.TARGET} ${_firmw:C/\:.*$//}; \
+ -m ${LD_EMULATION} -r -d \
+ -o ${.TARGET} ${_firmw:C/\:.*$//}; \
rm ${_firmw:C/\:.*$//}; \
fi
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 19, 11:09 AM (59 m, 37 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31764460
Default Alt Text
D7837.id20389.diff (2 KB)
Attached To
Mode
D7837: Always pass -m to ld for converting binary files to ELF objects
Attached
Detach File
Event Timeline
Log In to Comment