lg-us996: new device (MR 2253)
[ci:skip-build]: already built successfully in CI
This commit is contained in:
parent
595f3dcb9c
commit
8479d2376f
7 changed files with 5369 additions and 0 deletions
32
device/testing/device-lg-us996/APKBUILD
Normal file
32
device/testing/device-lg-us996/APKBUILD
Normal file
|
@ -0,0 +1,32 @@
|
|||
# Reference: <https://postmarketos.org/devicepkg>
|
||||
# Maintainer: Uclydde <julianbraha@gmail.com>
|
||||
|
||||
pkgname=device-lg-us996
|
||||
pkgdesc="LG V20"
|
||||
pkgver=0.1
|
||||
pkgrel=0
|
||||
url="https://postmarketos.org"
|
||||
license="MIT"
|
||||
arch="aarch64"
|
||||
options="!check !archcheck"
|
||||
depends="
|
||||
linux-lg-us996
|
||||
msm-fb-refresher
|
||||
mesa-dri-swrast
|
||||
mkbootimg
|
||||
postmarketos-base
|
||||
"
|
||||
makedepends="devicepkg-dev"
|
||||
source="deviceinfo"
|
||||
|
||||
build() {
|
||||
devicepkg_build $startdir $pkgname
|
||||
}
|
||||
|
||||
package() {
|
||||
devicepkg_package $startdir $pkgname
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
8a5a1a70f111d36f66618fd3cb1470655752bc0242e99fd072d27309e41f235f734bfcf0e5a254335b637e23868c5b1a2e2169a244045107593a3f05be7926fe deviceinfo
|
||||
"
|
34
device/testing/device-lg-us996/deviceinfo
Normal file
34
device/testing/device-lg-us996/deviceinfo
Normal file
|
@ -0,0 +1,34 @@
|
|||
# Reference: <https://postmarketos.org/deviceinfo>
|
||||
# Please use double quotes only. You can source this file in shell scripts.
|
||||
|
||||
deviceinfo_format_version="0"
|
||||
deviceinfo_name="LG V20"
|
||||
deviceinfo_manufacturer="LG"
|
||||
deviceinfo_codename="lg-us996"
|
||||
deviceinfo_year="2016"
|
||||
deviceinfo_dtb=""
|
||||
deviceinfo_modules_initfs=""
|
||||
deviceinfo_arch="aarch64"
|
||||
|
||||
# Device related
|
||||
deviceinfo_chassis="handset"
|
||||
deviceinfo_keyboard="false"
|
||||
deviceinfo_external_storage="true"
|
||||
deviceinfo_screen_width="1440"
|
||||
deviceinfo_screen_height="2560"
|
||||
|
||||
# Bootloader related
|
||||
deviceinfo_flash_method="fastboot"
|
||||
deviceinfo_kernel_cmdline="console=ttyHSL0,115200,n8 androidboot.console=ttyHSL0 user_debug=31 ehci-hcd.park=3 lpm_levels.sleep_disabled=1 cma=32M@0-0xffffffff androidboot.hardware=elsa androidboot.bootdevice=624000.ufshc androidboot.selinux=permissive buildvariant=eng"
|
||||
deviceinfo_generate_bootimg="true"
|
||||
deviceinfo_bootimg_qcdt="false"
|
||||
deviceinfo_bootimg_mtk_mkimage="false"
|
||||
deviceinfo_bootimg_dtb_second="false"
|
||||
deviceinfo_flash_offset_base="0x80000000"
|
||||
deviceinfo_flash_offset_kernel="0x00008000"
|
||||
deviceinfo_flash_offset_ramdisk="0x02200000"
|
||||
deviceinfo_flash_offset_second="0x00f00000"
|
||||
deviceinfo_flash_offset_tags="0x00000100"
|
||||
deviceinfo_flash_pagesize="4096"
|
||||
|
||||
deviceinfo_rootfs_image_sector_size="4096"
|
71
device/testing/linux-lg-us996/APKBUILD
Normal file
71
device/testing/linux-lg-us996/APKBUILD
Normal file
|
@ -0,0 +1,71 @@
|
|||
# Reference: <https://postmarketos.org/vendorkernel>
|
||||
# Kernel config based on: arch/arm64/configs/lineageos_us996_defconfig
|
||||
|
||||
pkgname=linux-lg-us996
|
||||
pkgver=3.18.113
|
||||
pkgrel=0
|
||||
pkgdesc="LG V20 (us996) kernel fork"
|
||||
arch="aarch64"
|
||||
_carch="arm64"
|
||||
_flavor="lg-us996"
|
||||
url="https://kernel.org"
|
||||
license="GPL2"
|
||||
options="!strip !check !tracedeps pmb:cross-native"
|
||||
makedepends="
|
||||
perl
|
||||
sed
|
||||
installkernel
|
||||
bash
|
||||
flex
|
||||
gcc6
|
||||
gcc-armv7
|
||||
gmp-dev
|
||||
bc
|
||||
linux-headers
|
||||
elfutils-dev
|
||||
devicepkg-dev
|
||||
"
|
||||
|
||||
# Compiler: GCC 6 (doesn't boot when compiled with newer versions)
|
||||
if [ "${CC:0:5}" != "gcc6-" ]; then
|
||||
CC="gcc6-$CC"
|
||||
HOSTCC="gcc6-gcc"
|
||||
CROSS_COMPILE="gcc6-$CROSS_COMPILE"
|
||||
fi
|
||||
|
||||
# Source
|
||||
_repository="android_kernel_lge_msm8996"
|
||||
_commit="c0cf2a6e4ccceb664492ca47b8b1c9f9d4a680c2"
|
||||
_config="config-$_flavor.$arch"
|
||||
source="
|
||||
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/$_repository/archive/$_commit.tar.gz
|
||||
$_config
|
||||
gcc10-extern_YYLOC_global_declaration.patch
|
||||
fix_include_paths.patch
|
||||
vdsomunge_upstream.patch
|
||||
"
|
||||
|
||||
builddir="$srcdir/$_repository-$_commit"
|
||||
|
||||
prepare() {
|
||||
default_prepare
|
||||
. downstreamkernel_prepare
|
||||
}
|
||||
|
||||
build() {
|
||||
unset LDFLAGS
|
||||
make ARCH="$_carch" CC="${CC:-gcc}" \
|
||||
KBUILD_BUILD_VERSION="$((pkgrel + 1 ))-postmarketOS"
|
||||
}
|
||||
|
||||
package() {
|
||||
downstreamkernel_package "$builddir" "$pkgdir" "$_carch" "$_flavor"
|
||||
}
|
||||
|
||||
sha512sums="
|
||||
bc15ff2fc2f452fc3e30704c36800e029a1911d5852b113b47f48264fcf43266ad1185cc69a5e8978bb9c091b94ef36f40a607545199546e0a554269de3ae71a linux-lg-us996-c0cf2a6e4ccceb664492ca47b8b1c9f9d4a680c2.tar.gz
|
||||
762375e506ce2ef47912d874afee327781d494b4c80308633a0055f72372678c05b4ad8f999bc925c772755c41092046d49f3dd780ad656ee58029f9de4096c2 config-lg-us996.aarch64
|
||||
2b48f1bf0e3f70703d2cdafc47d5e615cc7c56c70bec56b2e3297d3fa4a7a1321d649a8679614553dde8fe52ff1051dae38d5990e3744c9ca986d92187dcdbeb gcc10-extern_YYLOC_global_declaration.patch
|
||||
531e8d26eb5a152e051d582f8e626b62299193b5099f953135ed944239a9eadab0d0cfb3c4566d3e86706d61a59dcf3b04d7760621b926e619d13944d5af387f fix_include_paths.patch
|
||||
19a6c3445bfd8057e4fabe1709f3d2344f3a99fef49b44636c07a18ba8791fab1bcff77f93aadff887946ae6f83c9d86e1c28f9b88d03c6ba156704d430b4470 vdsomunge_upstream.patch
|
||||
"
|
4886
device/testing/linux-lg-us996/config-lg-us996.aarch64
Normal file
4886
device/testing/linux-lg-us996/config-lg-us996.aarch64
Normal file
File diff suppressed because it is too large
Load diff
167
device/testing/linux-lg-us996/fix_include_paths.patch
Normal file
167
device/testing/linux-lg-us996/fix_include_paths.patch
Normal file
|
@ -0,0 +1,167 @@
|
|||
diff --git a/drivers/gpu/msm/adreno_trace.h b/drivers/gpu/msm/adreno_trace.h
|
||||
index 74c4c4e6e1fa..313f2bb0b117 100644
|
||||
--- a/drivers/gpu/msm/adreno_trace.h
|
||||
+++ b/drivers/gpu/msm/adreno_trace.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM kgsl
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/gpu/msm/
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_FILE adreno_trace
|
||||
|
||||
diff --git a/drivers/gpu/msm/kgsl_trace.h b/drivers/gpu/msm/kgsl_trace.h
|
||||
index 6438c6e65b97..088534fe7e4c 100644
|
||||
--- a/drivers/gpu/msm/kgsl_trace.h
|
||||
+++ b/drivers/gpu/msm/kgsl_trace.h
|
||||
@@ -17,7 +17,7 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM kgsl
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/gpu/msm/
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_FILE kgsl_trace
|
||||
|
||||
diff --git a/drivers/net/ethernet/msm/rndis_ipa_trace.h b/drivers/net/ethernet/msm/rndis_ipa_trace.h
|
||||
index c0fc573799f2..1e8dd9a7f282 100644
|
||||
--- a/drivers/net/ethernet/msm/rndis_ipa_trace.h
|
||||
+++ b/drivers/net/ethernet/msm/rndis_ipa_trace.h
|
||||
@@ -77,5 +77,5 @@ TRACE_EVENT(
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/net/ethernet/msm/
|
||||
#include <trace/define_trace.h>
|
||||
diff --git a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
|
||||
index a03a49a33f97..218d3e965943 100644
|
||||
--- a/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
|
||||
+++ b/drivers/platform/msm/ipa/ipa_v2/ipa_trace.h
|
||||
@@ -148,5 +148,5 @@ TRACE_EVENT(
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_v2/
|
||||
#include <trace/define_trace.h>
|
||||
diff --git a/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h b/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h
|
||||
index b67899ba894e..9e341ab1d203 100644
|
||||
--- a/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h
|
||||
+++ b/drivers/platform/msm/ipa/ipa_v3/ipa_trace.h
|
||||
@@ -149,5 +149,5 @@ TRACE_EVENT(
|
||||
|
||||
/* This part must be outside protection */
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/platform/msm/ipa/ipa_v3/
|
||||
#include <trace/define_trace.h>
|
||||
diff --git a/drivers/soc/qcom/tracer_pkt_private.h b/drivers/soc/qcom/tracer_pkt_private.h
|
||||
index fc760e6b68d1..5573aec2fe83 100644
|
||||
--- a/drivers/soc/qcom/tracer_pkt_private.h
|
||||
+++ b/drivers/soc/qcom/tracer_pkt_private.h
|
||||
@@ -15,7 +15,7 @@
|
||||
#undef TRACE_SYSTEM
|
||||
#define TRACE_SYSTEM tracer_pkt
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
-#define TRACE_INCLUDE_PATH .
|
||||
+#define TRACE_INCLUDE_PATH ../../drivers/soc/qcom/
|
||||
#undef TRACE_INCLUDE_FILE
|
||||
#define TRACE_INCLUDE_FILE tracer_pkt_private
|
||||
diff --git a/drivers/nfc/pn548/pn548.c b/drivers/nfc/pn548/pn548.c
|
||||
index dca56a309437..b5f1462e34c2 100644
|
||||
--- a/drivers/nfc/pn548/pn548.c
|
||||
+++ b/drivers/nfc/pn548/pn548.c
|
||||
@@ -40,7 +40,7 @@
|
||||
#include <linux/wakelock.h>
|
||||
#include <linux/kthread.h>
|
||||
|
||||
-#include <pn548.h>
|
||||
+#include "pn548.h"
|
||||
|
||||
#define MAX_BUFFER_SIZE 512
|
||||
#define _A1_PN66T_
|
||||
diff --git a/include/trace/events/msm_cam.h b/include/trace/events/msm_cam.h
|
||||
index 9a5dd158b4b8..4c1b4659e91e 100644
|
||||
--- a/include/trace/events/msm_cam.h
|
||||
+++ b/include/trace/events/msm_cam.h
|
||||
@@ -16,7 +16,7 @@
|
||||
#if !defined(_TRACE_MSM_VFE_H) || defined(TRACE_HEADER_MULTI_READ)
|
||||
#define _TRACE_MSM_VFE_H
|
||||
|
||||
-#include "msm_isp.h"
|
||||
+#include "../../uapi/media/msm_isp.h"
|
||||
#include <linux/types.h>
|
||||
#include <linux/tracepoint.h>
|
||||
|
||||
diff --git a/sound/soc/msm/apq8096-auto.c b/sound/soc/msm/apq8096-auto.c
|
||||
index 2ae78f75c340..62dd641aa79f 100644
|
||||
--- a/sound/soc/msm/apq8096-auto.c
|
||||
+++ b/sound/soc/msm/apq8096-auto.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <sound/q6core.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/info.h>
|
||||
-#include <device_event.h>
|
||||
+#include "device_event.h"
|
||||
#include "qdsp6v2/msm-pcm-routing-v2.h"
|
||||
|
||||
#define DRV_NAME "apq8096-auto-asoc-snd"
|
||||
diff --git a/sound/soc/msm/apq8096-i2c.c b/sound/soc/msm/apq8096-i2c.c
|
||||
index 8bcda764af09..8d50c6d79605 100644
|
||||
--- a/sound/soc/msm/apq8096-i2c.c
|
||||
+++ b/sound/soc/msm/apq8096-i2c.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <sound/q6core.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/info.h>
|
||||
-#include <device_event.h>
|
||||
+#include "device_event.h"
|
||||
#include "qdsp6v2/msm-pcm-routing-v2.h"
|
||||
#include "../codecs/wcd9xxx-common.h"
|
||||
#include "../codecs/wcd9330.h"
|
||||
diff --git a/sound/soc/msm/mdm9650.c b/sound/soc/msm/mdm9650.c
|
||||
index ee469f10b78a..9c4c90e84134 100644
|
||||
--- a/sound/soc/msm/mdm9650.c
|
||||
+++ b/sound/soc/msm/mdm9650.c
|
||||
@@ -26,7 +26,7 @@
|
||||
#include <sound/q6afe-v2.h>
|
||||
#include <sound/info.h>
|
||||
#include <sound/pcm_params.h>
|
||||
-#include <device_event.h>
|
||||
+#include "device_event.h"
|
||||
#include <soc/qcom/socinfo.h>
|
||||
#include <qdsp6v2/msm-pcm-routing-v2.h>
|
||||
#include <sound/q6core.h>
|
||||
diff --git a/sound/soc/msm/msm8996.c b/sound/soc/msm/msm8996.c
|
||||
index 1e051b12065a..c135f7b6b86c 100644
|
||||
--- a/sound/soc/msm/msm8996.c
|
||||
+++ b/sound/soc/msm/msm8996.c
|
||||
@@ -31,7 +31,7 @@
|
||||
#include <sound/q6core.h>
|
||||
#include <sound/pcm_params.h>
|
||||
#include <sound/info.h>
|
||||
-#include <device_event.h>
|
||||
+#include "device_event.h"
|
||||
#include "qdsp6v2/msm-pcm-routing-v2.h"
|
||||
#include "../codecs/wcd9xxx-common.h"
|
||||
#include "../codecs/wcd9330.h"
|
||||
|
||||
diff --git a/drivers/platform/msm/mhi/mhi_ssr.c b/drivers/platform/msm/mhi/mhi_ssr.c
|
||||
index f4f2e427972f..1c3f305c2144 100644
|
||||
--- a/drivers/platform/msm/mhi/mhi_ssr.c
|
||||
+++ b/drivers/platform/msm/mhi/mhi_ssr.c
|
||||
@@ -11,8 +11,8 @@
|
||||
*/
|
||||
|
||||
#include <linux/pm_runtime.h>
|
||||
-#include <mhi_sys.h>
|
||||
-#include <mhi.h>
|
||||
+#include "mhi_sys.h"
|
||||
+#include "mhi.h"
|
||||
#include <soc/qcom/subsystem_restart.h>
|
||||
#include <soc/qcom/subsystem_notif.h>
|
||||
#include <linux/esoc_client.h>
|
||||
--
|
||||
2.24.1
|
|
@ -0,0 +1 @@
|
|||
../../.shared-patches/linux/gcc10-extern_YYLOC_global_declaration.patch
|
178
device/testing/linux-lg-us996/vdsomunge_upstream.patch
Normal file
178
device/testing/linux-lg-us996/vdsomunge_upstream.patch
Normal file
|
@ -0,0 +1,178 @@
|
|||
Fixes compilation under gcc8 without glibc
|
||||
---
|
||||
diff --git a/arch/arm/vdso/vdsomunge.c b/arch/arm/vdso/vdsomunge.c
|
||||
index 9005b07296c8..f6455273b2f8 100644
|
||||
--- a/arch/arm/vdso/vdsomunge.c
|
||||
+++ b/arch/arm/vdso/vdsomunge.c
|
||||
@@ -45,13 +45,10 @@
|
||||
* it does.
|
||||
*/
|
||||
|
||||
-#define _GNU_SOURCE
|
||||
-
|
||||
-#include <byteswap.h>
|
||||
#include <elf.h>
|
||||
#include <errno.h>
|
||||
-#include <error.h>
|
||||
#include <fcntl.h>
|
||||
+#include <stdarg.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
@@ -61,6 +58,16 @@
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
|
||||
+#define swab16(x) \
|
||||
+ ((((x) & 0x00ff) << 8) | \
|
||||
+ (((x) & 0xff00) >> 8))
|
||||
+
|
||||
+#define swab32(x) \
|
||||
+ ((((x) & 0x000000ff) << 24) | \
|
||||
+ (((x) & 0x0000ff00) << 8) | \
|
||||
+ (((x) & 0x00ff0000) >> 8) | \
|
||||
+ (((x) & 0xff000000) >> 24))
|
||||
+
|
||||
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||
#define HOST_ORDER ELFDATA2LSB
|
||||
#elif __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||
@@ -82,27 +89,41 @@
|
||||
#define EF_ARM_ABI_FLOAT_HARD 0x400
|
||||
#endif
|
||||
|
||||
+static int failed;
|
||||
+static const char *argv0;
|
||||
static const char *outfile;
|
||||
|
||||
+static void fail(const char *fmt, ...)
|
||||
+{
|
||||
+ va_list ap;
|
||||
+
|
||||
+ failed = 1;
|
||||
+ fprintf(stderr, "%s: ", argv0);
|
||||
+ va_start(ap, fmt);
|
||||
+ vfprintf(stderr, fmt, ap);
|
||||
+ va_end(ap);
|
||||
+ exit(EXIT_FAILURE);
|
||||
+}
|
||||
+
|
||||
static void cleanup(void)
|
||||
{
|
||||
- if (error_message_count > 0 && outfile != NULL)
|
||||
+ if (failed && outfile != NULL)
|
||||
unlink(outfile);
|
||||
}
|
||||
|
||||
static Elf32_Word read_elf_word(Elf32_Word word, bool swap)
|
||||
{
|
||||
- return swap ? bswap_32(word) : word;
|
||||
+ return swap ? swab32(word) : word;
|
||||
}
|
||||
|
||||
static Elf32_Half read_elf_half(Elf32_Half half, bool swap)
|
||||
{
|
||||
- return swap ? bswap_16(half) : half;
|
||||
+ return swap ? swab16(half) : half;
|
||||
}
|
||||
|
||||
static void write_elf_word(Elf32_Word val, Elf32_Word *dst, bool swap)
|
||||
{
|
||||
- *dst = swap ? bswap_32(val) : val;
|
||||
+ *dst = swap ? swab32(val) : val;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
@@ -119,68 +140,66 @@ int main(int argc, char **argv)
|
||||
int infd;
|
||||
|
||||
atexit(cleanup);
|
||||
+ argv0 = argv[0];
|
||||
|
||||
if (argc != 3)
|
||||
- error(EXIT_FAILURE, 0, "Usage: %s [infile] [outfile]", argv[0]);
|
||||
+ fail("Usage: %s [infile] [outfile]\n", argv[0]);
|
||||
|
||||
infile = argv[1];
|
||||
outfile = argv[2];
|
||||
|
||||
infd = open(infile, O_RDONLY);
|
||||
if (infd < 0)
|
||||
- error(EXIT_FAILURE, errno, "Cannot open %s", infile);
|
||||
+ fail("Cannot open %s: %s\n", infile, strerror(errno));
|
||||
|
||||
if (fstat(infd, &stat) != 0)
|
||||
- error(EXIT_FAILURE, errno, "Failed stat for %s", infile);
|
||||
+ fail("Failed stat for %s: %s\n", infile, strerror(errno));
|
||||
|
||||
inbuf = mmap(NULL, stat.st_size, PROT_READ, MAP_PRIVATE, infd, 0);
|
||||
if (inbuf == MAP_FAILED)
|
||||
- error(EXIT_FAILURE, errno, "Failed to map %s", infile);
|
||||
+ fail("Failed to map %s: %s\n", infile, strerror(errno));
|
||||
|
||||
close(infd);
|
||||
|
||||
inhdr = inbuf;
|
||||
|
||||
if (memcmp(&inhdr->e_ident, ELFMAG, SELFMAG) != 0)
|
||||
- error(EXIT_FAILURE, 0, "Not an ELF file");
|
||||
+ fail("Not an ELF file\n");
|
||||
|
||||
if (inhdr->e_ident[EI_CLASS] != ELFCLASS32)
|
||||
- error(EXIT_FAILURE, 0, "Unsupported ELF class");
|
||||
+ fail("Unsupported ELF class\n");
|
||||
|
||||
swap = inhdr->e_ident[EI_DATA] != HOST_ORDER;
|
||||
|
||||
if (read_elf_half(inhdr->e_type, swap) != ET_DYN)
|
||||
- error(EXIT_FAILURE, 0, "Not a shared object");
|
||||
+ fail("Not a shared object\n");
|
||||
|
||||
- if (read_elf_half(inhdr->e_machine, swap) != EM_ARM) {
|
||||
- error(EXIT_FAILURE, 0, "Unsupported architecture %#x",
|
||||
- inhdr->e_machine);
|
||||
- }
|
||||
+ if (read_elf_half(inhdr->e_machine, swap) != EM_ARM)
|
||||
+ fail("Unsupported architecture %#x\n", inhdr->e_machine);
|
||||
|
||||
e_flags = read_elf_word(inhdr->e_flags, swap);
|
||||
|
||||
if (EF_ARM_EABI_VERSION(e_flags) != EF_ARM_EABI_VER5) {
|
||||
- error(EXIT_FAILURE, 0, "Unsupported EABI version %#x",
|
||||
- EF_ARM_EABI_VERSION(e_flags));
|
||||
+ fail("Unsupported EABI version %#x\n",
|
||||
+ EF_ARM_EABI_VERSION(e_flags));
|
||||
}
|
||||
|
||||
if (e_flags & EF_ARM_ABI_FLOAT_HARD)
|
||||
- error(EXIT_FAILURE, 0,
|
||||
- "Unexpected hard-float flag set in e_flags");
|
||||
+ fail("Unexpected hard-float flag set in e_flags\n");
|
||||
|
||||
clear_soft_float = !!(e_flags & EF_ARM_ABI_FLOAT_SOFT);
|
||||
|
||||
outfd = open(outfile, O_RDWR | O_CREAT | O_TRUNC, S_IRUSR | S_IWUSR);
|
||||
if (outfd < 0)
|
||||
- error(EXIT_FAILURE, errno, "Cannot open %s", outfile);
|
||||
+ fail("Cannot open %s: %s\n", outfile, strerror(errno));
|
||||
|
||||
if (ftruncate(outfd, stat.st_size) != 0)
|
||||
- error(EXIT_FAILURE, errno, "Cannot truncate %s", outfile);
|
||||
+ fail("Cannot truncate %s: %s\n", outfile, strerror(errno));
|
||||
|
||||
outbuf = mmap(NULL, stat.st_size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
outfd, 0);
|
||||
if (outbuf == MAP_FAILED)
|
||||
- error(EXIT_FAILURE, errno, "Failed to map %s", outfile);
|
||||
+ fail("Failed to map %s: %s\n", outfile, strerror(errno));
|
||||
|
||||
close(outfd);
|
||||
|
||||
@@ -195,7 +214,7 @@ int main(int argc, char **argv)
|
||||
}
|
||||
|
||||
if (msync(outbuf, stat.st_size, MS_SYNC) != 0)
|
||||
- error(EXIT_FAILURE, errno, "Failed to sync %s", outfile);
|
||||
+ fail("Failed to sync %s: %s\n", outfile, strerror(errno));
|
||||
|
||||
return EXIT_SUCCESS;
|
||||
}
|
Loading…
Reference in a new issue