How to to tell automake to map "/builder/shared-workdir/build/staging_dir" to "/home/user_name/sdk/staging_dir" (SDK libtool path error)

I have SDK installed in ~/sdk and am trying to build a package that has a dependency on libstdcpp. There seem to be a mapping problem for "/builder/shared-workdir/build/staging_dir"

/home/user_name/sdk/staging_dir/host/bin/grep: /builder/shared-workdir/build/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib/libstdc++.la: No such file or directory
/home/user_name/sdk/staging_dir/host/bin/sed: can't read /builder/shared-workdir/build/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib/libstdc++.la: No such file or directory
libtool:   error: '/builder/shared-workdir/build/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib/libstdc++.la' is not a valid libtool archive

The "missing" file exists in

/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib

but the make process is looking for it in the wrong folder

/builder/shared-workdir/build/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/arm-openwrt-linux-muslgnueabi/lib

That sounds like a genuine bug at the first glance.
The libtool in SDK thinks for some reason that it still has the buildbot directory structure.

Does that happen for all packages? All libstdcpp dependent one?
Is that with main/master or 23.05?

You might debug a bit and write a bug report at https://github.com/openwrt/openwrt/issues

Do you have the verbose build log?

I only experienced this for one package pmacct

I also see other discussions on this forum reporting the same problem.

I only used the 23.05.2 ipq806x/generic SDK.

I only used make V=sc with the output going to stdout. I can provide the log if you provide the instructions how to generate it.

Can you show links to them? I can't find those discussions.

Copy paste a few hundred last lines from screen, or use "tee" in style of
make V=s 2>&1 | tee build.log

Which package?

I updated my prior message with the links to other posts.

Here is the log. Is it enough?

/bin/bash ../../libtool  --tag=CC   --mode=compile arm-openwrt-linux-muslgnueabi-gcc -DPACKAGE_NAME=\"pmacct\" -DPACKAGE_TARNAME=\"pmacct\" -DPACKAGE_VERSION=\"1.7.9-git\" -DPACKAGE_STRING=\"pmacct\ 1.7.9-git\" -DPACKAGE_BUGREPORT=\"paolo@pmacct.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pmacct\" -DVERSION=\"1.7.9-git\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DLINUX=1 -DPROGNAME=1 -DIM_LITTLE_ENDIAN=1 -DNEED_ALIGN=1 -DHAVE_L2=1 -DHAVE_INET_PTON=1 -DHAVE_INET_NTOP=1 -DHAVE_PCAP_H=1 -DHAVE_LIBPCAP=1 -DPCAP_SET_DIRECTION=1 -DHAVE_DLOPEN=1 -DHAVE_ARPA_INET_H=1 -DHAVE_ASSERT_H=1 -DHAVE_CTYPE_H=1 -DHAVE_DIRENT_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_GRP_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MATH_H=1 -DHAVE_NETDB_H=1 -DHAVE_NET_IF_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_NETINET_IN_SYSTM_H=1 -DHAVE_NETINET_IP_H=1 -DHAVE_NETINET_UDP_H=1 -DHAVE_PTHREAD_H=1 -DHAVE_PWD_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_ERRNO_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_UN_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_U_INT64_T=1 -DHAVE_U_INT32_T=1 -DHAVE_U_INT16_T=1 -DHAVE_U_INT8_T=1 -DHAVE_UINT64_T=1 -DHAVE_UINT32_T=1 -DHAVE_UINT16_T=1 -DHAVE_UINT8_T=1 -DHAVE_TRAFFIC_BINS=1 -DHAVE_TDESTROY=1 -DHAVE_STRLCPY=1 -DHAVE_VFORK=1 -DHAVE_SO_BINDTODEVICE=1 -DHAVE_SO_REUSEPORT=1 -DHAVE_SO_ATTACH_REUSEPORT_EBPF=1 -DCOMPILE_ARGS=\"\ \'--target=arm-openwrt-linux\'\ \'--host=arm-openwrt-linux\'\ \'--build=x86_64-pc-linux-gnu\'\ \'--disable-dependency-tracking\'\ \'--program-prefix=\'\ \'--program-suffix=\'\ \'--prefix=/usr\'\ \'--exec-prefix=/usr\'\ \'--bindir=/usr/bin\'\ \'--sbindir=/usr/sbin\'\ \'--libexecdir=/usr/lib\'\ \'--sysconfdir=/etc\'\ \'--datadir=/usr/share\'\ \'--localstatedir=/var\'\ \'--mandir=/usr/man\'\ \'--infodir=/usr/info\'\ \'--disable-nls\'\ \'--with-pcap-includes=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include\'\ \'--with-pcap-libs=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib\'\ \'--enable-bgp-bins=no\'\ \'--enable-bmp-bins=no\'\ \'--enable-st-bins=no\'\ \'build_alias=x86_64-pc-linux-gnu\'\ \'host_alias=arm-openwrt-linux\'\ \'target_alias=arm-openwrt-linux\'\ \'CC=arm-openwrt-linux-muslgnueabi-gcc\'\ \'CFLAGS=-Os\ -pipe\ -fno-caller-saves\ -fno-plt\ -fhonour-copts\ -mfloat-abi=hard\ -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9\ -Wformat\ -Werror=format-security\ -fstack-protector\ -D_FORTIFY_SOURCE=1\ -Wl,-z,now\ -Wl,-z,relro\ -ffunction-sections\ -fdata-sections\ -Wno-stringop-overflow\ \'\ \'LDFLAGS=-L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/lib\ -L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/lib\ -znow\ -zrelro\ -Wl,--gc-sections\ \'\ \'CPPFLAGS=-I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include\ -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify\ -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include\ \'\ \'PKG_CONFIG=/home/user_name/sdk/staging_dir/host/bin/pkg-config\'\ \'PKG_CONFIG_PATH=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig\'\ \'PKG_CONFIG_LIBDIR=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig\'\ \'CXX=arm-openwrt-linux-muslgnueabi-g++\'\ \'CXXFLAGS=-Os\ -pipe\ -fno-caller-saves\ -fno-plt\ -fhonour-copts\ -mfloat-abi=hard\ -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9\ -Wformat\ -Werror=format-security\ -fstack-protector\ -D_FORTIFY_SOURCE=1\ -Wl,-z,now\ -Wl,-z,relro\ -ffunction-sections\ -fdata-sections\ -Wno-stringop-overflow\ \'\ \'--enable-l2\'\ \'--enable-traffic-bins\'\" -I.   -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include  -DFLOW_SPLAY -DEXPIRY_RB -I./..  -O2 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow  -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/external_libs/rootfs/include  -I/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include  -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src -c -o libnfprobe_plugin_la-convtime.lo `test -f 'convtime.c' || echo './'`convtime.c
OpenWrt-libtool: compile:  arm-openwrt-linux-muslgnueabi-gcc -DPACKAGE_NAME=\"pmacct\" -DPACKAGE_TARNAME=\"pmacct\" -DPACKAGE_VERSION=\"1.7.9-git\" "-DPACKAGE_STRING=\"pmacct 1.7.9-git\"" -DPACKAGE_BUGREPORT=\"paolo@pmacct.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pmacct\" -DVERSION=\"1.7.9-git\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DLINUX=1 -DPROGNAME=1 -DIM_LITTLE_ENDIAN=1 -DNEED_ALIGN=1 -DHAVE_L2=1 -DHAVE_INET_PTON=1 -DHAVE_INET_NTOP=1 -DHAVE_PCAP_H=1 -DHAVE_LIBPCAP=1 -DPCAP_SET_DIRECTION=1 -DHAVE_DLOPEN=1 -DHAVE_ARPA_INET_H=1 -DHAVE_ASSERT_H=1 -DHAVE_CTYPE_H=1 -DHAVE_DIRENT_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_GRP_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MATH_H=1 -DHAVE_NETDB_H=1 -DHAVE_NET_IF_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_NETINET_IN_SYSTM_H=1 -DHAVE_NETINET_IP_H=1 -DHAVE_NETINET_UDP_H=1 -DHAVE_PTHREAD_H=1 -DHAVE_PWD_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_ERRNO_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_UN_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_U_INT64_T=1 -DHAVE_U_INT32_T=1 -DHAVE_U_INT16_T=1 -DHAVE_U_INT8_T=1 -DHAVE_UINT64_T=1 -DHAVE_UINT32_T=1 -DHAVE_UINT16_T=1 -DHAVE_UINT8_T=1 -DHAVE_TRAFFIC_BINS=1 -DHAVE_TDESTROY=1 -DHAVE_STRLCPY=1 -DHAVE_VFORK=1 -DHAVE_SO_BINDTODEVICE=1 -DHAVE_SO_REUSEPORT=1 -DHAVE_SO_ATTACH_REUSEPORT_EBPF=1 "-DCOMPILE_ARGS=\" '--target=arm-openwrt-linux' '--host=arm-openwrt-linux' '--build=x86_64-pc-linux-gnu' '--disable-dependency-tracking' '--program-prefix=' '--program-suffix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var' '--mandir=/usr/man' '--infodir=/usr/info' '--disable-nls' '--with-pcap-includes=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include' '--with-pcap-libs=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib' '--enable-bgp-bins=no' '--enable-bmp-bins=no' '--enable-st-bins=no' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=arm-openwrt-linux' 'target_alias=arm-openwrt-linux' 'CC=arm-openwrt-linux-muslgnueabi-gcc' 'CFLAGS=-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow ' 'LDFLAGS=-L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/lib -L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/lib -znow -zrelro -Wl,--gc-sections ' 'CPPFLAGS=-I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include ' 'PKG_CONFIG=/home/user_name/sdk/staging_dir/host/bin/pkg-config' 'PKG_CONFIG_PATH=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig' 'CXX=arm-openwrt-linux-muslgnueabi-g++' 'CXXFLAGS=-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow ' '--enable-l2' '--enable-traffic-bins'\"" -I. -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include -DFLOW_SPLAY -DEXPIRY_RB -I./.. -O2 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/external_libs/rootfs/include -I/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src -c convtime.c  -fPIC -DPIC -o .libs/libnfprobe_plugin_la-convtime.o
OpenWrt-libtool: compile:  arm-openwrt-linux-muslgnueabi-gcc -DPACKAGE_NAME=\"pmacct\" -DPACKAGE_TARNAME=\"pmacct\" -DPACKAGE_VERSION=\"1.7.9-git\" "-DPACKAGE_STRING=\"pmacct 1.7.9-git\"" -DPACKAGE_BUGREPORT=\"paolo@pmacct.net\" -DPACKAGE_URL=\"\" -DPACKAGE=\"pmacct\" -DVERSION=\"1.7.9-git\" -DHAVE_STDIO_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_STRINGS_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_UNISTD_H=1 -DSTDC_HEADERS=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -DLINUX=1 -DPROGNAME=1 -DIM_LITTLE_ENDIAN=1 -DNEED_ALIGN=1 -DHAVE_L2=1 -DHAVE_INET_PTON=1 -DHAVE_INET_NTOP=1 -DHAVE_PCAP_H=1 -DHAVE_LIBPCAP=1 -DPCAP_SET_DIRECTION=1 -DHAVE_DLOPEN=1 -DHAVE_ARPA_INET_H=1 -DHAVE_ASSERT_H=1 -DHAVE_CTYPE_H=1 -DHAVE_DIRENT_H=1 -DHAVE_DLFCN_H=1 -DHAVE_ERRNO_H=1 -DHAVE_FCNTL_H=1 -DHAVE_GETOPT_H=1 -DHAVE_GRP_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_LIMITS_H=1 -DHAVE_MALLOC_H=1 -DHAVE_MATH_H=1 -DHAVE_NETDB_H=1 -DHAVE_NET_IF_H=1 -DHAVE_NETINET_IN_H=1 -DHAVE_NETINET_IN_SYSTM_H=1 -DHAVE_NETINET_IP_H=1 -DHAVE_NETINET_UDP_H=1 -DHAVE_PTHREAD_H=1 -DHAVE_PWD_H=1 -DHAVE_SIGNAL_H=1 -DHAVE_STRING_H=1 -DHAVE_SYS_ERRNO_H=1 -DHAVE_SYS_FILE_H=1 -DHAVE_SYS_IOCTL_H=1 -DHAVE_SYSLOG_H=1 -DHAVE_SYS_MMAN_H=1 -DHAVE_SYS_PARAM_H=1 -DHAVE_SYS_POLL_H=1 -DHAVE_SYS_RESOURCE_H=1 -DHAVE_SYS_SELECT_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_UN_H=1 -DHAVE_SYS_UTSNAME_H=1 -DHAVE_SYS_WAIT_H=1 -DHAVE_TIME_H=1 -DHAVE_UNISTD_H=1 -DHAVE_U_INT64_T=1 -DHAVE_U_INT32_T=1 -DHAVE_U_INT16_T=1 -DHAVE_U_INT8_T=1 -DHAVE_UINT64_T=1 -DHAVE_UINT32_T=1 -DHAVE_UINT16_T=1 -DHAVE_UINT8_T=1 -DHAVE_TRAFFIC_BINS=1 -DHAVE_TDESTROY=1 -DHAVE_STRLCPY=1 -DHAVE_VFORK=1 -DHAVE_SO_BINDTODEVICE=1 -DHAVE_SO_REUSEPORT=1 -DHAVE_SO_ATTACH_REUSEPORT_EBPF=1 "-DCOMPILE_ARGS=\" '--target=arm-openwrt-linux' '--host=arm-openwrt-linux' '--build=x86_64-pc-linux-gnu' '--disable-dependency-tracking' '--program-prefix=' '--program-suffix=' '--prefix=/usr' '--exec-prefix=/usr' '--bindir=/usr/bin' '--sbindir=/usr/sbin' '--libexecdir=/usr/lib' '--sysconfdir=/etc' '--datadir=/usr/share' '--localstatedir=/var' '--mandir=/usr/man' '--infodir=/usr/info' '--disable-nls' '--with-pcap-includes=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include' '--with-pcap-libs=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib' '--enable-bgp-bins=no' '--enable-bmp-bins=no' '--enable-st-bins=no' 'build_alias=x86_64-pc-linux-gnu' 'host_alias=arm-openwrt-linux' 'target_alias=arm-openwrt-linux' 'CC=arm-openwrt-linux-muslgnueabi-gcc' 'CFLAGS=-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow ' 'LDFLAGS=-L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/lib -L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/lib -znow -zrelro -Wl,--gc-sections ' 'CPPFLAGS=-I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include ' 'PKG_CONFIG=/home/user_name/sdk/staging_dir/host/bin/pkg-config' 'PKG_CONFIG_PATH=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig' 'PKG_CONFIG_LIBDIR=/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib/pkgconfig:/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/share/pkgconfig' 'CXX=arm-openwrt-linux-muslgnueabi-g++' 'CXXFLAGS=-Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow ' '--enable-l2' '--enable-traffic-bins'\"" -I. -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/include -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include/fortify -I/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/include -DFLOW_SPLAY -DEXPIRY_RB -I./.. -O2 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/external_libs/rootfs/include -I/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src -c convtime.c -o libnfprobe_plugin_la-convtime.o >/dev/null 2>&1
/bin/bash ../../libtool  --tag=CC   --mode=link arm-openwrt-linux-muslgnueabi-gcc -DFLOW_SPLAY -DEXPIRY_RB -I./..  -O2 -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -mfloat-abi=hard -ffile-prefix-map=/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9=pmacct-1.7.9 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -ffunction-sections -fdata-sections -Wno-stringop-overflow  -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/external_libs/rootfs/include  -I/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/include  -I/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src  -L/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/external_libs/rootfs/lib -L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/usr/lib -L/home/user_name/sdk/staging_dir/toolchain-arm_cortex-a15+neon-vfpv4_gcc-12.3.0_musl_eabi/lib -znow -zrelro -Wl,--gc-sections  -o libnfprobe_plugin.la  libnfprobe_plugin_la-nfprobe_plugin.lo libnfprobe_plugin_la-netflow5.lo libnfprobe_plugin_la-netflow9.lo libnfprobe_plugin_la-convtime.lo  -lcdada -lstdc++ -lpcap  -ldl -L/home/user_name/sdk/staging_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/usr/lib -lm -lpthread
gmake[6]: Leaving directory '/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src/nfprobe_plugin'
gmake[5]: Leaving directory '/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src'
gmake[4]: Leaving directory '/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9/src'
make[3]: Leaving directory '/home/user_name/sdk/build_dir/target-arm_cortex-a15+neon-vfpv4_musl_eabi/pmacct-1.7.9'
make[2]: Leaving directory '/home/user_name/my_packages/pmacct'
time: package/feeds/custom/pmacct/compile#57.18#3.98#73.20
    ERROR: package/feeds/custom/pmacct failed to build.
make[1]: Leaving directory '/home/user_name/sdk'

Well it is apparently something from outside OpenWrt, and the previous thread that you linked was just about that same external package, pmacct, and already in 2021 it was found to be incompatible...

There might be something in that package's sources that you might need to patch in addition of authoring a proper openwrt Makefile for that package. (You likely have one in your custom feed, but we haven't seen it.)

So far this sounds like something wrong in that one specific package, not something generic wrong in OpenWrt SDK.

Actually it is my attempt to create the mpacct package. This package is not a part of OpenWrt. I just created the Makefile that points to the git repository of the package. Do you have any idea what is missing in this Makefile? What is the secrete that converts "/builder/shared-workdir/build/staging_dir" to "/home/user_name/sdk/staging_dir"?

cat /home/user_name/sdk/feeds.conf

src-link custom /home/user_name/my_packages
src-git-full base https://git.openwrt.org/openwrt/openwrt.git;openwrt-23.05
src-git packages https://git.openwrt.org/feed/packages.git^8e3a1824645f5e73ec44c897ac0755c53fb4a1f8

cat /home/user_name/my_packages/pmacct/Makefile:

include $(TOPDIR)/rules.mk

PKG_NAME:=pmacct
PKG_RELEASE:=1
PKG_HASH:=skip
# PKG_HASH:=4df50a3c6c7bdace3345bbf3bd4f6fa7a6722ec1fb45dfd266ad956b327da98a

# PKG_VERSION:=1.7.8
# PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
# # PKG_SOURCE_URL:=http://www.pmacct.net/
# PKG_SOURCE_URL:=file:///mnt/n/Tmp/Downloads/OpenWrt

PKG_VERSION:=1.7.9
PKG_SOURCE_VERSION:=1.7.9
PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/pmacct/pmacct.git

PKG_MAINTAINER:=Some Doofus <Doofus@some.org>
PKG_LICENSE:=GPL-2.0

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

PKG_FIXUP:=autoreconf

PKG_INSTALL:=1

include $(INCLUDE_DIR)/package.mk

CONFIGURE_ARGS += \
	--with-pcap-includes="$(STAGING_DIR)/usr/include" \
	--with-pcap-libs="$(STAGING_DIR)/usr/lib" \
	--enable-bgp-bins=no \
	--enable-bmp-bins=no \
	--enable-st-bins=no

TARGET_CFLAGS += -ffunction-sections -fdata-sections -Wno-stringop-overflow
TARGET_LDFLAGS += -Wl,--gc-sections
TARGET_CXXLAGS += -Wno-stringop-overflow

CONFIGURE_VARS += \
	BUILD_CC="$(TARGET_CC)" \
	HOSTCC="$(HOSTCC)" \
	td_cv_buggygetaddrinfo="no" \
	ac_cv_linux_vers=$(LINUX_VERSION) \
	ac_cv_header_rpc_rpcent_h=no \
	ac_cv_lib_rpc_main=no \
	ac_cv_path_PCAP_CONFIG=""

MAKE_FLAGS := CCOPT="$(TARGET_CFLAGS)" INCLS="-I. $(TARGET_CPPFLAGS)"


define Package/pmacct
	SECTION:=net
	CATEGORY:=Network
	DEPENDS:=+libpcap +libpthread +libstdcpp
	TITLE:=a powerful IP accounting set of tools
	URL:=http://www.pmacct.net/
endef

define Package/pmacct/install
	$(INSTALL_DIR) $(1)/usr/sbin
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pmacct $(1)/usr/sbin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/pmacctd $(1)/usr/sbin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/sfacctd $(1)/usr/sbin/
	$(INSTALL_BIN) $(PKG_BUILD_DIR)/src/nfacctd $(1)/usr/sbin/
endef

$(eval $(call BuildPackage,pmacct))

Why do the two dependencies libpcap and libpthread from
DEPENDS:=+libpcap +libpthread +libstdcpp
work magically and libstdcpp fails?