aboutsummaryrefslogtreecommitdiffstats
path: root/package/boot/kexec-tools
diff options
context:
space:
mode:
authorFelix Fietkau <nbd@openwrt.org>2013-06-28 11:27:16 +0000
committerFelix Fietkau <nbd@openwrt.org>2013-06-28 11:27:16 +0000
commit6a1c210ea78738d971b8fd9b99fa91bb177297bd (patch)
tree78b575ee74f83daf1a27607add4f2f895d29d17d /package/boot/kexec-tools
parent4dc34e5cc4df6c1bb2974d0903c8053a0cb87598 (diff)
downloadmaster-187ad058-6a1c210ea78738d971b8fd9b99fa91bb177297bd.tar.gz
master-187ad058-6a1c210ea78738d971b8fd9b99fa91bb177297bd.tar.bz2
master-187ad058-6a1c210ea78738d971b8fd9b99fa91bb177297bd.zip
kexec-tools: reduce size
Signed-off-by: Felix Fietkau <nbd@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@37072 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/boot/kexec-tools')
-rw-r--r--package/boot/kexec-tools/Makefile3
-rw-r--r--package/boot/kexec-tools/patches/100-reduce_size.patch36
2 files changed, 39 insertions, 0 deletions
diff --git a/package/boot/kexec-tools/Makefile b/package/boot/kexec-tools/Makefile
index 541dca275a..40ba9eb525 100644
--- a/package/boot/kexec-tools/Makefile
+++ b/package/boot/kexec-tools/Makefile
@@ -56,6 +56,9 @@ CONFIGURE_ARGS = \
--sysconfdir=/etc \
$(if $(CONFIG_KEXEC_ZLIB),--with,--without)-zlib
+TARGET_CFLAGS += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
CONFIGURE_VARS += \
BUILD_CC="$(HOSTCC)" \
TARGET_CC="$(TARGET_CC)"
diff --git a/package/boot/kexec-tools/patches/100-reduce_size.patch b/package/boot/kexec-tools/patches/100-reduce_size.patch
new file mode 100644
index 0000000000..eafca7bf20
--- /dev/null
+++ b/package/boot/kexec-tools/patches/100-reduce_size.patch
@@ -0,0 +1,36 @@
+--- a/kexec/crashdump-xen.c
++++ b/kexec/crashdump-xen.c
+@@ -111,6 +111,7 @@ static int xen_detect_pv_guest(void)
+ * This includes dom0, which is the only PV guest where kexec/kdump works.
+ * HVM guests have to be handled as native hardware.
+ */
++#if defined(__i386__) || defined(__x86_64__)
+ int xen_present(void)
+ {
+ if (!is_dom0) {
+@@ -121,6 +122,7 @@ int xen_present(void)
+ }
+ return is_dom0 > 0;
+ }
++#endif
+
+ unsigned long xen_architecture(struct crash_elf_info *elf_info)
+ {
+--- a/kexec/crashdump.h
++++ b/kexec/crashdump.h
+@@ -56,7 +56,15 @@ unsigned long crash_architecture(struct
+ unsigned long phys_to_virt(struct crash_elf_info *elf_info,
+ unsigned long paddr);
+
++#if defined(__i386__) || defined(__x86_64__)
+ int xen_present(void);
++#else
++static inline int xen_present(void)
++{
++ return 0;
++}
++#endif
++
+ unsigned long xen_architecture(struct crash_elf_info *elf_info);
+ int xen_get_nr_phys_cpus(void);
+ int xen_get_note(int cpu, uint64_t *addr, uint64_t *len);