Giter Site home page Giter Site logo

Comments (10)

wcawijngaards avatar wcawijngaards commented on August 18, 2024 1

So I see from the config.log there is an issue with the reallocarray test. It did not properly detect it, both times. The first needed to do the define before include, the second test for the header declaration, and if missing set it to have the defines. The commit fixes that, 3643df6 .

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

NSD already tests for reallocarray in configure. It also defines OPENBSD_SOURCE. Do you have configure output or config.log? For the reallocarray, pselect, pselect prototype, ctime prototype, strptime parts? Otherwise I can try to guess what it is, but I'd prefer to look at the output.

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

So, the commit checks for reallocarray needing a define, and if so defines it. That should solve the compile and make #81 not needed. If it works. Could still have #81 too if that is better code.
Thanks for the detailed information!

from nsd.

noloader avatar noloader commented on August 18, 2024

Hi @wcawijngaards,

OK, so I sync'd with upstream and I am on Master, which is NLNet Labs code (no patches). Then a distclean && autoreconf && ./configure.

Here is what we see for configure:

checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/cpuset.h usability... no
checking sys/cpuset.h presence... no
checking for sys/cpuset.h... no
checking for cpu_set_t... no
checking for cpuset_t... no
checking for cpuid_t... yes
checking for sched_setaffinity... no

Then:

gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./udbzone.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./util.c
./util.c: In function 'xmallocarray':
./util.c:273:24: warning: implicit declaration of function 'reallocarray' [-Wimplicit-function-declaration]
         void *result = reallocarray(NULL, num, size);
                        ^
./util.c:273:24: warning: initialization makes pointer from integer without a cast [-Wint-conversion]
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./bitset.c

The config.log for the build is attached: config.log.zip

from nsd.

noloader avatar noloader commented on August 18, 2024

@wcawijngaards,

OK, resync with master and clean. Then autoreconf && configure:

checking sched.h usability... yes
checking sched.h presence... yes
checking for sched.h... yes
checking sys/cpuset.h usability... no
checking sys/cpuset.h presence... no
checking for sys/cpuset.h... no
checking for cpu_set_t... no
checking for cpuset_t... no
checking for cpuid_t... yes
checking for sched_setaffinity... no

Then make:

config.status: creating Makefile
config.status: creating config.h
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./answer.c
In file included from ./query.h:17:0,
                 from ./answer.h:18,
                 from ./answer.c:14:
./nsd.h:133:14: error: 'IFNAMSIZ' undeclared here (not in a function)
  char device[IFNAMSIZ];
              ^
*** Error code 1

For NetBSD, it looks like the header <net/if.h> needs to be included.

Here is the latest config.log.zip.

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

Can you see in net/if.h if IFNAMSIZ is defined there, the if_nametoindex man page for NetBSD talks about it. Otherwise I can fix this with a #ifndef for IFNAMSIZE, I guess.

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

I mean the net/if.h include is already present in nsd.h, but somehow the define is not there?

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

That commit could maybe solve the issue by using backup definitions, it looks like it would otherwise be exported if _NSDBSD_SOURCE is defined. This is also something I can do, but this may also work on other systems.

from nsd.

k0ekk0ek avatar k0ekk0ek commented on August 18, 2024

Arguably we only need the device name on Linux. It's only needed for bindtodevice and that's Linux only, so a if defined(__linux) would work too...

from nsd.

noloader avatar noloader commented on August 18, 2024

Latest results after a sync and clean build:

gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./answer.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./axfr.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./buffer.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c configlexer.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c configparser.c
./configparser.y: In function 'c_parse':
./configparser.y:267:11: warning: implicit declaration of function 'strncasecmp' [-Wimplicit-function-declaration]
       if (strncasecmp($2, "ascii_", 6) == 0) {
           ^
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./dname.c
./dname.c: In function 'dname_to_string':
./dname.c:399:3: warning: implicit declaration of function 'strlcpy' [-Wimplicit-function-declaration]
   strlcpy(buf, ".", sizeof(buf));
   ^
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./dns.c
./dns.c: In function 'rrclass_to_string':
./dns.c:927:3: warning: implicit declaration of function 'strlcpy' [-Wimplicit-function-declaration]
   strlcpy(buf, entry->name, sizeof(buf));
   ^
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./edns.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./iterated_hash.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./lookup3.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./namedb.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./nsec3.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./options.c
./options.c: In function 'config_cook_string':
./options.c:1720:2: warning: implicit declaration of function 'strlcpy' [-Wimplicit-function-declaration]
  strlcpy(f, input, sizeof(f));
  ^
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./packet.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./query.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./rbtree.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./radtree.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./rdata.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./region-allocator.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./rrl.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./tsig.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./tsig-openssl.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./udb.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./udbradtree.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./udbzone.c
gcc -I. -I/usr/pkg/include -g -O2 -flto -c ./util.c
./util.c: In function 'lookup_by_name':
./util.c:240:7: warning: implicit declaration of function 'strcasecmp' [-Wimplicit-function-declaration]
   if (strcasecmp(name, table->name) == 0)
       ^
./util.c: In function 'b32_ntop':
./util.c:695:3: warning: implicit declaration of function 'strlcpy' [-Wimplicit-function-declaration]
   strlcpy(target, buf, targsize);
   ^
./util.c: At top level:
./util.c:843:8: error: unknown type name 'u_long'
 static u_long crctab[] = {
        ^
./util.c: In function 'qid_generate':
./util.c:944:23: warning: implicit declaration of function 'arc4random' [-Wimplicit-function-declaration]
     return (uint16_t) arc4random();
                       ^
./util.c: In function 'random_generate':
./util.c:961:18: warning: implicit declaration of function 'arc4random_uniform' [-Wimplicit-function-declaration]
     return (int) arc4random_uniform(max);
                  ^
./util.c: In function 'append_trailing_slash':
./util.c:1148:3: warning: implicit declaration of function 'strlcat' [-Wimplicit-function-declaration]
   strlcat(dirname_slash, "/", l+2);
   ^
*** Error code 1

And the latest config.log.zip.

from nsd.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.