Bug 220877 - embedfs throw compile error on aarch64(arm64)
Summary: embedfs throw compile error on aarch64(arm64)
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: CURRENT
Hardware: arm64 Any
: --- Affects Only Me
Assignee: Ed Maste
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2017-07-20 08:28 UTC by David NewHamlet
Modified: 2017-07-27 00:30 UTC (History)
2 users (show)

See Also:
emaste: mfc-stable11+
emaste: mfc-stable10-


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David NewHamlet 2017-07-20 08:28:37 UTC
Compiling aarch64 kernel for raspberry pi 3 with following configure:

options         MD_ROOT
makeoptions     MFS_IMAGE=/usr/src/sys/arm64/conf/initrd.img

Throw error:

# --- embedfs_initrd.o --- 
# objcopy --input-target binary  --output-target   --binary-architecture aarch64  /usr/src/sys/arm64/conf/initrd.img embedfs_initrd.o
# objcopy: --binary-architecture: invalid target name
# *** [embedfs_initrd.o] Error code 1

As we can see, command 'objcopy' missed one arg after --output-target.
The correct command line should be 'objcopy --input-target binary  --output-target elf64-littleaarch64 --binary-architecture aarch64  /usr/src/sys/arm64/conf/initrd.img embedfs_initrd.o'.

This small patch will fix the issue. It works for me.

---- cut here ---
--- /home/david/sandspace/private-freebsd/sys/conf/kern.pre.mk.orig
+++ /home/david/sandspace/private-freebsd/sys/conf/kern.pre.mk
@@ -250,6 +250,7 @@
 
 EMBEDFS_FORMAT.arm?=		elf32-littlearm
 EMBEDFS_FORMAT.armv6?=		elf32-littlearm
+EMBEDFS_FORMAT.aarch64?=	elf64-littleaarch64
 EMBEDFS_FORMAT.mips?=		elf32-tradbigmips
 EMBEDFS_FORMAT.mipsel?=		elf32-tradlittlemips
 EMBEDFS_FORMAT.mips64?=		elf64-tradbigmips
---- cut here ---
Comment 1 David NewHamlet 2017-07-20 08:30:35 UTC
git commit 4d77702aa0567b4d2bd81d13e1a98dc574ff4b5e
Comment 2 commit-hook freebsd_committer freebsd_triage 2017-07-20 18:22:57 UTC
A commit references this bug:

Author: emaste
Date: Thu Jul 20 18:22:49 UTC 2017
New revision: 321302
URL: https://svnweb.freebsd.org/changeset/base/321302

Log:
  add arm64 objcopy output target for embedfs

  PR:		220877
  Submitted by:	David NewHamlet
  MFC after:	1 week

Changes:
  head/sys/conf/kern.pre.mk
Comment 3 commit-hook freebsd_committer freebsd_triage 2017-07-27 00:26:51 UTC
A commit references this bug:

Author: emaste
Date: Thu Jul 27 00:25:52 UTC 2017
New revision: 321599
URL: https://svnweb.freebsd.org/changeset/base/321599

Log:
  MFC r321302: add arm64 objcopy output target for embedfs

  PR:		220877
  Submitted by:	David NewHamlet

Changes:
_U  stable/11/
  stable/11/sys/conf/kern.pre.mk