Failure to build stats.c in bind library's libisc
Describe the bug Failure to compile the bind library 9.11.14 when building on OpenWRT.
To Reproduce Steps to reproduce the behavior:
- Create a build environment for OpenWRT
- Select
CONFIG_TARGET_x86
,CONFIG_TARGET_x86_64
,CONFIG_PACKAGE_isc-dhcp-server-ipv6
. - Run
make defconfig oldconfig && make world
- See error
Expected behavior Should build with no errors.
Environment:
- ISC DHCP 4.4.2-P1
- OS: Ubuntu 20.04.2 LTS (x86_64)
- Configure args:
--enable-paranoia --disable-dependency-tracking --with-randomdev=/dev/urandom ac_cv_file__dev_random=yes --enable-dhcpv6
Additional Information
My config.report
says:
ISC DHCP source configure results:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
Package:
Name: DHCP
Version: 4.4.2-P1
C Compiler: x86_64-openwrt-linux-musl-gcc
Flags:
DEFS: -DHAVE_CONFIG_H
CFLAGS: -Os -pipe -fno-caller-saves -fno-plt -fhonour-copts -Wno-error=unused-but-set-variable -Wno-error=unused-result -fmacro-prefix-map=/home/philipp/lede/build_dir/target-x86_64_musl/isc-dhcp-ipv6/dhcp-4.4.2-P1=dhcp-4.4.2-P1 -Wformat -Werror=format-security -fstack-protector -D_FORTIFY_SOURCE=1 -Wl,-z,now -Wl,-z,relro -fcommon -I$(top_srcdir)/includes -I/home/philipp/lede/build_dir/target-x86_64_musl/isc-dhcp-ipv6/dhcp-4.4.2-P1/bind/include
DHCP versions: DHCPv4 and DHCPv6
Features:
debug: no
failover: yes
execute: yes
binary-leases: no
dhcpv6: yes
delayed-ack: yes
dhcpv4o6: no
relay-port: no
Developer:
ATF unittests : no
Seeing the following build failure:
Building isc library in /home/philipp/lede/build_dir/target-x86_64_musl/isc-dhcp-ipv6/dhcp-4.4.2-P1/bind/bind-9.11.14/lib/isc
stats.c: In function 'setcounter':
stats.c:300:29: error: 'val' undeclared (first use in this function); did you mean 'value'?
stats->counters[counter] = val;
^~~
value
stats.c:300:29: note: each undeclared identifier is reported only once for each function it appears in
stats.c:286:20: warning: unused parameter 'value' [-Wunused-parameter]
const uint64_t value)
~~~~~~~~~~~~~~~^~~~~
make[5]: *** [Makefile:290: stats.o] Error 1
Some initial questions
- Since the file with the error comes from a tarball inside a tarball that gets unpacked during the pack, it's not easy to patch after the initial unpack...
Is your feature request related to a problem? Please describe. N/a
Describe the solution you'd like Sources should build out-of-the-box.
Describe alternatives you've considered N/A
Additional context Fix seems trivial:
--- a/dhcp-4.4.2-P1/bind/bind-9.11.14/lib/isc/stats.c
+++ b/dhcp-4.4.2-P1/bind/bind-9.11.14/lib/isc/stats.c
@@ -297,7 +297,7 @@ setcounter(isc_stats_t *stats,
isc_atomic_store((int32_t *)&stats->counters[counter].lo,
(uint32_t)(value & 0xffffffff));
# else
- stats->counters[counter] = val;
+ stats->counters[counter] = value;
# endif
#endif
}
Funding its development Are you able and willing to participate financially in the development costs?
- No
Participating in development Are you willing to participate in the feature development?
- Yes Are you willing to take part in the design discussions?
- Yes Are you willing to test an unreleased engineering code?
- Yes
Contacting you How can ISC reach you to discuss this matter further?
philipp@redfish-solutions.com