All of lore.kernel.org
 help / color / mirror / Atom feed
* [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options
@ 2013-05-07 12:51 Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step Sven Eckelmann
                   ` (8 more replies)
  0 siblings, 9 replies; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

Hi,

I was talking with Marek and Simon about build options which may be size
relevant. The first change is to allow the linker to check for unused code
sections. The second change is to let the compiler use get the whole source
code instead of only one source file during the final compilation step (ok,
it is originally the link step).

These changes reduce the size on an amd64 (default Debian settings with -O2) by
around 25%. The size reduction on MIPSel (default OpenWRT settings with -Os)
were only by 6%-10%. Marek were still interested and asked me to submit the
changes.

Kind regards,
	Sven

^ permalink raw reply	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-14  9:41   ` Simon Wunderlich
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 2/9] batctl: " Sven Eckelmann
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.

Option which need this are for example -fPIC/-fPIE or -flto.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile     | 2 +-
 vis/Makefile | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 268a156..aeee2e8 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ RM ?= rm -f
 INSTALL ?= install
 MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
 
 # standard install paths
 PREFIX = /usr/local
diff --git a/vis/Makefile b/vis/Makefile
index 5ec0423..8585f9a 100644
--- a/vis/Makefile
+++ b/vis/Makefile
@@ -42,7 +42,7 @@ RM ?= rm -f
 INSTALL ?= install
 MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
 
 # standard install paths
 PREFIX = /usr/local
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 2/9] batctl: Add CFLAGS to the linker step
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-08  5:04   ` Marek Lindner
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 3/9] batmand: " Sven Eckelmann
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.

Option which need this are for example -fPIC/-fPIE or -flto.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 61b24c6..1961298 100755
--- a/Makefile
+++ b/Makefile
@@ -53,7 +53,7 @@ RM ?= rm -f
 INSTALL ?= install
 MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
 
 # standard install paths
 PREFIX = /usr/local
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 3/9] batmand: Add CFLAGS to the linker step
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 2/9] batctl: " Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 4/9] vis: " Sven Eckelmann
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.

Option which need this are for example -fPIC/-fPIE or -flto.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index ce1e198..721f20b 100755
--- a/Makefile
+++ b/Makefile
@@ -57,7 +57,7 @@ RM ?= rm -f
 INSTALL ?= install
 MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
 
 # standard install paths
 PREFIX = /usr/local
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 4/9] vis: Add CFLAGS to the linker step
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (2 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 3/9] batmand: " Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size Sven Eckelmann
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The GCC manual states for different parameters that the options for compilation
must also be used when linking. The options for compilation are stored in
CFLAGS and added to LINK.o to fix the behavior.

Option which need this are for example -fPIC/-fPIE or -flto.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index c4220f5..0d49c7e 100755
--- a/Makefile
+++ b/Makefile
@@ -43,7 +43,7 @@ RM ?= rm -f
 INSTALL ?= install
 MKDIR ?= mkdir -p
 COMPILE.c = $(Q_CC)$(CC) $(CFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
-LINK.o = $(Q_LD)$(CC) $(LDFLAGS) $(TARGET_ARCH)
+LINK.o = $(Q_LD)$(CC) $(CFLAGS) $(LDFLAGS) $(TARGET_ARCH)
 
 # standard install paths
 PREFIX = /usr/local
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (3 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 4/9] vis: " Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-14  9:44   ` Simon Wunderlich
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization Sven Eckelmann
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The linker can identify unused sections of a binary when each symbol is stored
in a separate section. This mostly removes the unused debugfs function and
reduces the size by ~5% on mipsel.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 alfred/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/alfred/Makefile b/alfred/Makefile
index 4578c3b..ab19325 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -44,6 +44,9 @@ endef
 MAKE_ALFRED_FLAGS=\
 	CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n)
 
+TARGET_CFLAGS  += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
 define Build/Compile
 	CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
 	LDFLAGS="$(TARGET_LDFLAGS)" \
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (4 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-14  9:45   ` Simon Wunderlich
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile Sven Eckelmann
                   ` (2 subsequent siblings)
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

Link-time optimization allows to move parts of the optimization from the single
source file to the global source view. This is done by emitting the GIMPLE
representation in each object file and analyzing it again during the link step.

This reduces the binary size by around 10% on mipsel (this includes parts which
were also removed by garbage collection).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 alfred/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/alfred/Makefile b/alfred/Makefile
index ab19325..2656d1c 100644
--- a/alfred/Makefile
+++ b/alfred/Makefile
@@ -44,8 +44,8 @@ endef
 MAKE_ALFRED_FLAGS=\
 	CONFIG_ALFRED_VIS=$(if $(CONFIG_PACKAGE_ALFRED_VIS),y,n)
 
-TARGET_CFLAGS  += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS  += -ffunction-sections -fdata-sections -flto
+TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin
 
 define Build/Compile
 	CFLAGS="$(TARGET_CPPFLAGS) $(TARGET_CFLAGS)" \
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (5 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-08  5:11   ` Marek Lindner
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size Sven Eckelmann
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization Sven Eckelmann
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The compilation step of batctl completely dropped the TARGET_CFLAGS,
TARGET_CPPFLAGS and TARGET_LDFLAGS and therefore weren't compiled and linked
with the flags given by the OpenWRT build environment.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 batman-adv-devel/Makefile | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index 0958f38..b9e2650 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -85,7 +85,9 @@ $(eval $(call Download,batctl))
 
 BATCTL_EXTRACT = tar xzf "$(DL_DIR)/$(PKG_BATCTL_FNAME)" -C "$(BUILD_DIR)/$(PKG_NAME)"
 BATCTL_PATCH = $(call Build/DoPatch,"$(PKG_BATCTL_BUILD_DIR)","$(PATCH_DIR)","*batctl*")
-BATCTL_BUILD = $(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
+BATCTL_BUILD =	CPPFLAGS="$(TARGET_CPPFLAGS)" CFLAGS="$(TARGET_CFLAGS)" \
+		LDFLAGS="$(TARGET_LDFLAGS)" \
+		$(MAKE) -C $(PKG_BATCTL_BUILD_DIR) $(MAKE_BATCTL_ARGS)
 BATCTL_INSTALL = $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/local/sbin/batctl $(1)/usr/sbin/
 endif
 
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (6 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-12  8:20   ` Marek Lindner
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization Sven Eckelmann
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

The linker can identify unused sections of a binary when each symbol is stored
in a separate section. This mostly removes unused linker sections and reduces
the size by ~3% on mipsel.

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 batman-adv-devel/Makefile | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index b9e2650..6dc66b8 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -76,6 +76,9 @@ MAKE_BATCTL_ARGS += \
 	STRIP="/bin/true" \
 	batctl install
 
+TARGET_CFLAGS  += -ffunction-sections -fdata-sections
+TARGET_LDFLAGS += -Wl,--gc-sections
+
 ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL),)
 define Download/batctl
   FILE:=$(PKG_BATCTL_FNAME)
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization
  2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
                   ` (7 preceding siblings ...)
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size Sven Eckelmann
@ 2013-05-07 12:51 ` Sven Eckelmann
  2013-05-12  8:21   ` Marek Lindner
  8 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-07 12:51 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

Link-time optimization allows to move parts of the optimization from the single
source file to the global source view. This is done by emitting the GIMPLE
representation in each object file and analyzing it again during the link step.

This reduces the binary size by around 6% on mipsel (this includes parts which
were also removed by garbage collection).

Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
 batman-adv-devel/Makefile | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/batman-adv-devel/Makefile b/batman-adv-devel/Makefile
index 6dc66b8..cad95c6 100644
--- a/batman-adv-devel/Makefile
+++ b/batman-adv-devel/Makefile
@@ -76,8 +76,8 @@ MAKE_BATCTL_ARGS += \
 	STRIP="/bin/true" \
 	batctl install
 
-TARGET_CFLAGS  += -ffunction-sections -fdata-sections
-TARGET_LDFLAGS += -Wl,--gc-sections
+TARGET_CFLAGS  += -ffunction-sections -fdata-sections -flto
+TARGET_LDFLAGS += -Wl,--gc-sections -fuse-linker-plugin
 
 ifneq ($(DEVELOPER)$(CONFIG_KMOD_BATMAN_ADV_DEVEL_BATCTL),)
 define Download/batctl
-- 
1.8.2.1


^ permalink raw reply related	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 2/9] batctl: Add CFLAGS to the linker step
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 2/9] batctl: " Sven Eckelmann
@ 2013-05-08  5:04   ` Marek Lindner
  0 siblings, 0 replies; 19+ messages in thread
From: Marek Lindner @ 2013-05-08  5:04 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

On Tuesday, May 07, 2013 20:51:02 Sven Eckelmann wrote:
> The GCC manual states for different parameters that the options for
> compilation must also be used when linking. The options for compilation
> are stored in CFLAGS and added to LINK.o to fix the behavior.
> 
> Option which need this are for example -fPIC/-fPIE or -flto.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  Makefile | 2 +-

Applied in revision b80d07f.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile Sven Eckelmann
@ 2013-05-08  5:11   ` Marek Lindner
  2013-05-08  7:24     ` Sven Eckelmann
  0 siblings, 1 reply; 19+ messages in thread
From: Marek Lindner @ 2013-05-08  5:11 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

On Tuesday, May 07, 2013 20:51:07 Sven Eckelmann wrote:
> The compilation step of batctl completely dropped the TARGET_CFLAGS,
> TARGET_CPPFLAGS and TARGET_LDFLAGS and therefore weren't compiled and
> linked with the flags given by the OpenWRT build environment.

It seems you missed the meaning of MAKE_BATCTL_ARGS ? This variable contains 
TARGET_CFLAGS already. We apparently are missing TARGET_CPPFLAGS and 
TARGET_LDFLAGS. Do you want to resend and make the necessary changes to 
MAKE_BATCTL_ARGS ?

Cheers,
Marek

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile
  2013-05-08  5:11   ` Marek Lindner
@ 2013-05-08  7:24     ` Sven Eckelmann
  2013-05-12  7:52       ` Marek Lindner
  0 siblings, 1 reply; 19+ messages in thread
From: Sven Eckelmann @ 2013-05-08  7:24 UTC (permalink / raw)
  To: Marek Lindner; +Cc: b.a.t.m.a.n

[-- Attachment #1: Type: text/plain, Size: 873 bytes --]

On Wednesday 08 May 2013 13:11:57 Marek Lindner wrote:
> On Tuesday, May 07, 2013 20:51:07 Sven Eckelmann wrote:
> > The compilation step of batctl completely dropped the TARGET_CFLAGS,
> > TARGET_CPPFLAGS and TARGET_LDFLAGS and therefore weren't compiled and
> > linked with the flags given by the OpenWRT build environment.
> 
> It seems you missed the meaning of MAKE_BATCTL_ARGS ? This variable contains
> TARGET_CFLAGS already. We apparently are missing TARGET_CPPFLAGS and
> TARGET_LDFLAGS. Do you want to resend and make the necessary changes to
> MAKE_BATCTL_ARGS ?

I didn't felt like fixing your other problems too, but sent two other patches 
resolving the MAKE_BATCTL_ARGS problem. See 
[Bonus-PATCH 10/9] batman-adv-devel: Don't overwrite batctl's CFLAGS
[Bonus-PATCH 11/9] batman-adv-devel: Remove unused parameters from 
MAKE_BATCTL_ARGS

Kind regards,
	Sven

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile
  2013-05-08  7:24     ` Sven Eckelmann
@ 2013-05-12  7:52       ` Marek Lindner
  0 siblings, 0 replies; 19+ messages in thread
From: Marek Lindner @ 2013-05-12  7:52 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

On Wednesday, May 08, 2013 15:24:50 Sven Eckelmann wrote:
> On Wednesday 08 May 2013 13:11:57 Marek Lindner wrote:
> > On Tuesday, May 07, 2013 20:51:07 Sven Eckelmann wrote:
> > > The compilation step of batctl completely dropped the TARGET_CFLAGS,
> > > TARGET_CPPFLAGS and TARGET_LDFLAGS and therefore weren't compiled and
> > > linked with the flags given by the OpenWRT build environment.
> > 
> > It seems you missed the meaning of MAKE_BATCTL_ARGS ? This variable
> > contains TARGET_CFLAGS already. We apparently are missing
> > TARGET_CPPFLAGS and TARGET_LDFLAGS. Do you want to resend and make the
> > necessary changes to MAKE_BATCTL_ARGS ?
> 
> I didn't felt like fixing your other problems too, but sent two other
> patches resolving the MAKE_BATCTL_ARGS problem. See
> [Bonus-PATCH 10/9] batman-adv-devel: Don't overwrite batctl's CFLAGS
> [Bonus-PATCH 11/9] batman-adv-devel: Remove unused parameters from
> MAKE_BATCTL_ARGS

Applied with minor modifications in revision f41a85c.

Thanks for the explanations as to why that is helpful.

Thanks,
Marek



^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size Sven Eckelmann
@ 2013-05-12  8:20   ` Marek Lindner
  0 siblings, 0 replies; 19+ messages in thread
From: Marek Lindner @ 2013-05-12  8:20 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

On Tuesday, May 07, 2013 20:51:08 Sven Eckelmann wrote:
> The linker can identify unused sections of a binary when each symbol is
> stored in a separate section. This mostly removes unused linker sections
> and reduces the size by ~3% on mipsel.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  batman-adv-devel/Makefile | 3 +++
>  1 file changed, 3 insertions(+)

Applied in revision 3e056f3.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization Sven Eckelmann
@ 2013-05-12  8:21   ` Marek Lindner
  0 siblings, 0 replies; 19+ messages in thread
From: Marek Lindner @ 2013-05-12  8:21 UTC (permalink / raw)
  To: b.a.t.m.a.n; +Cc: Sven Eckelmann

On Tuesday, May 07, 2013 20:51:09 Sven Eckelmann wrote:
> Link-time optimization allows to move parts of the optimization from the
> single source file to the global source view. This is done by emitting the
> GIMPLE representation in each object file and analyzing it again during
> the link step.
> 
> This reduces the binary size by around 6% on mipsel (this includes parts
> which were also removed by garbage collection).
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  batman-adv-devel/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Applied in revision e25de79.

Thanks,
Marek

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step Sven Eckelmann
@ 2013-05-14  9:41   ` Simon Wunderlich
  0 siblings, 0 replies; 19+ messages in thread
From: Simon Wunderlich @ 2013-05-14  9:41 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Sven Eckelmann

[-- Attachment #1: Type: text/plain, Size: 561 bytes --]

On Tue, May 07, 2013 at 02:51:01PM +0200, Sven Eckelmann wrote:
> The GCC manual states for different parameters that the options for compilation
> must also be used when linking. The options for compilation are stored in
> CFLAGS and added to LINK.o to fix the behavior.
> 
> Option which need this are for example -fPIC/-fPIE or -flto.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  Makefile     | 2 +-
>  vis/Makefile | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)

Applied in revision c693d67.

Thanks,
	Simon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size Sven Eckelmann
@ 2013-05-14  9:44   ` Simon Wunderlich
  0 siblings, 0 replies; 19+ messages in thread
From: Simon Wunderlich @ 2013-05-14  9:44 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Sven Eckelmann

[-- Attachment #1: Type: text/plain, Size: 465 bytes --]

On Tue, May 07, 2013 at 02:51:05PM +0200, Sven Eckelmann wrote:
> The linker can identify unused sections of a binary when each symbol is stored
> in a separate section. This mostly removes the unused debugfs function and
> reduces the size by ~5% on mipsel.
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  alfred/Makefile | 3 +++
>  1 file changed, 3 insertions(+)

Applied in revision fa23641 (alfred package feed).

Thanks,
	Simon

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization
  2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization Sven Eckelmann
@ 2013-05-14  9:45   ` Simon Wunderlich
  0 siblings, 0 replies; 19+ messages in thread
From: Simon Wunderlich @ 2013-05-14  9:45 UTC (permalink / raw)
  To: The list for a Better Approach To Mobile Ad-hoc Networking; +Cc: Sven Eckelmann

[-- Attachment #1: Type: text/plain, Size: 667 bytes --]

On Tue, May 07, 2013 at 02:51:06PM +0200, Sven Eckelmann wrote:
> Link-time optimization allows to move parts of the optimization from the single
> source file to the global source view. This is done by emitting the GIMPLE
> representation in each object file and analyzing it again during the link step.
> 
> This reduces the binary size by around 10% on mipsel (this includes parts which
> were also removed by garbage collection).
> 
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
>  alfred/Makefile | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
Applied in revision bbc581c (alfred package feed).

Thanks,
    Simon


[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2013-05-14  9:45 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-05-07 12:51 [B.A.T.M.A.N.] [PATCH 0/9] Adding size relevant build options Sven Eckelmann
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 1/9] alfred: Add CFLAGS to the linker step Sven Eckelmann
2013-05-14  9:41   ` Simon Wunderlich
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 2/9] batctl: " Sven Eckelmann
2013-05-08  5:04   ` Marek Lindner
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 3/9] batmand: " Sven Eckelmann
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 4/9] vis: " Sven Eckelmann
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] alfred: Use section garbage collection to reduce binary size Sven Eckelmann
2013-05-14  9:44   ` Simon Wunderlich
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 6/9] alfred: Enable Link-time optimization Sven Eckelmann
2013-05-14  9:45   ` Simon Wunderlich
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 7/9] batman-adv-devel: Add missing TARGET_* flags to batctl compile Sven Eckelmann
2013-05-08  5:11   ` Marek Lindner
2013-05-08  7:24     ` Sven Eckelmann
2013-05-12  7:52       ` Marek Lindner
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 8/9] batman-adv-devel: Use section garbage collection to reduce binary size Sven Eckelmann
2013-05-12  8:20   ` Marek Lindner
2013-05-07 12:51 ` [B.A.T.M.A.N.] [PATCH 5/9] batman-adv-devel: Enable Link-time optimization Sven Eckelmann
2013-05-12  8:21   ` Marek Lindner

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.