Skip to contentSkip to conversation

uclibc: respect top-level TARGET_CFLAGS

PATCH New Alexey Brodkin 4 participants 9 messages Nov 6, 2014 – Nov 11, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

Cc Anton Kolesov <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Vicente Olivert Riera <[email protected]>
---
 package/uclibc/uclibc.mk | 2 ++
 1 file changed, 2 insertions(+)
package/uclibc/uclibc.mk +2 -0
index ce416dd..419a4d1 100644
@@ -24,6 +24,8 @@ endif
 
 UCLIBC_INSTALL_STAGING = YES
 
+UCLIBC_EXTRA_CFLAGS = $(TARGET_CFLAGS)
+
 # uclibc is part of the toolchain so disable the toolchain dependency
 UCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
 
Signature · 1 line
1.9.3
#1 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Hi Alexey,

Quoted 6 lines · Alexey Brodkin

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

Quoted 7 lines
Cc Anton Kolesov <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Vicente Olivert Riera <[email protected]>

Have you actually CCed all these addresses? I only see Thomas in the Cc:
header, besides you.

baruch

Quoted 16 lines
---
 package/uclibc/uclibc.mk | 2 ++
 1 file changed, 2 insertions(+)
package/uclibc/uclibc.mk +2 -0
index ce416dd..419a4d1 100644
@@ -24,6 +24,8 @@ endif
 
 UCLIBC_INSTALL_STAGING = YES
 
+UCLIBC_EXTRA_CFLAGS = $(TARGET_CFLAGS)
+
 # uclibc is part of the toolchain so disable the toolchain dependency
 UCLIBC_ADD_TOOLCHAIN_DEPENDENCY = NO
Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#2 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Hi Baruch,

Quoted 11 lines · Baruch Siach

Hi Alexey,

Quoted 8 lines · Alexey Brodkin

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

Quoted 8 lines
Quoted 5 lines
Cc Anton Kolesov <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Vicente Olivert Riera <[email protected]>

Have you actually CCed all these addresses? I only see Thomas in the Cc:
header, besides you.

That's why I add "Cc:" in commit message.
Because "git send-email" automatically adds mentioned addresses to CC.

That's an extract of "git send-email" log:
--->---
MAIL FROM:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
RCPT TO:<[email protected]>
From: Alexey Brodkin <[email protected]>
To: buildroot at buildroot.org
Cc: Alexey Brodkin <[email protected]>,
Anton Kolesov <[email protected]>,
Thomas Petazzoni <[email protected]>, Peter Korsgaard <[email protected]>,
Gustavo Zacarias <[email protected]>, Vicente Olivert Riera <[email protected]>
Subject: [PATCH] uclibc: respect top-level TARGET_CFLAGS
Date: Thu, 6 Nov 2014 14:47:22 +0300
Message-Id: <[email protected]>
X-Mailer: git-send-email 1.9.3
--->---

-Alexey

#3 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Hi Alexey,

Quoted 16 lines · Alexey Brodkin
Quoted 15 lines · Baruch Siach
Quoted 13 lines · Alexey Brodkin

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

Cc Anton Kolesov <[email protected]>
Cc Thomas Petazzoni <[email protected]>
Cc Peter Korsgaard <[email protected]>
Cc Gustavo Zacarias <[email protected]>
Cc Vicente Olivert Riera <[email protected]>
Quoted 5 lines
Quoted 2 lines

Have you actually CCed all these addresses? I only see Thomas in the Cc:
header, besides you.

That's why I add "Cc:" in commit message.
Because "git send-email" automatically adds mentioned addresses to CC.

OK then. It seems that the list handler striped the addresses of list subscribers from the Cc header except that of Thomas.

baruch

Signature · 3 lines
     http://baruch.siach.name/blog/                  ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -
#4 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Dear Baruch Siach,

Quoted 5 lines · Baruch Siach
Quoted 2 lines

That's why I add "Cc:" in commit message.
Because "git send-email" automatically adds mentioned addresses to CC.

OK then. It seems that the list handler striped the addresses of list subscribers from the Cc header except that of Thomas.

Yes, the list handler does some horrible crap with Cc, it seems to strip some of them when the recipient is subscribed to the list, but not all of them.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
#5 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

In reply to Alexey Brodkin
Quoted 7 lines · Alexey Brodkin

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

This was rejected before:
https://bugs.busybox.net/show_bug.cgi?id=5294

And i'm back to my original question, what's the specific need for this? Even for eglibc/glibc we force -O2 for example.
If there's a very valid (like, it breaks!) reason for this we can look for a way to address it, but as-is i say NAK.
If you look at uClibc's Rules.mak file you'll see there are lots of OPTIMIZATION/CPU_CFLAGS (and other) conditionals that could be undone by this and lead to unexpected results.
Regards.

#6 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Hi Gustavo,

Quoted 13 lines · Gustavo Zacarias
Quoted 7 lines · Alexey Brodkin

When BR2_TARGET_OPTIMIZATION is used (with some specific compiler flags) it's expected that ALL target binaries will be built with specified options.

Currently uClibc is built with its own set of options. This change allows passing additional flags to uclibc build system.

This was rejected before:
https://bugs.busybox.net/show_bug.cgi?id=5294

Quoted 9 lines

And i'm back to my original question, what's the specific need for this? Even for eglibc/glibc we force -O2 for example.
If there's a very valid (like, it breaks!) reason for this we can look for a way to address it, but as-is i say NAK.
If you look at uClibc's Rules.mak file you'll see there are lots of OPTIMIZATION/CPU_CFLAGS (and other) conditionals that could be undone by this and lead to unexpected results.
Regards.

Thanks for pointing to the existing bug.

In my particular case I need to tune uClibc for different HW configurations.

By default uClibc will be built for most conservative case. But we have an ability to use a particular HW accelerators - which is done by passing option to GCC.

-Alexey

#7 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Quoted 8 lines · Alexey Brodkin

Thanks for pointing to the existing bug.

In my particular case I need to tune uClibc for different HW configurations.

By default uClibc will be built for most conservative case. But we have an ability to use a particular HW accelerators - which is done by passing option to GCC.

Then we could add a BR2_UCLIBC_EXTRA_CFLAGS string which defaults to "" and pass that to the uclibc's UCLIBC_EXTRA_CFLAGS.
It was mentioned in the past IIRC, however it wasn't done because probably nobody felt the need for it since everybody was asking for that for consistency alone.
Regards.

#8 lore raw

PATCH 1/1 uclibc: respect top-level TARGET_CFLAGS

Hi Gustavo,

Quoted 11 lines · Gustavo Zacarias
Quoted 8 lines · Alexey Brodkin

Thanks for pointing to the existing bug.

In my particular case I need to tune uClibc for different HW configurations.

By default uClibc will be built for most conservative case. But we have an ability to use a particular HW accelerators - which is done by passing option to GCC.

Quoted 6 lines

Then we could add a BR2_UCLIBC_EXTRA_CFLAGS string which defaults to "" and pass that to the uclibc's UCLIBC_EXTRA_CFLAGS.
It was mentioned in the past IIRC, however it wasn't done because probably nobody felt the need for it since everybody was asking for that for consistency alone.
Regards.

Makes sense. And I think I'll do a re-spin of my patch that implements your suggestion.

Even though my intention was to completely align uClibc's flags with all other binaries on target, probably it's enough to have this proposed possibility to add manually set op option to uClibc in particular.

Still I think if any package gets broken due to some combination of compiler options passed this is definitely a problem in either package itself or toolchain. And either variant should be investigated and properly fixed. Otherwise we introduce "robustness and predictability by fixed setup" :)

-Alexey