Wind River Support Network

HomeDefectsLIN8-9841
Fixed

LIN8-9841 : WRL8 RCPL0027 - net-snmp-config broken

Created: Sep 24, 2018    Updated: Mar 27, 2019
Resolved Date: Oct 21, 2018
Found In Version: 8.0.0.27
Fix Version: 8.0.0.28
Severity: Standard
Applicable for: Wind River Linux 8
Component/s: Userspace

Description

The 089d0c53ea40c841baee0cd2eecd7844a31cfa90 "net-snmp: Fix host contamination" commit in WRL8 RCPL0027 appears to break the generation of the net-snmp-config leaking "--sysroot=" and "--with-libtool-sysroot=" where the wrl8 projects sysroot directory has been removed but the empty assignment remains breaking attempts to use net-snmp-config in a cross-compile environment.

The commit affects this trailing sed statement in the do_install_append() by removing all instances of the $STAGING_DIR_TARGET paths. This trailing sed used to properly manage the removal of the sysroot option and path constructs. By stripping the sysroot staging dir path initially, the isolated --option= remains in the rcpl27 generated net-snmp-config. 

do_install_append() {
install -d ${D}${sysconfdir}/snmp
...
sed -e "s@--sysroot=${STAGING_DIR_TARGET}@@g" \
-e "s@--with-libtool-sysroot=${STAGING_DIR_TARGET}@@g" \
-e "s@${STAGING_DIR_TARGET}@@g" \
-i ${D}${bindir}/net-snmp-config \
-i ${D}${includedir}/net-snmp/net-snmp-config.h
}

Here is an example of the isolated "--syroot=" artifacts:
$ grep 'sysroot=' package/usr/bin/net-snmp-config
echo " '--build=x86_64-linux' '--host=x86_64-gcgl-linux' '--target=x86_64-gcgl-linux' '--prefix=/usr' '--exec_prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib64/net-snmp' '--datadir=/usr/share' '--sysconfdir=/etc' '--sharedstatedir=/com' '--localstatedir=/var' '--libdir=/usr/lib64' '--includedir=/usr/include' '--oldincludedir=/usr/include' '--infodir=/usr/share/info' '--mandir=/usr/share/man' '--disable-silent-rules' '--disable-dependency-tracking' '--with-libtool-sysroot=' '--enable-shared' '--disable-manuals' '--with-defaults' '--with-persistent-directory=/var/lib/net-snmp' '--with-endianness=little' '--with-openssl=/usr' '--with-mib-modules=smux' '--with-systemd' '--without-elf' '--enable-ipv6' '--disable-embedded-perl' '--with-perl-modules=no' 'build_alias=x86_64-linux' 'host_alias=x86_64-gcgl-linux' 'target_alias=x86_64-gcgl-linux' 'CC=x86_64-gcgl-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot=' 'CFLAGS= -O2 -pipe -g ' 'LDFLAGS=-Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed' 'CPPFLAGS=' 'CPP=x86_64-gcgl-linux-gcc -E --sysroot= -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed'"
echo "x86_64-gcgl-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot= -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -pipe -g -Ulinux -Dlinux=linux "
cmd="x86_64-gcgl-linux-gcc -m64 -march=corei7 -mtune=corei7 -mfpmath=sse -msse4.2 -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed --sysroot= $cflags -DNETSNMP_ENABLE_IPV6 -fno-strict-aliasing -O2 -pipe -g -Ulinux -Dlinux=linux -I. -I=${NSC_INCLUDEDIR} -o $outname $tmpfile $cfiles $NSC_LDFLAGS $NSC_LIBDIR $NSC_BASE_AGENT_LIBS $NSC_AGENTLIBS $ldflags"


Refer to Issue which introduced the bug: LIN8-9001

Steps to Reproduce

1. /wrlinux/configure --enable-board=qemux86-64 --enable-kernel=standard --enable-rootfs=glibc-small --enable-reconfig=yes --enable-internet-download=yes --with-rcpl-version=0027
2. make net-snmp.addpkg
3. make
4. grep "sysroot" bitbake_build/tmp/work/core2-64-wrs-linux/net-snmp/5.7.3-r0/package/usr/bin/net-snmp-config  --color=auto
5. Observe sysroot flag empty causing error on runtime

Other Downloads


Live chat
Online