Comments (3)
% 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.
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.
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)
- Build errors for 4.10.0rc1 HOT 11
- multiple "xfrd: zone %s written received XFR packet from %s with serial %u to " logged HOT 3
- RFC8482 behavior documentation HOT 1
- Minor recursive Makefile issue
- mutual tls authentication is not complete HOT 2
- nsd verification processing hangs, activity stopped for 20-30 minutes HOT 3
- NSD 4.10.0's `nsd-checkzone` cannot read zonefiles from `stdin`
- are flex and bison still required? HOT 1
- nsd 4.10.0 x86 builds failed HOT 2
- zonefile with $include relative path stopped working HOT 1
- Update simdzone HOT 2
- Assertion `token->code == RIGHT_PAREN' failed HOT 14
- Adjust verbosity for TLS (+TCP) to be 5 HOT 1
- Select simdzone kernel on start HOT 1
- Document compile options in `doc/README`?
- Timeout events not handled correctly in `mini-event`?
- Build failure on Solaris 10
- FreeBSD on version 4.10.0 HOT 5
- Read client certificates before dropping privileges
- Bugs/notes related to Mutual TLS HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nsd.