Giter Site home page Giter Site logo

Comments (3)

noloader avatar noloader commented on August 18, 2024
% cat /usr/include/sched.h
...

typedef	cpumask_t		cpu_set_t;
typedef	cpumask_t		cpuset_t;	/* FreeBSD compat */

#define	CPU_SETSIZE		((int)(sizeof(cpumask_t) * 8))

The first try compiles OK, but it results in link errors.

% git diff
diff --git a/compat/cpuset.h b/compat/cpuset.h
index c7cd2dc1..d52ab852 100644
--- a/compat/cpuset.h
+++ b/compat/cpuset.h
@@ -44,6 +44,9 @@ typedef int cpuid_t;
 #ifdef __FreeBSD__
 typedef size_t cpuid_t;
 #endif
+#ifdef __DragonFly__
+typedef size_t cpuid_t;
+#endif
 #endif
 
 #ifndef HAVE_CPUSET_CREATE

But then:

% make
gcc -g -O2 -flto -L/usr/local/lib -L/usr/local/lib -o nsd answer.o axfr.o buffer
.o configlexer.o configparser.o dname.o dns.o edns.o iterated_hash.o lookup3.o n
amedb.o nsec3.o options.o packet.o query.o rbtree.o radtree.o rdata.o region-all
ocator.o rrl.o tsig.o tsig-openssl.o udb.o udbradtree.o udbzone.o util.o bitset.
o popen3.o xfrd-disk.o xfrd-notify.o xfrd-tcp.o xfrd.o remote.o  difffile.o ipc.
o mini_event.o netio.o nsd.o server.o dbaccess.o dbcreate.o zlexer.o zonec.o zpa
rser.o cpuset.o b64_pton.o b64_ntop.o -lssl -lcrypto -lutil -levent
./server.c:2819: error: undefined reference to 'set_cpu_affinity'
./server.c:2205: error: undefined reference to 'set_cpu_affinity'
./nsd.c:546: error: undefined reference to 'cpuset_destroy'
./nsd.c:1190: error: undefined reference to 'cpuset_create'
./nsd.c:1198: error: undefined reference to 'cpuset_isset'
./nsd.c:1204: error: undefined reference to 'cpuset_set'
./nsd.c:1195: error: undefined reference to 'cpuset_or'
./nsd.c:1117: error: undefined reference to 'number_of_cpus'
./nsd.c:1121: error: undefined reference to 'cpuset_create'
./nsd.c:1129: error: undefined reference to 'cpuset_set'
./nsd.c:1144: error: undefined reference to 'cpuset_create'
./nsd.c:1150: error: undefined reference to 'cpuset_isset'
./nsd.c:1154: error: undefined reference to 'cpuset_set'
./nsd.c:1147: error: undefined reference to 'cpuset_or'
./nsd.c:1321: error: undefined reference to 'set_cpu_affinity'
./server.c:1575: error: undefined reference to 'set_cpu_affinity'
collect2: error: ld returned 1 exit status

One other comment about this in compat/cpuset.h... Are those datatypes correct for i386/i686 builds? That is, should size_t be used, or should uint64_t be used?

#ifndef HAVE_CPUID_T
#ifdef __linux__
typedef int cpuid_t;
#endif
#ifdef __FreeBSD__
typedef size_t cpuid_t;
#endif
#endif

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

See the fix in #76, that should also fix this one, for the cpuid_t issue. Thanks for the detailed information, by the way, that helps dig through the issue. Then about the issues you get after the cpuid_t is fixed.

from nsd.

wcawijngaards avatar wcawijngaards commented on August 18, 2024

Committed a fix that uses configure to test for the features, instead of just having linux and freebsd specific code. That may not work, if the system has cpuset_t but nothing else, but may work for more systems, by the detection in configure. Perhaps this works for the compile on your target system too, DragonFlyBSD and GNU Hurd.

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.