Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
i686-pc-linux-musl-g++ not in /usr/lib/distcc[solved]
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Fri Jan 17, 2025 4:51 pm    Post subject: i686-pc-linux-musl-g++ not in /usr/lib/distcc[solved] Reply with quote

I am trying to setup distcc and cross compiling to compile i686 packages on my x86_64 laptop(both laptops have USE=-*)
while compiling mesa on the client I see these errors:
Code:
[21/3494] /usr/lib/distcc/bin/i686-pc-linux-musl-g++ -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/lib/Support -I/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm/lib/Support -I/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/include -I/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm/include  -DNDEBUG -O2 -march=atom -pipe -fomit-frame-pointer -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -fno-lifetime-dse -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-maybe-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-redundant-move -Wno-pessimizing-move -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -std=c++17 -MD -MT lib/Support/CMakeFiles/LLVMSupport.dir/Compression.cpp.o -MF lib/Support/CMakeFiles/LLVMSupport.dir/Compression.cpp.o.d -o lib/Support/CMakeFiles/LLVMSupport.dir/Compression.cpp.o -c /var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm/lib/Support/Compression.cppition -fvisibility-inlines-hidden -Werror=date-time -f
distcc[220] (dcc_build_somewhere) Warning: failed to distribute, running locally instead

and can find the following on the x86_64 machine:
Code:
t14 /usr/lib/distcc # tail -f /var/log/distccd.log
distccd[21008] (dcc_check_compiler_whitelist) CRITICAL! i686-pc-linux-musl-g++ not in /usr/lib/distcc or /usr/lib/distcc whitelist.
distccd[21008] (dcc_job_summary) client: 192.168.1.4:45028 OTHER exit:0 sig:0 core:0 ret:0 time:7378ms
distccd[21009] (dcc_check_compiler_whitelist) CRITICAL! i686-pc-linux-musl-g++ not in /usr/lib/distcc or /usr/lib/distcc whitelist.
distccd[21009] (dcc_job_summary) client: 192.168.1.4:45040 OTHER exit:0 sig:0 core:0 ret:0 time:7787ms
distccd[21010] (dcc_check_compiler_whitelist) CRITICAL! i686-pc-linux-musl-g++ not in /usr/lib/distcc or /usr/lib/distcc whitelist.
distccd[21010] (dcc_job_summary) client: 192.168.1.4:45044 OTHER exit:0 sig:0 core:0 ret:0 time:5029ms
distccd[21011] (dcc_check_compiler_whitelist) CRITICAL! i686-pc-linux-musl-g++ not in /usr/lib/distcc or /usr/lib/distcc whitelist.
distccd[21011] (dcc_job_summary) client: 192.168.1.4:56518 OTHER exit:0 sig:0 core:0 ret:0 time:5528ms
distccd[21012] (dcc_check_compiler_whitelist) CRITICAL! i686-pc-linux-musl-g++ not in /usr/lib/distcc or /usr/lib/distcc whitelist.
distccd[21012] (dcc_job_summary) client: 192.168.1.4:40706 OTHER exit:0 sig:0 core:0 ret:0 time:5937ms
t14 /usr/lib/distcc # ls -l
total 156
lrwxrwxrwx 1 root root  1 Jan 16 18:00 bin -> .
lrwxrwxrwx 1 root root 15 Jan 17 18:39 c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 c99 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-musl-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-musl-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-musl-gcc-13 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-pc-linux-musl-gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-unknown-linux-musl-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-unknown-linux-musl-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 i686-unknown-linux-musl-gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 17 18:39 x86_64-pc-linux-gnu-gcc-14 -> /usr/bin/distcc


i tried rebuilding the target using crossdev using this command but it did not work:
Code:
crossdev --target i686-pc-linux-musl --gcc 14 -s4 --force

I also tried using eselect to update the symlinks:
Code:
eselect compiler-shadow update all
Updating masquerade for distcc ...
'clang' -> '/usr/bin/distcc'
'clang-18' -> '/usr/bin/distcc'
'clang-19' -> '/usr/bin/distcc'
'clang++' -> '/usr/bin/distcc'
'clang++-18' -> '/usr/bin/distcc'
'clang++-19' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang-18' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang-19' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang-18' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang-19' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang++' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang++' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang++-18' -> '/usr/bin/distcc'
'i686-pc-linux-gnu-clang++-19' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang++-18' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-clang++-19' -> '/usr/bin/distcc'
'gcc' -> '/usr/bin/distcc'
'gcc-14' -> '/usr/bin/distcc'
'g++' -> '/usr/bin/distcc'
'g++-14' -> '/usr/bin/distcc'
'i686-pc-linux-musl-gcc' -> '/usr/bin/distcc'
'i686-unknown-linux-musl-gcc' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-gcc' -> '/usr/bin/distcc'
'i686-pc-linux-musl-gcc-14' -> '/usr/bin/distcc'
'i686-unknown-linux-musl-gcc-14' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-gcc-14' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-g++' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-g++-14' -> '/usr/bin/distcc'
'cc' -> '/usr/bin/distcc'
'c99' -> '/usr/bin/distcc'
'c++' -> '/usr/bin/distcc'
'i686-pc-linux-musl-cc' -> '/usr/bin/distcc'
'i686-unknown-linux-musl-cc' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-cc' -> '/usr/bin/distcc'
'x86_64-pc-linux-gnu-c++' -> '/usr/bin/distcc'


what am I doing wrong here?


Last edited by Adel Ahmed on Wed Jan 22, 2025 5:07 am; edited 1 time in total
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Fri Jan 17, 2025 5:06 pm    Post subject: Reply with quote

probably a bug/oversight, too many combinations, might want to b.g.o it. But first, does it work if you put in that link manually?

someday i should set up a musl system to see what benefits it gets...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Sun Jan 19, 2025 3:58 pm    Post subject: Reply with quote

putting in the link manually did not work
Code:
t14 /usr/lib/distcc # ./i686-pc-linux-musl-g++
distcc[19249] (dcc_execvp) ERROR: failed to exec i686-pc-linux-musl-g++: No such file or directory
distcc[19248] ERROR: compile (null) on localhost failed with exit code 110
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Sun Jan 19, 2025 7:00 pm    Post subject: Reply with quote

Well, that's still necessary (and it should be handled by portage/ebuild), then the other thing is why isn't i686-pc-linux-musl-g++ in the path of distccd ... where is the normal binary installed and is it in distccd's path?

(clang was a weird problem in the past for me... had one machine kept running old versions of clang and couldn't get it to run newer versions at all...)
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Mon Jan 20, 2025 7:17 am    Post subject: Reply with quote

the binary is not installed, I'm not sure why, i tried running crossdev again with the stage 4 option but it's not there:
Code:
t14 /usr/lib/distcc # locate i686-pc-linux-musl-g++
/usr/lib/distcc/i686-pc-linux-musl-g++
t14 /usr/lib/distcc # ls -l /usr/lib/distcc/i686-pc-linux-musl-g++
lrwxrwxrwx 1 root root 15 Jan 17 20:49 /usr/lib/distcc/i686-pc-linux-musl-g++ -> /usr/bin/distcc
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Mon Jan 20, 2025 5:01 pm    Post subject: Reply with quote

Is there a g++ somewhere? How is g++ being invoked normally/locally?
Can you symlink i686-pc-linux-musl-g++ to that binary?
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Mon Jan 20, 2025 5:27 pm    Post subject: Reply with quote

Adel Ahmed,

You are trying cross compile with distcc. You may want to review Gentoo wiki: Distcc/Cross-Compiling-Compiling

So, does your distcc helper have same crossdev target installed? does your distcc helper updated so it know how to invoke your crossdev target compiler?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Mon Jan 20, 2025 8:02 pm    Post subject: Reply with quote

I tried to create the symlink pointing to my executable under /usr/bin/g++
still getting the error though:
Code:
distccd[6344] (dcc_execvp) ERROR: failed to exec i686-pc-linux-musl-g++: No such file or directory
distccd[31519] (dcc_job_summary) client: 192.168.1.4:34116 COMPILE_ERROR exit:110 sig:0 core:0 ret:0 time:151ms i686-pc-linux-musl-g++ /usr/share/cmake/Modules/CMakeCXXCompilerABI.cpp


I also seee this in the build log:
Code:
-- Found assembler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc
-- Check for working C compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++ - skipped


it does feel a bit closer to the solution:
Code:
t14 /usr/lib/distcc/bin # /usr/lib/distcc/i686-pc-linux-musl-g++
i686-pc-linux-musl-g++: fatal error: no input files
compilation terminated.
t14 /usr/lib/distcc/bin # i686-pc-linux-musl-g++
-su: i686-pc-linux-musl-g++: command not found
t14 /usr/lib/distcc/bin # whereis i686-pc-linux-musl-g++
i686-pc-linux-musl-g++:


I read the document again, but I still don't know what I'm missing yet, my distcc helper has that crossdev target installed, i think it's updated to know how to invoke the compiler as it's able to invoke gcc but not g++
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Mon Jan 20, 2025 8:25 pm    Post subject: Reply with quote

So may be the file got accidentally deleted.

So let examine if any thing is missing from portage point of view first.

first use the known exist gcc by
Code:
which i686-pc-linux-musl-gcc


Now you got full path to i686-pc-linux-musl-gcc. please use
Code:
namei -l /path/to/i686-pc-linux-musl-gcc


This should gave you where the real binary location.

Now find which package own the binary by
Code:
qfile /path/to/the/real binary(i686-pc-linux-musl-gcc)


The qfile should return the category/package name.

Now verify with
Code:
qcheck category/package name


if qcheck report ok, then it would be a distcc configuration issue. or else you will need to rebuild your crossdev tool chain, something is missing.

You need to do this on both you build server and your distcc helper.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Tue Jan 21, 2025 3:59 am    Post subject: Reply with quote

Not sure where you made the symlinks but you should symlink i686-pc-linux-musl-g++ to g++ in the directory that g++ stands in, and then link i686-pc-linux-musl-g++ to distcc / distccd in the distcc shadow directories... Running i686-pc-linux-musl-g++ should not give you a No Such File or Directory error...

Also your path, when running locally, should point to the shadow directories first and then have i686-pc-linux-musl-g++ later in the path. distcc will do the path f**kery to find the correct g++ binary despite having the same name. For helper boxes the path should NOT include the distcc shadow directories.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 9:12 am    Post subject: Reply with quote

Code:
t14 /usr/bin # which i686-pc-linux-musl-gcc
/usr/bin/i686-pc-linux-musl-gcc
t14 /usr/bin # namei -l /usr/bin/i686-pc-linux-musl-gcc
f: /usr/bin/i686-pc-linux-musl-gcc
drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
lrwxrwxrwx root root i686-pc-linux-musl-gcc -> /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
drwxr-xr-x root root   /
drwxr-xr-x root root   usr
drwxr-xr-x root root   x86_64-pc-linux-gnu
drwxr-xr-x root root   i686-pc-linux-musl
drwxr-xr-x root root   gcc-bin
drwxr-xr-x root root   13
-rwxr-xr-x root root   i686-pc-linux-musl-gcc
t14 /usr/bin # qfile /usr/bin/i686-pc-linux-musl-gcc
t14 /usr/bin #
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 9:27 am    Post subject: Reply with quote

I symlinked symlink i686-pc-linux-musl-g++ to g++ in the directory that g++ stands in, and i686-pc-linux-musl-g++ to distcc / distccd in the distcc shadow directories
I no longer get the no file or directory error and the compilation fails with a new error:

Code:
t14 ~ #  i686-pc-linux-musl-g++
i686-pc-linux-musl-g++: fatal error: no input files
compilation terminated.
-- Check for working C compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/usr/lib/distcc/bin/i686-pc-linux-musl-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/CMakeFiles/CMakeScratch/TryCompile-giHpLN'
   
    Run Build Command(s): /usr/bin/ninja -v cmTC_0e810
    [1/2] /usr/lib/distcc/bin/i686-pc-linux-musl-g++    -DNDEBUG -O2 -march=atom -pipe -fomit-frame-pointer -o CMakeFiles/cmTC_0e810.dir/testCXXCompiler.cxx.o -c /var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/CMakeFiles/CMakeScratch/TryCompile-giHpLN/testCXXCompiler.cxx
    [2/2] : && /usr/lib/distcc/bin/i686-pc-linux-musl-g++ -O2 -march=atom -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--no-keep-memory CMakeFiles/cmTC_0e810.dir/testCXXCompiler.cxx.o -o cmTC_0e810   && :
    FAILED: cmTC_0e810
    : && /usr/lib/distcc/bin/i686-pc-linux-musl-g++ -O2 -march=atom -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--no-keep-memory CMakeFiles/cmTC_0e810.dir/testCXXCompiler.cxx.o -o cmTC_0e810   && :
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/cmTC_0e810.dir/testCXXCompiler.cxx.o' is incompatible with i386 output
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: CMakeFiles/cmTC_0e810.dir/testCXXCompiler.cxx.o: file class ELFCLASS64 incompatible with ELFCLASS32
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: final link failed: file in wrong format
    collect2: error: ld returned 1 exit status
    distcc[187] ERROR: compile (null) on localhost failed
    ninja: build stopped: subcommand failed.
   
   

 

  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:54 (project)
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Tue Jan 21, 2025 4:31 pm    Post subject: Reply with quote

Looks like you jumbled two command outputs? One is from emerge, one is manual?

Does your g++ work separately?

Here's a test C++ program you can use if you don't have one handy...
Code:
#include <iostream>
int main() {
std::cout << "Hello World\n";
return 0;
}


Code:
$ i686-pc-linux-musl-g++ -o /tmp/testbinary testprogram.cpp
$ /tmp/testbinary


Also it appears you have an amd64 box mixed...need to resolve this for the x86 box and amd64 box separately without distcc first...
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 4:59 pm    Post subject: Reply with quote

yes i have sorry about that, one is from emerge on the client, the other is from the distcc helper.
the compiler works on the helper(64 bit) machine:
Code:
adel@t14 ~ $ i686-pc-linux-musl-g++ -o /tmp/testbinary helloworld.cpp
adel@t14 ~ $ /tmp/testbinary
Hello World
adel@t14 ~ $ file /tmp/testbinary
/tmp/testbinary: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped

I'm noticing the binary is 64 bit one, during compilation on the 32 bit machine does it request a 32 bit binary? or is that something I have misconfigured?
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Tue Jan 21, 2025 5:03 pm    Post subject: Reply with quote

Adel Ahmed wrote:
yes i have sorry about that, one is from emerge on the client, the other is from the distcc helper.
the compiler works on the helper(64 bit) machine:
Code:
adel@t14 ~ $ i686-pc-linux-musl-g++ -o /tmp/testbinary helloworld.cpp
adel@t14 ~ $ /tmp/testbinary
Hello World
adel@t14 ~ $ file /tmp/testbinary
/tmp/testbinary: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped

I'm noticing the binary is 64 bit one, during compilation on the 32 bit machine does it request a 32 bit binary? or is that something I have misconfigured?


You can try add "-m32" to your test on you builder first. to see if it produce right object file.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Tue Jan 21, 2025 5:10 pm    Post subject: Reply with quote

Adel Ahmed wrote:
Code:
t14 /usr/bin # which i686-pc-linux-musl-gcc
/usr/bin/i686-pc-linux-musl-gcc
t14 /usr/bin # namei -l /usr/bin/i686-pc-linux-musl-gcc
f: /usr/bin/i686-pc-linux-musl-gcc
drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root bin
lrwxrwxrwx root root i686-pc-linux-musl-gcc -> /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
drwxr-xr-x root root   /
drwxr-xr-x root root   usr
drwxr-xr-x root root   x86_64-pc-linux-gnu
drwxr-xr-x root root   i686-pc-linux-musl
drwxr-xr-x root root   gcc-bin
drwxr-xr-x root root   13
-rwxr-xr-x root root   i686-pc-linux-musl-gcc
t14 /usr/bin # qfile /usr/bin/i686-pc-linux-musl-gcc
t14 /usr/bin #


please use
Code:
qfile /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
And do it on both helper and builder.

Then try
Code:
qcheck on the <output of qfile command>


from the current output you produced so far I expect qcheck should report OK, but just in case, We need to slowly manual eliminate possible condition first. I need to understand since I am not set in from of your computers I am not unable to confirm one way or the other especially I am not able to tell which output were produced by which computer and from what command.
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 5:48 pm    Post subject: Reply with quote

helper:
Code:
adel@t14 ~ $ qfile /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
cross-i686-pc-linux-musl/gcc: /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
adel@t14 ~ $ qcheck cross-i686-pc-linux-musl/gcc
Checking cross-i686-pc-linux-musl/gcc ...
  * 692 out of 692 files are good

builder:
Code:
root@cherry $ qfile /usr/x86_64-pc-linux-gnu/i686-pc-linux-musl/gcc-bin/13/i686-pc-linux-musl-gcc
root@cherry $


I notice the gcc version on the builder is 14, thsi muyst be what's behind all of this:
helper:
Code:
adel@t14 ~ $ gcc-config -l
 [1] i686-pc-linux-musl-13 *

 [2] i686-unknown-linux-musl-14 *

 [3] x86_64-pc-linux-gnu-14 *

builder:
Code:
root@cherry $ gcc-config -l
 [1] i686-pc-linux-musl-14 *


I'm trying to work on this problem now
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 6:06 pm    Post subject: Reply with quote

I'm trying to set gcc 14 as the version to use but I keep getting 13, what am I doing wrong here:
Code:
t14 ~ # crossdev --clean i686-pc-linux-musl   
 * Uninstalling target 'i686-pc-linux-musl' ...
cross-i686-pc-linux-musl/binutils: 2.43-r2 none none
cross-i686-pc-linux-musl/linux-headers: 6.12 none none
cross-i686-pc-linux-musl/musl: 1.2.5-r1 none none
cross-i686-pc-linux-musl/gcc: 13.4.9999 none none

All selected packages: =cross-i686-pc-linux-musl/musl-1.2.5-r1 =cross-i686-pc-linux-musl/gcc-13.4.9999 =cross-i686-pc-linux-musl/binutils-2.43-r2 =cross-i686-pc-linux-musl/linux-headers-6.12
>>> Unmerging (1 of 4) cross-i686-pc-linux-musl/binutils-2.43-r2...
>>> Unmerging (2 of 4) cross-i686-pc-linux-musl/linux-headers-6.12...
>>> Unmerging (3 of 4) cross-i686-pc-linux-musl/musl-1.2.5-r1...
>>> Unmerging (4 of 4) cross-i686-pc-linux-musl/gcc-13.4.9999...

!!! existing preserved libs found

 * IMPORTANT: 66 config files in '/etc' need updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.
/usr/i686-pc-linux-musl: directory still exists; remove recursively? [y/N] y
t14 ~ # crossdev --target i686-pc-linux-musl --gcc 14 -s4 --force
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 * crossdev version:      @CDEVPV@
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   x86
 * Target System:         i686-pc-linux-musl
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-14
 * headers:               linux-headers-[latest]
 * libc:                  musl-[latest]

 * CROSSDEV_OVERLAY:      /var/db/repos/brave-overlay
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
 * leaving metadata/layout.conf alone in /var/db/repos/brave-overlay
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
 * Log: /var/log/portage/cross-i686-pc-linux-musl-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                                                   [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                                                 [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-linux-headers.log
 * Emerging cross-linux-headers ...                                                                                                                                                                                              [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-musl.log
 * Emerging cross-musl ...                                                                                                                                                                                                       [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...                                                                                                                                                                                                 [ ok ]
t14 ~ # gcc-config -l
 [1] i686-pc-linux-musl-13 *

 [2] i686-unknown-linux-musl-14 *

 [3] x86_64-pc-linux-gnu-14 *
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Tue Jan 21, 2025 6:12 pm    Post subject: Reply with quote

Adel Ahmed,

thanks for the output.

May I suggest let's review the current condition. What work? what not? And what is the objective? Because all the outputs and posts I am lost track of what is going on.

For example it is unclear to me if your builder and helper are the both 64 bits multi-lib setup or something else.

So far I do remember is that you want to build 32bits packages and you are using distcc and crossdev.
Back to top
View user's profile Send private message
eccerr0r
Watchman
Watchman


Joined: 01 Jul 2004
Posts: 9874
Location: almost Mile High in the USA

PostPosted: Tue Jan 21, 2025 6:13 pm    Post subject: Reply with quote

pingtoo: we know that portage "did the wrong thing" and thus this is worthy of a bugs.gentoo.org report.

I'm just wondering how much of the system is there and whether it actually could support distcc with musl so a dev could fix this and an emerge of a new version would fix this automatically.

Adel Ahmed: yes the -m32 is a good idea for testing for now though again this should be fixed in portage for gcc. In any case on the machine that's requesting help, try adding "-m32" in the CFLAGS of your make.conf to see if your amd64 box would then give you a 32-bit object file instead of giving you a useless 64-bit object file for your 32-bit machine... however this should be automatic.

The other idea is instead of the i686-pc-linux-musl-g++ symlink to g++, you should add a wrapper script that does something like
Code:
g++ -m32 $*


Again this should be handled in the ebuilds/portage and you shouldn't need to do this, but it will get you going for now.
_________________
Intel Core i7 2700K/Radeon R7 250/24GB DDR3/256GB SSD
What am I supposed watching?
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Tue Jan 21, 2025 7:07 pm    Post subject: Reply with quote

I have removed all the crossdev targets, recreated the linux-musl one, recreated the symlinks:
Code:
t14 ~ # crossdev --clean i686-unknown-linux-musl
 * Uninstalling target 'i686-unknown-linux-musl' ...
cross-i686-unknown-linux-musl/binutils: 2.43-r2 none none
cross-i686-unknown-linux-musl/musl: 1.2.5-r1 none none
cross-i686-unknown-linux-musl/gcc: 14.2.1_p20241221 none none
cross-i686-unknown-linux-musl/linux-headers: 6.12 none none

All selected packages: =cross-i686-unknown-linux-musl/gcc-14.2.1_p20241221 =cross-i686-unknown-linux-musl/musl-1.2.5-r1 =cross-i686-unknown-linux-musl/binutils-2.43-r2 =cross-i686-unknown-linux-musl/linux-headers-6.12
>>> Unmerging (1 of 4) cross-i686-unknown-linux-musl/binutils-2.43-r2...
>>> Unmerging (2 of 4) cross-i686-unknown-linux-musl/musl-1.2.5-r1...
>>> Unmerging (3 of 4) cross-i686-unknown-linux-musl/gcc-14.2.1_p20241221...
>>> Unmerging (4 of 4) cross-i686-unknown-linux-musl/linux-headers-6.12...

!!! existing preserved libs found

 * IMPORTANT: 66 config files in '/etc' need updating.
 * See the CONFIGURATION FILES and CONFIGURATION FILES UPDATE TOOLS
 * sections of the emerge man page to learn how to update config files.
/usr/i686-unknown-linux-musl: directory still exists; remove recursively? [y/N] y
t14 ~ # gcc-config -l
 [1] x86_64-pc-linux-gnu-14 *
t14 ~ # crossdev --target i686-pc-linux-musl  -s4
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
 * crossdev version:      @CDEVPV@
 * Host Portage ARCH:     amd64
 * Host Portage System:   x86_64-pc-linux-gnu (i686-pc-linux-gnu x86_64-pc-linux-gnu)
 * Target Portage ARCH:   x86
 * Target System:         i686-pc-linux-musl
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               linux-headers-[latest]
 * libc:                  musl-[latest]

 * CROSSDEV_OVERLAY:      /var/db/repos/brave-overlay
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:         
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
 * Autofixing mangled file: /var/db/repos/brave-overlay/profiles/categories
 * leaving metadata/layout.conf alone in /var/db/repos/brave-overlay
  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _  -  ~  -  _
 * Log: /var/log/portage/cross-i686-pc-linux-musl-binutils.log
 * Emerging cross-binutils ...                                                                                                                                                                                                   [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-gcc-stage1.log
 * Emerging cross-gcc-stage1 ...                                                                                                                                                                                                 [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-linux-headers.log
 * Emerging cross-linux-headers ...                                                                                                                                                                                              [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-musl.log
 * Emerging cross-musl ...                                                                                                                                                                                                       [ ok ]
 * Log: /var/log/portage/cross-i686-pc-linux-musl-gcc-stage2.log
 * Emerging cross-gcc-stage2 ...                                                                                                                                                                                                 [ ok ]
t14 ~ # gcc-config -l
 [1] i686-pc-linux-musl-14 *

 [2] x86_64-pc-linux-gnu-14 *
t14 ~ # cd /usr/lib/distcc
t14 /usr/lib/distcc # ls -l
total 140
lrwxrwxrwx 1 root root  1 Jan 16 18:00 bin -> .
lrwxrwxrwx 1 root root 15 Jan 21 20:24 c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 c99 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-gcc-14 -> /usr/bin/distcc
(reverse-i-search)`ln': ^C -s /usr/bin/distcc i686-pc-linux-musl-g++
t14 /usr/lib/distcc # LS -L /usr/lib/distcc^C
t14 /usr/lib/distcc # ls -l /usr/lib/distcc
total 140
lrwxrwxrwx 1 root root  1 Jan 16 18:00 bin -> .
lrwxrwxrwx 1 root root 15 Jan 21 20:24 c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 c99 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 i686-pc-linux-musl-gcc-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-c++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-cc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang++-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang-18 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-clang-19 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-g++ -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-g++-14 -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-gcc -> /usr/bin/distcc
lrwxrwxrwx 1 root root 15 Jan 21 20:24 x86_64-pc-linux-gnu-gcc-14 -> /usr/bin/distcc
t14 /usr/lib/distcc # ln -s /usr/bin/distcc i686-pc-linux-musl-g++
t14 /usr/lib/distcc # i686-pc-linux-musl-g++^C
t14 /usr/lib/distcc # cd /usr/bin/
t14 /usr/bin # ln -s g++ i686-pc-linux-musl-g++
t14 /usr/bin #
t14 /usr/bin # i686-pc-linux-musl-g++
i686-pc-linux-musl-g++: fatal error: no input files
compilation terminated.
t14 /usr/bin #


now I get this error on the builder during the emerge:
Code:
-- The C compiler identification is GNU 14.2.1
-- The CXX compiler identification is GNU 14.2.1
-- The ASM compiler identification is GNU
-- Found assembler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc
-- Check for working C compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-gcc - works
-- Detecting C compile features
-- Detecting C compile features - done
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - failed
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++ - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCXXCompiler.cmake:73 (message):
  The C++ compiler

    "/usr/lib/distcc/bin/i686-pc-linux-musl-g++"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/CMakeFiles/CMakeScratch/TryCompile-ibIOkI'
   
    Run Build Command(s): /usr/bin/ninja -v cmTC_80026
    [1/2] /usr/lib/distcc/bin/i686-pc-linux-musl-g++    -DNDEBUG -O2 -march=atom -pipe -fomit-frame-pointer -o CMakeFiles/cmTC_80026.dir/testCXXCompiler.cxx.o -c /var/tmp/portage/llvm-core/llvm-18.1.8-r6/work/llvm_build-abi_x86_32.x86/CMakeFiles/CMakeScratch/TryCompile-ibIOkI/testCXXCompiler.cxx
    [2/2] : && /usr/lib/distcc/bin/i686-pc-linux-musl-g++ -O2 -march=atom -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--no-keep-memory CMakeFiles/cmTC_80026.dir/testCXXCompiler.cxx.o -o cmTC_80026   && :
    FAILED: cmTC_80026
    : && /usr/lib/distcc/bin/i686-pc-linux-musl-g++ -O2 -march=atom -pipe -fomit-frame-pointer -Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--no-keep-memory CMakeFiles/cmTC_80026.dir/testCXXCompiler.cxx.o -o cmTC_80026   && :
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: i386:x86-64 architecture of input file `CMakeFiles/cmTC_80026.dir/testCXXCompiler.cxx.o' is incompatible with i386 output
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: CMakeFiles/cmTC_80026.dir/testCXXCompiler.cxx.o: file class ELFCLASS64 incompatible with ELFCLASS32
    /usr/lib/gcc/i686-pc-linux-musl/14/../../../../i686-pc-linux-musl/bin/ld: final link failed: file in wrong format
    collect2: error: ld returned 1 exit status
    distcc[187] ERROR: compile (null) on localhost failed
    ninja: build stopped: subcommand failed.
Back to top
View user's profile Send private message
pingtoo
Veteran
Veteran


Joined: 10 Sep 2021
Posts: 1420
Location: Richmond Hill, Canada

PostPosted: Tue Jan 21, 2025 9:42 pm    Post subject: Reply with quote

Adel Ahmed,

I am afraid I am not able be much of help. I don't have much information I need to work on. However I tried on my test container, all thing exist at expected location.

Notice a few thing, not sure if that is your desire.
  • Set -s4, not sure about this effect. I usually don't specify stage
  • Always use latest ebuild, is that disirable? distcc requre major version be same and best to have minor version be same also
  • How you invoke emerge? for crossdev build usually it is emerge-i686-pc-linux-musl
  • You last ran crossdev still not produce i686-pc-linux-musl-g++, did you somehow USE=-cxx or something will disalbe g++ build?
  • You symbolic link /usr/bin/g++ to /usr/bin/i686-pc-linux-musl-g++, this is wrong, this will produce 64bits code
  • Your crossdev repository is at /var/db/repos/brave-overlay. I suspect your next sync might wipe it out.
  • emerge-i686-pc-linux-musl --info

I ran
Code:
emerge --ask app-eselect/eselect-repository
yes
eselect repository create crossdev
crossdev  --target i686-pc-linux-musl
emerge distcc
eselect compiler-shadow update distcc
eselect compiler-shadow update distccd

crossdev --target i686-pc-linux-musl output:
 * crossdev version:      @CDEVPV@
 * Host Portage ARCH:     arm64
 * Host Portage System:   aarch64-unknown-linux-gnu (aarch64-unknown-linux-gnu)
 * Target Portage ARCH:   x86
 * Target System:         i686-pc-linux-musl
 * Stage:                 4 (C/C++ compiler)
 * USE=multilib:          no
 * Target ABIs:           default

 * binutils:              binutils-[latest]
 * gcc:                   gcc-[latest]
 * headers:               linux-headers-[latest]
 * libc:                  musl-[latest]

 * CROSSDEV_OVERLAY:      /var/db/repos/crossdev
 * PORT_LOGDIR:           /var/log/portage
 * PORTAGE_CONFIGROOT:    /
 * Portage flags:

eselect compiler-shadow update distcc output:
Updating masquerade for distcc ...
'gcc' -> '/usr/bin/distcc'
'gcc-13' -> '/usr/bin/distcc'
'g++' -> '/usr/bin/distcc'
'g++-13' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-gcc' -> '/usr/bin/distcc'
'i686-pc-linux-musl-gcc' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-gcc-13' -> '/usr/bin/distcc'
'i686-pc-linux-musl-gcc-14' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-g++' -> '/usr/bin/distcc'
'i686-pc-linux-musl-g++' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-g++-13' -> '/usr/bin/distcc'
'i686-pc-linux-musl-g++-14' -> '/usr/bin/distcc'
'cc' -> '/usr/bin/distcc'
'c99' -> '/usr/bin/distcc'
'c++' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-cc' -> '/usr/bin/distcc'
'i686-pc-linux-musl-cc' -> '/usr/bin/distcc'
'aarch64-unknown-linux-gnu-c++' -> '/usr/bin/distcc'
'i686-pc-linux-musl-c++' -> '/usr/bin/distcc'

eselect compiler-shadow update distccd output:
Updating masquerade for distccd ...
'gcc' -> '/usr/bin/distccd'
'gcc-13' -> '/usr/bin/distccd'
'g++' -> '/usr/bin/distccd'
'g++-13' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-gcc' -> '/usr/bin/distccd'
'i686-pc-linux-musl-gcc' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-gcc-13' -> '/usr/bin/distccd'
'i686-pc-linux-musl-gcc-14' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-g++' -> '/usr/bin/distccd'
'i686-pc-linux-musl-g++' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-g++-13' -> '/usr/bin/distccd'
'i686-pc-linux-musl-g++-14' -> '/usr/bin/distccd'
'cc' -> '/usr/bin/distccd'
'c99' -> '/usr/bin/distccd'
'c++' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-cc' -> '/usr/bin/distccd'
'i686-pc-linux-musl-cc' -> '/usr/bin/distccd'
'aarch64-unknown-linux-gnu-c++' -> '/usr/bin/distccd'
'i686-pc-linux-musl-c++' -> '/usr/bin/distccd'
Back to top
View user's profile Send private message
Adel Ahmed
Veteran
Veteran


Joined: 21 Sep 2012
Posts: 1600

PostPosted: Wed Jan 22, 2025 5:07 am    Post subject: Reply with quote

firstly,I really appreciate your patience and help.
I went through the points you have listed and you are correct 'did you somehow USE=-cxx or something will disalbe g++ build?' was on point, I added the cxx flag to cross-i686-pc-linux-musl/gcc and now g++ gets built:
build machine emerge:
Code:
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++
-- Check for working CXX compiler: /usr/lib/distcc/bin/i686-pc-linux-musl-g++ - works


I'm getting a different error which seems much simpler for me to resolve now:
Code:
-- Looking for compress2 - not found
CMake Error at cmake/config-ix.cmake:144 (message):
  Failed to configure zlib


thank you for your help
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum