All of lore.kernel.org
 help / color / mirror / Atom feed
* [meta-networking][PATCH 1/1] net-snmp: Fix host contamination
@ 2018-06-15  8:22 Ovidiu Panait
  2018-06-16 15:43 ` Khem Raj
  0 siblings, 1 reply; 2+ messages in thread
From: Ovidiu Panait @ 2018-06-15  8:22 UTC (permalink / raw)
  To: openembedded-devel

If "/usr/local/ssl/include" directory exists on the host machine, net-snmp will
also search the host openssl headers:

build/net-snmp/temp$ grep -i "/usr/local/ssl/include" log.do_compile
x86_64-wrs-linux-libtool: compile: x86_64-wrs-linux-gcc ... -I/usr/local/ssl/include

Fix this by selecting the proper sysroot headers using
--with-openssl=${STAGING_EXECPREFIXDIR}

Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
---
 meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
index 5c827bb86..6f6f19ac9 100644
--- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
+++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
@@ -66,7 +66,8 @@ EXTRA_OECONF = "--enable-shared \
                 --with-install-prefix=${D} \
                 --with-persistent-directory=${localstatedir}/lib/net-snmp \
                 ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
-"
+                --with-openssl=${STAGING_EXECPREFIXDIR} \
+                "
 
 # net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
 EXTRA_OECONF += "--with-mib-modules=smux"
@@ -121,8 +122,10 @@ do_install_append() {
     install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
     install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
     sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+           -e "s@${STAGING_DIR_TARGET}@@g" \
         -i ${D}${bindir}/net-snmp-create-v3-user
     sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
+           -e "s@${STAGING_DIR_TARGET}@@g" \
            -e "s@\([^ ]*-fdebug-prefix-map=[^ ]*\)\1*@@g" \
            -e "s@\([^ ]*--sysroot=[^ ]*\)\1*@@g" \
            -e "s@\([^ ]*--with-libtool-sysroot=[^ ]*\)\1*@@g" \
-- 
2.17.1



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

* Re: [meta-networking][PATCH 1/1] net-snmp: Fix host contamination
  2018-06-15  8:22 [meta-networking][PATCH 1/1] net-snmp: Fix host contamination Ovidiu Panait
@ 2018-06-16 15:43 ` Khem Raj
  0 siblings, 0 replies; 2+ messages in thread
From: Khem Raj @ 2018-06-16 15:43 UTC (permalink / raw)
  To: Ovidiu Panait, openembedded-devel

Hi Ovidiu

On 6/15/18 1:22 AM, Ovidiu Panait wrote:
> If "/usr/local/ssl/include" directory exists on the host machine, net-snmp will
> also search the host openssl headers:
> 
> build/net-snmp/temp$ grep -i "/usr/local/ssl/include" log.do_compile
> x86_64-wrs-linux-libtool: compile: x86_64-wrs-linux-gcc ... -I/usr/local/ssl/include
> 
> Fix this by selecting the proper sysroot headers using
> --with-openssl=${STAGING_EXECPREFIXDIR}
> 
> Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com>
> ---
>   meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
> index 5c827bb86..6f6f19ac9 100644
> --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
> +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.7.3.bb
> @@ -66,7 +66,8 @@ EXTRA_OECONF = "--enable-shared \
>                   --with-install-prefix=${D} \
>                   --with-persistent-directory=${localstatedir}/lib/net-snmp \
>                   ${@oe.utils.conditional('SITEINFO_ENDIANNESS', 'le', '--with-endianness=little', '--with-endianness=big', d)} \
> -"
> +                --with-openssl=${STAGING_EXECPREFIXDIR} \
> +                "
>   
>   # net-snmp needs to have mib-modules=smux enabled to enable quagga to support snmp
>   EXTRA_OECONF += "--with-mib-modules=smux"
> @@ -121,8 +122,10 @@ do_install_append() {
>       install -m 0644 ${WORKDIR}/snmpd.service ${D}${systemd_unitdir}/system
>       install -m 0644 ${WORKDIR}/snmptrapd.service ${D}${systemd_unitdir}/system
>       sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
> +           -e "s@${STAGING_DIR_TARGET}@@g" \

this change here and similar change below is causing build failures 
since we are removing tags which are used to replace target sysroot 
especially for crossscripts which exposes the host paths e.g. -L/usr/lib 
into net-snmp-config files. This shows up later in dependent packages 
which fail to detect net-snmp features due to this host contamination 
e.g corosync, ntop, keepalived this is worse on x86_64 where it might 
still work but for musl targets you get straight errors everywhere.

If you can explain what these changes are fixing. May be we can come up 
with alternatives which dont cause the above said regression. Please 
rework through this patch

>           -i ${D}${bindir}/net-snmp-create-v3-user
>       sed    -e "s@^NSC_SRCDIR=.*@NSC_SRCDIR=.@g" \
> +           -e "s@${STAGING_DIR_TARGET}@@g" \
>              -e "s@\([^ ]*-fdebug-prefix-map=[^ ]*\)\1*@@g" \
>              -e "s@\([^ ]*--sysroot=[^ ]*\)\1*@@g" \
>              -e "s@\([^ ]*--with-libtool-sysroot=[^ ]*\)\1*@@g" \
> 


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

end of thread, other threads:[~2018-06-16 15:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-15  8:22 [meta-networking][PATCH 1/1] net-snmp: Fix host contamination Ovidiu Panait
2018-06-16 15:43 ` Khem Raj

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.