project-lakitu: fix lakitu_kdump kexec_file flags for ARM64

- Fix makedumpfile cross-build
- Enable lakitu_kdump and kexec_file flags for ARM64 profile

BUG=b/177595663
TEST=presubmit
RELEASE_NOTE=None

Change-Id: I8bc78db3cb52172ff772da454135426348771981
Reviewed-on: https://cos-review.googlesource.com/c/cos/overlays/board-overlays/+/10841
Reviewed-by: Roy Yang <royyang@google.com>
Reviewed-by: Robert Kolchmeyer <rkolchmeyer@google.com>
Reviewed-by: Vaibhav Rustagi <vaibhavrustagi@google.com>
Tested-by: Oleksandr Tymoshenko <ovt@google.com>
diff --git a/project-lakitu/profiles/arch/arm64/make.defaults b/project-lakitu/profiles/arch/arm64/make.defaults
index 0e0a8f0..7c5b0ed 100644
--- a/project-lakitu/profiles/arch/arm64/make.defaults
+++ b/project-lakitu/profiles/arch/arm64/make.defaults
@@ -13,4 +13,4 @@
 USE="${USE} -seccomp"
 # TODO: Re-enable "lakitu_kdump" and "kexec_file" once they are fixed.
 #       http://b/177595663 .
-USE="${USE} -lakitu_kdump -kexec_file"
+USE="${USE} lakitu_kdump kexec_file"
diff --git a/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7-r1.ebuild b/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7-r2.ebuild
similarity index 100%
rename from project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7-r1.ebuild
rename to project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7-r2.ebuild
diff --git a/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7.ebuild b/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7.ebuild
index dc65194..5a3eed5 100644
--- a/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7.ebuild
+++ b/project-lakitu/sys-apps/makedumpfile/makedumpfile-1.6.7.ebuild
@@ -4,6 +4,8 @@
 
 EAPI=6
 
+inherit toolchain-funcs
+
 SRC_URI="https://sourceforge.net/projects/makedumpfile/files/makedumpfile/${PV}/makedumpfile-${PV}.tar.gz/download -> ${P}.tar.gz"
 
 DESCRIPTION="minimize and compress /proc/vmcore for use with crash"
@@ -24,5 +26,15 @@
 src_compile () {
 	# This is a work around for lacking of lelf. See:
 	# https://github.com/pratyushanand/makedumpfile/blob/70a9e5edd5b63cf8cce0232d3642fa5397cc0c34/README#L165
-	emake LINKTYPE=dynamic
+	# makedumpfile's string constants for architectures
+	# differ from the ones in portages
+	if [ "${ARCH}" = "arm64" ]; then
+		TARGET="aarch64"
+	elif [ "${ARCH}" = "amd64" ]; then
+		TARGET="x86_64"
+	else
+		eerror "unsupported architecture: ${ARCH}"
+		die
+	fi
+	emake CC="$(tc-getCC)" TARGET="${TARGET}" LINKTYPE=dynamic
 }