Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation Errors on FreeBSD #145

Open
open-trap opened this issue Feb 6, 2023 · 1 comment
Open

Compilation Errors on FreeBSD #145

open-trap opened this issue Feb 6, 2023 · 1 comment

Comments

@open-trap
Copy link

Problem description

gmake fails during boringssl's handshaker.cc test with declaration scope errors and unused function errors.

What changes are required to compile on FreeBSD? The Linux curl-impersonate binary works on FreeBSD using the Linux compatibility layer, but can't be linked to when installing Python packages with pip (FreeBSD ld can't "find" curl-impersonate-chrome.so to link to because it's the wrong ELF).

Build environment inside clean 13.1-RELEASE jail

root:~ # pkg install pkgconf curl cmake gcc unzip go ninja gmake bash perl5.35
root:~ # setenv CC /usr/local/bin/gcc; setenv CXX /usr/local/bin/g++

Error messages

[18/26] Building CXX object ssl/test/CMakeFiles/handshaker.dir/handshaker.cc.o
FAILED: ssl/test/CMakeFiles/handshaker.dir/handshaker.cc.o
/usr/local/bin/g++ -DBORINGSSL_IMPLEMENTATION -I/root/curl-impersonate/build/boringssl/third_party/googletest/include -I/root/curl-impersonate/build/boringssl/ssl/test/../../include -Werror -Wformat=2 -Wsign-compare -Wmissing-field-initializers -Wwrite-strings -Wvla -Wshadow -ggdb -Wall -fvisibility=hidden -fno-common -Wno-free-nonheap-object -Wimplicit-fallthrough -Wmissing-declarations -std=c++11 -fno-exceptions -fno-rtti -O3 -DNDEBUG -fPIE -MD -MT ssl/test/CMakeFiles/handshaker.dir/handshaker.cc.o -MF ssl/test/CMakeFiles/handshaker.dir/handshaker.cc.o.d -o ssl/test/CMakeFiles/handshaker.dir/handshaker.cc.o -c /root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc: In function 'bool {anonymous}::Handshaker(const TestConfig*, int, int, bssl::Span<const unsigned char>, int)':
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:96:18: error: 'kControlMsgWantRead' was not declared in this scope
   96 |       char msg = kControlMsgWantRead;
      |                  ^~~~~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:99:18: error: 'kControlMsgWriteCompleted' was not declared in this scope
   99 |           msg != kControlMsgWriteCompleted) {
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:127:14: error: 'kControlMsgDone' was not declared in this scope
  127 |   char msg = kControlMsgDone;
      |              ^~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc: In function 'bool {anonymous}::GenerateHandshakeHint(const TestConfig*, bssl::Span<const unsigned char>, int)':
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:191:16: error: 'kControlMsgError' was not declared in this scope
  191 |     char msg = kControlMsgError;
      |                ^~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:205:14: error: 'kControlMsgDone' was not declared in this scope
  205 |   char msg = kControlMsgDone;
      |              ^~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc: In function 'int {anonymous}::SignalError()':
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:216:20: error: 'kControlMsgError' was not declared in this scope
  216 |   const char msg = kControlMsgError;
      |                    ^~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:217:19: error: 'kFdControl' was not declared in this scope
  217 |   if (write_eintr(kFdControl, &msg, 1) != 1) {
      |                   ^~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc: In function 'int main(int, char**)':
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:248:28: error: 'kFdControl' was not declared in this scope
  248 |   ssize_t len = read_eintr(kFdControl, request.data(), request.size());
      |                            ^~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:260:29: error: 'kFdProxyToHandshaker' was not declared in this scope
  260 |     if (!Handshaker(config, kFdProxyToHandshaker, kFdHandshakerToProxy,
      |                             ^~~~~~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:260:51: error: 'kFdHandshakerToProxy' was not declared in this scope
  260 |     if (!Handshaker(config, kFdProxyToHandshaker, kFdHandshakerToProxy,
      |                                                   ^~~~~~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc: At global scope:
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:137:6: error: 'bool {anonymous}::GenerateHandshakeHint(const TestConfig*, bssl::Span<const unsigned char>, int)' defined but not used [-Werror=unused-function]
  137 | bool GenerateHandshakeHint(const TestConfig *config,
      |      ^~~~~~~~~~~~~~~~~~~~~
/root/curl-impersonate/build/boringssl/ssl/test/handshaker.cc:55:6: error: 'bool {anonymous}::Handshaker(const TestConfig*, int, int, bssl::Span<const unsigned char>, int)' defined but not  used [-Werror=unused-function]
   55 | bool Handshaker(const TestConfig *config, int rfd, int wfd,
      |      ^~~~~~~~~~
cc1plus: all warnings being treated as errors
[24/26] Building CXX object decrepit/CMakeFiles/decrepit_test.dir/xts/xts_test.cc.o
ninja: build stopped: subcommand failed.
gmake: *** [Makefile:267: /root/curl-impersonate/build/boringssl/build/lib/libssl.a] Error 1

Other details

root:~ # file -sL curl-impersonate/curl-impersonate-chrome
curl-impersonate/curl-impersonate-chrome: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=8cbd1933a3b32efaaad4d3e1dfc5dbfd337e86ab, for GNU/Linux 3.2.0, stripped

root:~ # ldd curl-impersonate/curl-impersonate-chrome
curl-impersonate/curl-impersonate-chrome:
        linux_vdso.so.1 (0x00007ffffffff000)
        libz.so.1 => /lib/x86_64-linux-gnu/libz.so.1 (0x0000000801352000)
        libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x000000080136e000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x0000000801391000)
        /lib64/ld-linux-x86-64.so.2 (0x0000000801318000)
@lwthiker
Copy link
Owner

lwthiker commented Mar 2, 2024

I just tried building curl-impersonate on FreeBSD with the new boringssl version (#217). Unfortunately, it fails due to errors in upstream boringssl.

/root/curl-impersonate/build/boringssl/crypto/rand_extra/getentropy.c:38:9: error: implicit declaration of function 'getentropy'

I'll keep this issue open until upstream boringssl resolves this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants