knot-resolver 4 won't build on macos because of ld: -pagezero_size option
Hi there, I am trying to compile the new version on macos but it seems to be failing because of this issue, even though the workaround is on meson.build it seems to be having the same effect.
Steps to reproduce:
git clone https://github.com/CZ-NIC/knot-resolver.git
...
The Meson build system
Version: 0.50.1
Source dir: /Users/jayson/src/knot-resolver
Build dir: /Users/jayson/src/knot-resolver/build
Build type: native build
Project name: knot-resolver
Project version: 4.0.0
Native C compiler: cc (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
Native C++ compiler: c++ (clang 10.0.1 "Apple LLVM version 10.0.1 (clang-1001.0.46.4)")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Message: --- required dependencies ---
Found pkg-config: /usr/local/bin/pkg-config (0.29.2)
Dependency libknot found: YES 2.8.1
Dependency libdnssec found: YES 2.8.1
Dependency libzscanner found: YES 2.8.1
Dependency libuv found: YES 1.28.0
Found CMake: /usr/local/bin/cmake (3.14.3)
Dependency lmdb found: NO (tried pkgconfig, cmake and framework)
Library lmdb found: YES
Dependency gnutls found: YES 3.6.7
Dependency luajit found: YES 2.0.5
Message: ------------------------------
Message: --- systemd socket activation ---
Dependency libsystemd found: NO (tried pkgconfig, cmake and framework)
Message: ---------------------------
Configuring kresconfig.h using configuration
Message: --- client dependencies ---
Dependency libedit found: NO (tried pkgconfig, cmake and framework)
Library edit found: YES
Message: ---------------------------
Configuring trust_anchors.lua using configuration
Configuring sandbox.lua using configuration
Program ./kres-gen.sh found: YES (/Users/jayson/src/knot-resolver/daemon/lua/./kres-gen.sh)
Message: --- dnstap module dependencies ---
Dependency libprotobuf-c found: YES 1.3.1
Dependency libfstrm found: YES 0.5.0
Program protoc-c found: YES (/usr/local/bin/protoc-c)
Message: ----------------------------------
Configuring http.lua using configuration
Message: --- unit_tests dependencies ---
Dependency cmocka found: YES 1.1.5
Message: -------------------------------
Configuring kresd.8 using configuration
Program ../scripts/make-doc.sh found: YES (/Users/jayson/src/knot-resolver/doc/../scripts/make-doc.sh)
Configuring config.cluster using configuration
Configuring config.docker using configuration
Configuring config.isp using configuration
Configuring config.personal using configuration
Configuring config.splitview using configuration
Configuring kresd.conf using configuration
Message: --- lint dependencies ---
Program clang-tidy found: NO
Program luacheck found: NO
Program flake8 found: NO
Program scripts/run-pylint.sh found: YES (/Users/jayson/src/knot-resolver/scripts/run-pylint.sh)
Message: -------------------------
Message:
======================= SUMMARY =======================
paths
prefix: /usr/local
lib_dir: /usr/local/lib/knot-resolver
sbin_dir: /usr/local/sbin
etc_dir: /usr/local/etc/knot-resolver
root.hints: /usr/local/etc/knot-resolver/root.hints
trust_anchors
keyfile_default: /usr/local/etc/knot-resolver/root.keys
managed_ta: enabled
systemd:
socket activation: disabled
files: disabled
work_dir:
optional components
client: enabled
dnstap: enabled
unit_tests: enabled
config_tests: disabled
extra_tests: disabled
additional
user: knot-resolver
group: knot-resolver
install_kresd_conf: enabled
=======================================================
Build targets in project: 27
Found ninja-1.9.0 at /usr/local/bin/ninja
ninja -C build
ninja: Entering directory `build'
[46/100] Compiling C object 'daemon/f77b12a@@kresd@exe/bindings_net.c.o'.
../daemon/bindings/net.c:918:17: warning: unused variable 'engine' [-Wunused-variable]
struct engine *engine = engine_luaget(L);
^
../daemon/bindings/net.c:951:17: warning: unused variable 'engine' [-Wunused-variable]
struct engine *engine = engine_luaget(L);
^
2 warnings generated.
[52/100] Linking target lib/libkres.9.dylib.
FAILED: lib/libkres.9.dylib
cc -o lib/libkres.9.dylib 'lib/76b5a35@@kres@sha/cache_api.c.o' 'lib/76b5a35@@kres@sha/cache_cdb_lmdb.c.o' 'lib/76b5a35@@kres@sha/cache_entry_list.c.o' 'lib/76b5a35@@kres@sha/cache_entry_pkt.c.o' 'lib/76b5a35@@kres@sha/cache_entry_rr.c.o' 'lib/76b5a35@@kres@sha/cache_knot_pkt.c.o' 'lib/76b5a35@@kres@sha/cache_nsec1.c.o' 'lib/76b5a35@@kres@sha/cache_nsec3.c.o' 'lib/76b5a35@@kres@sha/cache_peek.c.o' 'lib/76b5a35@@kres@sha/dnssec.c.o' 'lib/76b5a35@@kres@sha/dnssec_nsec.c.o' 'lib/76b5a35@@kres@sha/dnssec_nsec3.c.o' 'lib/76b5a35@@kres@sha/dnssec_signature.c.o' 'lib/76b5a35@@kres@sha/dnssec_ta.c.o' 'lib/76b5a35@@kres@sha/generic_lru.c.o' 'lib/76b5a35@@kres@sha/generic_map.c.o' 'lib/76b5a35@@kres@sha/generic_queue.c.o' 'lib/76b5a35@@kres@sha/generic_trie.c.o' 'lib/76b5a35@@kres@sha/layer_cache.c.o' 'lib/76b5a35@@kres@sha/layer_iterate.c.o' 'lib/76b5a35@@kres@sha/layer_validate.c.o' 'lib/76b5a35@@kres@sha/module.c.o' 'lib/76b5a35@@kres@sha/nsrep.c.o' 'lib/76b5a35@@kres@sha/resolve.c.o' 'lib/76b5a35@@kres@sha/rplan.c.o' 'lib/76b5a35@@kres@sha/utils.c.o' 'lib/76b5a35@@kres@sha/zonecut.c.o' -Wl,-dead_strip_dylibs -Wl,-headerpad_max_install_names -shared -install_name @rpath/libkres.9.dylib -compatibility_version 9 -current_version 9 contrib/libcontrib.a /usr/local/Cellar/libuv/1.28.0/lib/libuv.dylib -lpthread -ldl -llmdb /usr/local/Cellar/knot/2.8.1/lib/libknot.dylib /usr/local/Cellar/knot/2.8.1/lib/libdnssec.dylib /usr/local/Cellar/gnutls/3.6.7.1/lib/libgnutls.dylib -pagezero_size 10000 -image_base 100000000 /usr/local/Cellar/luajit/2.0.5/lib/libluajit-5.1.dylib -Wl,-headerpad_max_install_names -Wl,-rpath,@loader_path/../contrib -Wl,-rpath,/usr/local/Cellar/knot/2.8.1/lib -Wl,-rpath,/usr/local/Cellar/gnutls/3.6.7.1/lib
ld: -pagezero_size option can only be used when linking a main executable
clang: error: linker command failed with exit code 1 (use -v to see invocation)
[65/100] Compiling C++ object 'modules/policy/6a19ea2@@ahocorasick@sha/lua-aho-corasick_ac_fast.cxx.o'.
ninja: build stopped: subcommand failed.
THank you in advance