Chromium does not compile under FreeBSD 13.3

You are using /usr/local/bin/ld instead of /compat/linux/opt/rh/devtoolset-11/root/usr/bin/ld.(bfd|gold) for some reason.

it does not seem that the error is due to a "wrong / generic / unknown" reason because ld is used by default instead of ld.bfd|gold ; ld.bdf|gold is not used by default as soon as the user tries to compile the port "foreign-cdm" ; in my opinion something should be changed in the code of the port to make the latter as default. Not very experienced users don't know how to do it : to see the port that stops to be compiled for a very technical reason that hasn't been simplified automatically is not good.
 
GCC knows the path to its own linker by default. Most likely CMake overrides it. CMake is a completely unpredictable piece of crap, so dial your expectations down a bit.
 
I didn't use your repo,but the port. And this is what happened :


I can use your repo,but this does not help me,because now I should know how to use your repo and the error remains unfixed on the port.
 
Code:
[root@marietto /home/marietto/Downloads]==> git clone https://github.com/shkhln/foreign-cdm.git
[root@marietto /home/marietto/Downloads]==> cd foreign-cdm
[root@marietto ~marietto/Downloads/foreign-cdm]==> ./chrome.sh
ld-elf.so.1: Cannot open "/usr/home/marietto/Downloads/foreign-cdm/build/override-fbsd.so"

[root@marietto ~marietto/Downloads/foreign-cdm]==> make

mkdir -p build/capnp-fbsd
env CXXFLAGS="-O2 -pipe -Wall -Wextra -Wno-unused-parameter -include 'netinet/in.h' -fPIC" cmake -S third_party/capnproto -B build/capnp-fbsd  -DWITH_ZLIB=OFF -DWITH_OPENSSL=OFF -DWITH_FIBERS=OFF -DBUILD_TESTING=OFF
CMake Error: The source directory "/usr/home/marietto/Downloads/foreign-cdm/third_party/capnproto" does not appear to contain CMakeLists.txt.
Specify --help for usage, or press the help button on the CMake GUI.
*** Error code 1
 
Code:
# portsnap fetch extract
OK.

# portsnap fetch update
OK.

[root@marietto /usr/ports/www/foreign-cdm]==> make MAKE_JOBS_UNSAFE=yes

-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++
-- Check for working CXX compiler: /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++ - broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24'
   
    Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/local/bin/gmake -f Makefile cmTC_1ad88/fast
    gmake[1]: Entering directory '/usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24'
    /usr/local/bin/gmake  -f CMakeFiles/cmTC_1ad88.dir/build.make CMakeFiles/cmTC_1ad88.dir/build
    gmake[2]: Entering directory '/usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24'
    Building CXX object CMakeFiles/cmTC_1ad88.dir/testCXXCompiler.cxx.o
    /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++   -Wall -Wextra -Wno-unused-parameter --sysroot=/compat/linux -O2 -std=c++17 -fPIC  -o CMakeFiles/cmTC_1ad88.dir/testCXXCompiler.cxx.o -c /usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24/testCXXCompiler.cxx
    *** stack smashing detected ***: terminated
    gmake[2]: *** [CMakeFiles/cmTC_1ad88.dir/build.make:78: CMakeFiles/cmTC_1ad88.dir/testCXXCompiler.cxx.o] Abort trap (core dumped)
    gmake[2]: Leaving directory '/usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24'
    gmake[1]: *** [Makefile:127: cmTC_1ad88/fast] Error 2
    gmake[1]: Leaving directory '/usr/ports/www/foreign-cdm/work/foreign-cdm-3fe4d7130bb1e0581b5310635515a120f2794b88/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-z8XH24'

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)

-- Configuring incomplete, errors occurred!
 
The foreign-cdm port available on FreeBSD is linked to his github ? Because I've upgraded the ports tree,so also the foreign-cdm port,but I get the same error.
 
Thanks for the hint , grahamperrin :

Code:
[root@marietto ~marietto/Downloads]==> git clone https://github.com/shkhln/foreign-cdm.git

Clone in 'foreign-cdm' in corso...
remote: Enumerating objects: 248, done.
remote: Counting objects: 100% (59/59), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 248 (delta 39), reused 44 (delta 25), pack-reused 189
Ricezione degli oggetti: 100% (248/248), 57.70 KiB | 1.09 MiB/s, fatto.
Risoluzione dei delta: 100% (162/162), fatto.

[root@marietto ~marietto/Downloads]==> cd foreign-cdm

[root@marietto ~marietto/Downloads/foreign-cdm]==> git submodule init                              
Sottomodulo 'third_party/capnproto' (https://github.com/capnproto/capnproto.git) registrato per il percorso 'third_party/capnproto'
Sottomodulo 'third_party/cdm' (https://chromium.googlesource.com/chromium/cdm) registrato per il percorso 'third_party/cdm'

[root@marietto ~marietto/Downloads/foreign-cdm]==> git submodule update
                            
Clone in '/usr/home/marietto/Downloads/foreign-cdm/third_party/capnproto' in corso...
Clone in '/usr/home/marietto/Downloads/foreign-cdm/third_party/cdm' in corso...
Submodule path 'third_party/capnproto': checked out '928c8390d4d562bd32dc79a42eb64e9bdba572d8'
Submodule path 'third_party/cdm': checked out 'fef0b5aa1bd31efb88dfab804bdbe614f3d54f28'

[root@marietto ~marietto/Downloads/foreign-cdm]==> make
....
[ 98%] Building CXX object c++/src/capnp/CMakeFiles/capnpc_capnp.dir/compiler/capnpc-capnp.c++.o
[100%] Linking CXX executable capnpc-capnp
[100%] Built target capnpc_capnp
./build/capnp-fbsd/c++/src/capnp/capnp compile -obuild/capnp-fbsd/c++/src/capnp/capnpc-c++ src/cdm.capnp
mkdir -p build
cc -O2 -pipe -Wall -Wextra -Wno-unused-parameter -DKJ_DEBUG -Ithird_party -Ithird_party/capnproto/c++/src -fPIC -shared -o build/fcdm-fbsd.so  -Wl,--whole-archive  build/capnp-fbsd/c++/src/capnp/libcapnpc.a  build/capnp-fbsd/c++/src/capnp/libcapnp-rpc.a  build/capnp-fbsd/c++/src/capnp/libcapnp.a  build/capnp-fbsd/c++/src/kj/libkj-async.a  build/capnp-fbsd/c++/src/kj/libkj.a  -Wl,--no-whole-archive  src/cdm.capnp.c++  src/lib.cpp  -pthread
src/lib.cpp:46:38: warning: private field 'm_worker_pid' is not used [-Wunused-private-field]
  pid_t                              m_worker_pid;
                                     ^
1 warning generated.
mkdir -p build/capnp-linux
env CXX="/compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++" CXXFLAGS="-Wall -Wextra -Wno-unused-parameter --sysroot=/compat/linux -O2 -std=c++17 -fPIC" cmake -S third_party/capnproto -B build/capnp-linux  -DWITH_ZLIB=OFF -DWITH_OPENSSL=OFF -DWITH_FIBERS=ON -DBUILD_TESTING=OFF -DCMAKE_LINKER="/compat/linux/opt/rh/devtoolset-11/root/usr/bin/ld.bfd"
CMake Deprecation Warning at CMakeLists.txt:1 (cmake_minimum_required):
  Compatibility with CMake < 3.5 will be removed from a future version of
  CMake.

  Update the VERSION argument <min> value or use a ...<max> suffix to tell
  CMake that the project does not need compatibility with older versions.


-- The CXX compiler identification is unknown
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++
-- Check for working CXX compiler: /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++ - broken
CMake Error at /usr/local/share/cmake/Modules/CMakeTestCXXCompiler.cmake:60 (message):
  The C++ compiler

    "/compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB'
 
    Run Build Command(s): /usr/local/bin/cmake -E env VERBOSE=1 /usr/local/bin/gmake -f Makefile cmTC_7bb78/fast
    gmake[1]: ingresso nella directory «/usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB»
    /usr/local/bin/gmake  -f CMakeFiles/cmTC_7bb78.dir/build.make CMakeFiles/cmTC_7bb78.dir/build
    gmake[2]: ingresso nella directory «/usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB»
    Building CXX object CMakeFiles/cmTC_7bb78.dir/testCXXCompiler.cxx.o
    /compat/linux/opt/rh/devtoolset-11/root/usr/bin/g++   -Wall -Wextra -Wno-unused-parameter --sysroot=/compat/linux -O2 -std=c++17 -fPIC  -o CMakeFiles/cmTC_7bb78.dir/testCXXCompiler.cxx.o -c /usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB/testCXXCompiler.cxx
    *** stack smashing detected ***: terminated
    gmake[2]: *** [CMakeFiles/cmTC_7bb78.dir/build.make:78: CMakeFiles/cmTC_7bb78.dir/testCXXCompiler.cxx.o] Abort trap (creato dump del core)
    gmake[2]: uscita dalla directory «/usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB»
    gmake[1]: *** [Makefile:127: cmTC_7bb78/fast] Error 2
    gmake[1]: uscita dalla directory «/usr/home/marietto/Downloads/foreign-cdm/build/capnp-linux/CMakeFiles/CMakeScratch/TryCompile-0eSnBB»

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:2 (project)


-- Configuring incomplete, errors occurred!
*** Error code 1

Stop.
make: stopped in /usr/home/marietto/Downloads/foreign-cdm

unfortunately the bug hasn't been fixed.
 
I suppose that I should add linux_enable="yes" inside /etc/rc.conf ; btw I can't because I need to add ubuntu2310_enable="YES",instead,since I've installed some useful tools within the ubuntu2310 "vm".
I can't use both. Is there a chance to merge what is required from /compat/linux to /compat/ubuntu2310 ?
What should I merge in /compat/ubuntu2310 ?
 
I suppose that I should add linux_enable="yes" inside /etc/rc.conf ; btw I can't because I need to add ubuntu2310_enable="YES",instead,since I've installed some useful tools within the ubuntu2310 "vm".
I can't use both. Is there a chance to merge what is required from /compat/linux to /compat/ubuntu2310 ?
What should I merge in /compat/ubuntu2310 ?

You have to have linux_enable to install the cdm stuff (not that that is working right now...).
 
you cant have 2 instances of the linuxulator running at the same time

you have to edit your /etc/rc.conf and enable linux and disable ubuntu
then reboot

Code:
linux_enable="YES"
ubuntu_enable="NO"

after you have rebooted with linux enabled the ubuntu chroot wont work
until you reverse the settings and reboot

not sure what your trying to do
looks like you are building foreign-cdm and then trying to copy something into the chroot
 
you cant have 2 instances of the linuxulator running at the same time

you have to edit your /etc/rc.conf and enable linux and disable ubuntu
then reboot

Code:
linux_enable="YES"
ubuntu_enable="NO"

after you have rebooted with linux enabled the ubuntu chroot wont work
until you reverse the settings and reboot

not sure what your trying to do
looks like you are building foreign-cdm and then trying to copy something into the chroot

No,I can't remove ubuntu2310_enable="YES" from /etc/rc.conf ; I want to copy the cdm stuff from /compat/linux to /compat/ubuntu2310 ; but to do this I need to know where this stuff is located.
 
No,I can't remove ubuntu2310_enable="YES" from /etc/rc.conf ; I want to copy the cdm stuff from /compat/linux to /compat/ubuntu2310 ; but to do this I need to know where this stuff is located.
Code:
% pkg info -l foreign-cdm
foreign-cdm-20231203:
    /usr/local/lib/foreign-cdm/fcdm-fbsd.so
    /usr/local/libexec/fcdm-jail
    /usr/local/libexec/fcdm-worker
    /usr/local/share/chromium/WidevineCdm/_platform_specific/linux_x64/libwidevinecdm.so
    /usr/local/share/chromium/WidevineCdm/manifest.json
    /usr/local/share/foreign-cdm/fcdm-setup-env
    /usr/local/share/licenses/foreign-cdm-20231203/LICENSE
    /usr/local/share/licenses/foreign-cdm-20231203/MIT
    /usr/local/share/licenses/foreign-cdm-20231203/catalog.mk
 
Back
Top