diff mbox

sudo: honor target cflags/ldflags

Message ID 1494231273-6554-1-git-send-email-p.debruijn@unilogic.nl
State Changes Requested
Headers show

Commit Message

Pascal de Bruijn May 8, 2017, 8:14 a.m. UTC
sudo would previously have not been build using flags passed
via BR2_TARGET_OPTIMIZATION.

in our case -fPIE was being ignored.

Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
---
 package/sudo/sudo.mk | 1 +
 1 file changed, 1 insertion(+)

Comments

Thomas Petazzoni May 8, 2017, 10:30 a.m. UTC | #1
Hello,

On Mon,  8 May 2017 10:14:33 +0200, Pascal de Bruijn wrote:
> sudo would previously have not been build using flags passed
> via BR2_TARGET_OPTIMIZATION.
> 
> in our case -fPIE was being ignored.
> 
> Signed-off-by: Pascal de Bruijn <p.debruijn@unilogic.nl>
> ---
>  package/sudo/sudo.mk | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/package/sudo/sudo.mk b/package/sudo/sudo.mk
> index 0fcd740..dc15b4f 100644
> --- a/package/sudo/sudo.mk
> +++ b/package/sudo/sudo.mk
> @@ -10,6 +10,7 @@ SUDO_LICENSE = ISC, BSD-3-Clause
>  SUDO_LICENSE_FILES = doc/LICENSE
>  # This is to avoid sudo's make install from chown()ing files which fails
>  SUDO_INSTALL_TARGET_OPTS = INSTALL_OWNER="" DESTDIR="$(TARGET_DIR)" install
> +SUDO_CONF_ENV += CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)"

I don't see how this can fix anything, because CFLAGS/LDFLAGS are part
of  TARGET_CONFIGURE_OPTS, which is already passed in the environment
when calling ./configure. From package/pkg-autotools.mk:

define $(2)_CONFIGURE_CMDS
        (cd $$($$(PKG)_SRCDIR) && rm -rf config.cache && \
        $$(TARGET_CONFIGURE_OPTS) \
        $$(TARGET_CONFIGURE_ARGS) \
        $$($$(PKG)_CONF_ENV) \
        CONFIG_SITE=/dev/null \
        ./configure \

Best regards,

Thomas
diff mbox

Patch

diff --git a/package/sudo/sudo.mk b/package/sudo/sudo.mk
index 0fcd740..dc15b4f 100644
--- a/package/sudo/sudo.mk
+++ b/package/sudo/sudo.mk
@@ -10,6 +10,7 @@  SUDO_LICENSE = ISC, BSD-3-Clause
 SUDO_LICENSE_FILES = doc/LICENSE
 # This is to avoid sudo's make install from chown()ing files which fails
 SUDO_INSTALL_TARGET_OPTS = INSTALL_OWNER="" DESTDIR="$(TARGET_DIR)" install
+SUDO_CONF_ENV += CFLAGS="$(TARGET_CFLAGS)" LDFLAGS="$(TARGET_LDFLAGS)"
 SUDO_CONF_OPTS = \
 	--without-lecture \
 	--without-sendmail \