Chromium does not compile under FreeBSD 13.3

Hello to everyone.

One of my systems is based on FreeBSD 13.3. Today I tried the installation of Chromium from ports but the compilation stopped when it tried to compile the port "webrtc". Maybe it stopped because a bug,but I'm not sure. I would like to read your opinion about what happens.

Code:
......
/usr/local/include  -c ../../third_party/webrtc/api/candidate.cc -o obj/third_party/webrtc/api/candidate/candidate.o
In file included from ../../third_party/webrtc/api/candidate.cc:11:
In file included from ../../third_party/webrtc/api/candidate.h:24:
In file included from ../../third_party/webrtc/rtc_base/socket_address.h:20:
In file included from ../../third_party/webrtc/rtc_base/ip_address.h:30:
../../third_party/webrtc/rtc_base/byte_order.h:114:18: error: use of undeclared identifier 'htobe16' 114 | uint16_t val = htobe16(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:119:18: error: use of undeclared identifier 'htobe32' 119 | uint32_t val = htobe32(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:124:18: error: use of undeclared identifier 'htobe64' 124 | uint64_t val = htobe64(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:131:10: error: use of undeclared identifier 'be16toh' 131 | return be16toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:137:10: error: use of undeclared identifier 'be32toh' 137 | return be32toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:143:10: error: use of undeclared identifier 'be64toh' 143 | return be64toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:147:18: error: use of undeclared identifier 'htole16' 147 | uint16_t val = htole16(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:152:18: error: use of undeclared identifier 'htole32' 152 | uint32_t val = htole32(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:157:18: error: use of undeclared identifier 'htole64' 157 | uint64_t val = htole64(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:164:10: error: use of undeclared identifier 'le16toh' 164 | return le16toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:170:10: error: use of undeclared identifier 'le32toh' 170 | return le32toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:176:10: error: use of undeclared identifier 'le64toh' 176 | return le64toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:189:10: error: use of undeclared identifier 'htobe16' 189 | return htobe16(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:193:10: error: use of undeclared identifier 'htobe32' 193 | return htobe32(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:197:10: error: use of undeclared identifier 'htobe64' 197 | return htobe64(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:201:10: error: use of undeclared identifier 'be16toh' 201 | return be16toh(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:205:10: error: use of undeclared identifier 'be32toh' 205 | return be32toh(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:209:10: error: use of undeclared identifier 'be64toh' 209 | return be64toh(n);
|          ^
18 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/chromium
*** Error code 1

Stop.
make: stopped in /usr/ports/www/chromium
 
../../third_party/webrtc/rtc_base/byte_order.h:201:10: error: use of undeclared identifier 'be16toh' 201 | return be16toh(n);
| ^
../../third_party/webrtc/rtc_base/byte_order.h:205:10: error: use of undeclared identifier 'be32toh' 205 | return be32toh(n);
| ^
../../third_party/webrtc/rtc_base/byte_order.h:209:10: error: use of undeclared identifier 'be64toh' 209 | return be64toh(n);
| ^
18 errors generated.
ninja: build stopped: subcommand failed.
*** Error code 1

Stop.
make[1]: stopped in /usr/ports/www/chromium
*** Error code 1
Looking at the error messages, and where the build stopped (make[1]: stopped in /usr/ports/www/chromium), I don't think there is a build failure in "webrtc", nor is a webrtc dependency missing.

Apparently third_party/webrtc/rtc_base/byte_order.h is included in the chromium source, considering there is a patch in the ports files directory ../ports/www/chromimum/files/patch-third__party_webrtc_rtc__base_byte__order.h

Is the ports tree up-to-date?
How did you update, git, otherwise?
Something in /etc/make.conf?
Try a fresh ports tree.
 
It is compiling. That bug comes out if you enable alsa and pulseaudio. But these options aren't up by default. Now I have chosen sndio and I'm not watching the error. I don't know if it's normal to be forced to keep disabled alsa e pulseaudio. I don't think so. I'm using a workaround. I think that we should be able to enable them.
 
Anyway,I'm compiling chromium because I'm not able to compile Firefox. Usually I use Firefox. If you want to help me,this is the post that I've created :


any help is appreciated.
 
Is the ports tree up-to-date?
How did you update, git, otherwise?
Something in /etc/make.conf?
Try a fresh ports tree.

yes. I updated it with portsnap :

Code:
# portsnap fetch extract
# portsnap fetch update

nano /etc/make.conf :

DEFAULT_VERSIONS+=ssl=openssl
 
I was convinced to be able to compile chromium with the default options,but I was wrong :

Code:
/usr/local/include -I/usr/local/include/glib-2.0 -I/usr/local/lib/glib-2.0/include -DPROTOBUF_ALLOW_DEPRECATED=1 -std=c++20 -Wno-trigraphs -fno-exceptions -fno-rtti -nostdinc++ -isystem../../third_party/libc++/src/include -isystem../../third_party/libc++abi/src/include -fvisibility-inlines-hidden -O2 -pipe -fstack-protector-strong -isystem /usr/local/include -fno-strict-aliasing  -isystem /usr/local/include  -c ../../third_party/webrtc/api/candidate.cc -o obj/third_party/webrtc/api/candidate/candidate.o

In file included from ../../third_party/webrtc/api/candidate.cc:11:
In file included from ../../third_party/webrtc/api/candidate.h:24:
In file included from ../../third_party/webrtc/rtc_base/socket_address.h:20:
In file included from ../../third_party/webrtc/rtc_base/ip_address.h:30:

../../third_party/webrtc/rtc_base/byte_order.h:114:18: error: use of undeclared identifier 'htobe16'  114 |   uint16_t val = htobe16(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:119:18: error: use of undeclared identifier 'htobe32'  119 |   uint32_t val = htobe32(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:124:18: error: use of undeclared identifier 'htobe64'  124 |   uint64_t val = htobe64(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:131:10: error: use of undeclared identifier 'be16toh'  131 |   return be16toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:137:10: error: use of undeclared identifier 'be32toh'  137 |   return be32toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:143:10: error: use of undeclared identifier 'be64toh'  143 |   return be64toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:147:18: error: use of undeclared identifier 'htole16'  147 |   uint16_t val = htole16(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:152:18: error: use of undeclared identifier 'htole32'  152 |   uint32_t val = htole32(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:157:18: error: use of undeclared identifier 'htole64'  157 |   uint64_t val = htole64(v);
|                  ^
../../third_party/webrtc/rtc_base/byte_order.h:164:10: error: use of undeclared identifier 'le16toh'  164 |   return le16toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:170:10: error: use of undeclared identifier 'le32toh'  170 |   return le32toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:176:10: error: use of undeclared identifier 'le64toh'  176 |   return le64toh(val);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:189:10: error: use of undeclared identifier 'htobe16'  189 |   return htobe16(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:193:10: error: use of undeclared identifier 'htobe32'  193 |   return htobe32(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:197:10: error: use of undeclared identifier 'htobe64'  197 |   return htobe64(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:201:10: error: use of undeclared identifier 'be16toh'  201 |   return be16toh(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:205:10: error: use of undeclared identifier 'be32toh'  205 |   return be32toh(n);
|          ^
../../third_party/webrtc/rtc_base/byte_order.h:209:10: error: use of undeclared identifier 'be64toh'  209 |   return be64toh(n);
 
Nothing to do. I've upgraded the ports several times but the bug is still there. Has that patch been approved ?
 
I've upgraded the ports tree several time,I removed the chromium config settings,I've deinstalled the ports that it has installed,but the error is still there.

PS : I can see the patch inside the chromium files that I have on my disk. The reason for the error could be different.
 
Code:
root@marietto:/usr/ports/www/chromium/files # nano patch-third__party_webrtc_rtc__base_byte__order.h

--- third_party/webrtc/rtc_base/byte_order.h.orig       2023-02-08 09:03:45 UTC
+++ third_party/webrtc/rtc_base/byte_order.h
@@ -90,6 +90,8 @@
#error WEBRTC_ARCH_BIG_ENDIAN or WEBRTC_ARCH_LITTLE_ENDIAN must be defined.
#endif  // defined(WEBRTC_ARCH_LITTLE_ENDIAN)

+#elif defined(WEBRTC_BSD)
+#include <sys/endian.h>
#elif defined(WEBRTC_POSIX)
#include <endian.h>
#else
 
Do you think reasonable that if I start the compilation with "make MAKE_JOBS_UNSAFE=yes",it applies the patches,otherwise,it doesn't ? is this written somewhere ?

root@marietto:/usr/ports/www/chromium # make MAKE_JOBS_UNSAFE=yes

To build Chromium, you should have around 2GB of memory
and around 14 GB of free disk space.

===> License BSD3CLAUSE LGPL21 MPL11 accepted by the user
===> chromium-122.0.6261.111 depends on file: /usr/local/sbin/pkg - found
===> Fetching all distfiles required by chromium-122.0.6261.111 for building
===> Extracting for chromium-122.0.6261.111
=> SHA256 Checksum OK for chromium-122.0.6261.111.tar.xz.
=> SHA256 Checksum OK for chrome-linux-122.0.6261.111-llvm17.profdata.tar.xz.
===> Patching for chromium-122.0.6261.111
===> Applying FreeBSD patches for chromium-122.0.6261.111 from /usr/ports/www/chromium/files
 
Code:
root@marietto-133:/usr/ports/www/firefox # make MAKE_JOBS_UNSAFE=yes

===>   firefox-124.0,2 depends on package: nspr>=4.32 - found
===>   firefox-124.0,2 depends on package: nss>=3.98 - not found

/!\ WARNING /!\

You have security/openssl installed but do not have
DEFAULT_VERSIONS+=ssl=openssl set in your make.conf
 
===> firefox-124.0,2 depends on package: nss>=3.98 - not found
so, that means either install or compile security/nss... Normally, the ports system will take care of that, rather than error out. One pitfall of ports is specifying circular dependencies by accident. Well, I personally can live with that, because I know how to troubleshoot my way out of a circular dependency.
 
Now I'm sure that Chromium does not compile correctly on FreeBSD 13.3 because I've installed it from scratch and then I've launched the compilation. Anyway,the error that I've got is not the same that I've got on my main installation. This time is the following one :

Code:
/compat/linux/opt/rh/devtoolset-11/root/usr/bin/gcc -Wall -Wextra -Wno-unused-parameter --sysroot=/compat/linux -02 -std=c99 -fPIC -shared -o build/override-linux.so src/override.c -ldl && chmod a+rX build/override-linux.so

ELF binary type "0" not known

sh : /compat/linux/opt/rh/devtoolset-11/root/usr/bin/gcc: exec format error

The port that fails is called "foreign-cdm".
 
Hi Mate, i know what the issue is

You need to install foreign-cdm and then build linux-widevine-cdm

 
Back
Top