oxen-io / lokinet

Lokinet is an anonymous, decentralized and IP based overlay network for the internet.
https://lokinet.org/
GNU General Public License v3.0
1.71k stars 220 forks source link

Build on FreeBSD 13.2-RELEASE-p4 fails with zlib 1.2.13 404 not found and undefined symbol: llarp::sys::service_manager after zlib url fix #2222

Open imlauera opened 8 months ago

imlauera commented 8 months ago
$ doas pkg install cmake git pkgconf autotools
$ git clone --recursive https://github.com/oxen-io/lokinet
$ cd lokinet
$ mkdir build
$ cd build
$ cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DBUILD_STATIC_DEPS=ON ..
$ make
[  2%] Built target libuv_external
[  2%] Performing download step (download, verify and extract) for 'zlib_external'
-- verifying file...
       file='/home/me/lokinet/build/static-deps-sources/src/zlib-1.2.13.tar.xz'
-- SHA256 hash of
    /home/me/lokinet/build/static-deps-sources/src/zlib-1.2.13.tar.xz
  does not match expected value
    expected: 'd14c38e313afc35a9a8760dadf26042f51ea0f5d154b0630a31da0540107fb98'
      actual: 'e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855'
-- File already exists but hash mismatch. Removing...
-- Downloading...
   dst='/home/me/lokinet/build/static-deps-sources/src/zlib-1.2.13.tar.xz'
   timeout='none'
   inactivity timeout='none'
-- Using src='https://zlib.net/zlib-1.2.13.tar.xz'
CMake Error at zlib_external-stamp/download-zlib_external.cmake:170 (message):
  Each download failed!

    error: downloading 'https://zlib.net/zlib-1.2.13.tar.xz' failed
          status_code: 22
          status_string: "HTTP response code said error"
          log:
          --- LOG BEGIN ---
            Trying 85.187.148.2:443...

  Connected to zlib.net (85.187.148.2) port 443 (#0)

  ALPN: offers h2

  ALPN: offers http/1.1

  [5 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS handshake, Client hello (1):

  [512 bytes data]

  [5 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Server hello (2):

  [122 bytes data]

  [5 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Encrypted Extensions (8):

  [25 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Certificate (11):

  [4631 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, CERT verify (15):

  [264 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Finished (20):

  [52 bytes data]

  [5 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS change cipher, Change cipher spec
  (1):

  [1 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS handshake, Finished (20):

  [52 bytes data]

  SSL connection using TLSv1.3 / TLS_AES_256_GCM_SHA384

  ALPN: server accepted http/1.1

  Server certificate:

   subject: CN=zlib.net
   start date: Oct 29 00:00:00 2023 GMT
   expire date: Jan 27 23:59:59 2024 GMT
   subjectAltName: host "zlib.net" matched cert's "zlib.net"
   issuer: C=US; ST=TX; L=Houston; O=cPanel, Inc.; CN=cPanel, Inc. Certification Authority
   SSL certificate verify result: unable to get local issuer certificate (20), continuing anyway.

  [5 bytes data]

  [1 bytes data]

  GET /zlib-1.2.13.tar.xz HTTP/1.1

  Host: zlib.net

  User-Agent: curl/7.87.0

  Accept: */*

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

  [281 bytes data]

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):

  [281 bytes data]

  old SSL session ID is stale, removing

  [5 bytes data]

  [1 bytes data]

  Mark bundle as not supporting multiuse

  HTTP/1.1 404 Not Found

  Date: Sun, 05 Nov 2023 21:52:23 GMT

  Server: Apache

  Strict-Transport-Security: max-age=63072000; includeSubDomains

  X-Frame-Options: SAMEORIGIN

  X-Content-Type-Options: nosniff

  Content-Length: 315

  Content-Type: text/html; charset=iso-8859-1

  The requested URL returned error: 404

  Closing connection 0

  [5 bytes data]

  [1 bytes data]

  [CONN-0-0][CF-SSL] TLSv1.3 (OUT), TLS alert, close notify (256):

  [2 bytes data]

          --- LOG END ---

*** Error code 1

Stop.
make[2]: stopped in /usr/home/me/lokinet/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/me/lokinet/build
*** Error code 1

Stop.
make: stopped in /usr/home/me/lokinet/build

If I change the zlib mirror url in cmakecache.txt gives me this output:

$ make
[  2%] Built target libuv_external
[  2%] Performing build step for 'zlib_external'
ld: error: undefined symbol: zlibVersion
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: zlibCompileFlags
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: compress
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: uncompress
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzopen
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzputc
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzputs
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzprintf
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzseek
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzclose
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzread
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gztell
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzungetc
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: gzgets
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)

ld: error: undefined symbol: deflateInit_
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 1 more times

ld: error: undefined symbol: deflate
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 6 more times

ld: error: undefined symbol: deflateEnd
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 1 more times

ld: error: undefined symbol: inflateInit_
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 1 more times

ld: error: undefined symbol: inflate
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 2 more times

ld: error: undefined symbol: inflateEnd
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced by ld-temp.o
>>>               lto.tmp:(main)
>>> referenced 1 more times

ld: error: too many errors emitted, stopping now (use -error-limit=0 to see all errors)
cc: error: linker command failed with exit code 1 (use -v to see invocation)
*** Error code 1

Stop.
make[3]: stopped in /usr/home/esotericwarfare/lokinet/build/static-deps-sources/src/zlib_external
*** Error code 1

Stop.
make[2]: stopped in /usr/home/esotericwarfare/lokinet/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/esotericwarfare/lokinet/build
*** Error code 1

Stop.
make: stopped in /usr/home/esotericwarfare/lokinet/build

Those errors go away if I build it using this command

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DBUILD_STATIC_DEPS=ON   -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ ..

but it still fails at 91% with undefined llarp::sys::service_manager error

And if I tried with gcc and g++ with this command I get this error:

cmake -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DSTATIC_LINK=ON -DBUILD_STATIC_DEPS=ON   -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ ..

$ make
[ 34%] Building CXX object CMakeFiles/proxy_thr.dir/perf/proxy_thr.cpp.o
[ 34%] Linking CXX executable bin/proxy_thr
[ 34%] Built target proxy_thr
[ 34%] Building CXX object CMakeFiles/benchmark_radix_tree.dir/perf/benchmark_radix_tree.cpp.o
[ 34%] Linking CXX executable bin/benchmark_radix_tree
[ 34%] Built target benchmark_radix_tree
[ 34%] Building C object tests/CMakeFiles/unity.dir/__/external/unity/unity.c.o
[ 35%] Linking C static library ../lib/libunity.a
[ 35%] Built target unity
[ 36%] Building CXX object tests/CMakeFiles/testutil-static.dir/testutil.cpp.o
In file included from /home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.cpp:29:
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:221:38: error: 'AF_INET' was not declared in this scope
  221 |                      const int af_ = AF_INET,
      |                                      ^~~~~~~
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:221:38: note: the macro 'AF_INET' had not yet been defined
In file included from /home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.cpp:56:
/usr/include/sys/socket.h:224: note: it was later defined here
  224 | #define AF_INET         2               /* internetwork: UDP, TCP, etc. */
      | 
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:222:44: error: 'IPPROTO_TCP' was not declared in this scope
  222 |                      const int protocol_ = IPPROTO_TCP);
      |                                            ^~~~~~~~~~~
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:222:44: note: the macro 'IPPROTO_TCP' had not yet been defined
In file included from /home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.cpp:58:
/usr/include/netinet/in.h:45: note: it was later defined here
   45 | #define IPPROTO_TCP             6               /* tcp */
      | 
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:232:48: error: 'AF_INET' was not declared in this scope
  232 |                                const int af_ = AF_INET,
      |                                                ^~~~~~~
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:232:48: note: the macro 'AF_INET' had not yet been defined
/usr/include/sys/socket.h:224: note: it was later defined here
  224 | #define AF_INET         2               /* internetwork: UDP, TCP, etc. */
      | 
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:233:54: error: 'IPPROTO_TCP' was not declared in this scope
  233 |                                const int protocol_ = IPPROTO_TCP);
      |                                                      ^~~~~~~~~~~
/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external/tests/testutil.hpp:233:54: note: the macro 'IPPROTO_TCP' had not yet been defined
/usr/include/netinet/in.h:45: note: it was later defined here
   45 | #define IPPROTO_TCP             6               /* tcp */
      | 
cc1plus: note: unrecognized command-line option '-Wno-tautological-constant-compare' may have been intended to silence earlier diagnostics
*** Error code 1

Stop.
make[5]: stopped in /usr/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external-build
*** Error code 1

Stop.
make[4]: stopped in /usr/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external-build
*** Error code 1

Stop.
make[3]: stopped in /usr/home/esotericwarfare/lokinet/build/libzmq/src/libzmq_external-build
*** Error code 1

Stop.
make[2]: stopped in /usr/home/esotericwarfare/lokinet/build
*** Error code 1

Stop.
make[1]: stopped in /usr/home/esotericwarfare/lokinet/build
*** Error code 1

Stop.
make: stopped in /usr/home/esotericwarfare/lokinet/build