Bug 243947 - Missing ldd32 on CURRENT
Summary: Missing ldd32 on CURRENT
Status: Closed Not A Bug
Alias: None
Product: Base System
Classification: Unclassified
Component: misc (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-toolchain (Nobody)
URL:
Keywords:
Depends on:
Blocks: 243957
  Show dependency treegraph
 
Reported: 2020-02-06 21:57 UTC by Lorenzo Salvadore
Modified: 2020-02-11 03:40 UTC (History)
4 users (show)

See Also:


Attachments
classic hello world program (70 bytes, text/plain)
2020-02-07 15:30 UTC, Lorenzo Salvadore
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-06 21:57:42 UTC
/usr/bin/ldd32 is missing on CURRENT, at least for r356856 and r357262.

This breaks things such as emulator/i386-wine{-devel}: the ports gives many error messages regarding missing /usr/bin/ldd32 when building and attempts to run wine or winecfg results in the following error message:

ELF interpreter /libexec/ld-elf.so.1 not found, error 8
Abort trap

I CC wine's maintainers.
Comment 1 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-07 15:30:25 UTC
Created attachment 211448 [details]
classic hello world program

It seems it is also impossible to compile any 32-bits program.
I tried to compile the attached hello world program with clang and with gcc9.

With clang:
$ cc -m32 -v main.c
FreeBSD clang version 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05) (based on LLVM 9.0.1)
Target: i386-unknown-freebsd13.0
Thread model: posix
InstalledDir: /usr/bin
 "/usr/bin/cc" -cc1 -triple i386-unknown-freebsd13.0 -emit-obj -mrelax-all -disable-free -main-file-name main.c -mrelocation-model static -mthread-model posix -mdisable-fp-elim -masm-verbose -mconstructor-aliases -munwind-tables -fuse-init-array -target-cpu i686 -dwarf-column-info -debugger-tuning=gdb -v -resource-dir /usr/lib/clang/9.0.1 -fdebug-compilation-dir /usr/home/lorenzo/Volatile -ferror-limit 19 -fmessage-length 106 -fobjc-runtime=gnustep -fdiagnostics-show-option -fcolor-diagnostics -faddrsig -o /tmp/main-839382.o -x c main.c
clang -cc1 version 9.0.1 based upon LLVM 9.0.1 default target x86_64-unknown-freebsd13.0
#include "..." search starts here:
#include <...> search starts here:
 /usr/lib/clang/9.0.1/include
 /usr/include
End of search list.
 "/usr/bin/ld" --eh-frame-hdr -dynamic-linker /libexec/ld-elf.so.1 --hash-style=both --enable-new-dtags -m elf_i386_fbsd -o a.out /usr/lib/crt1.o /usr/lib/crti.o /usr/lib/crtbegin.o -L/usr/lib /tmp/main-839382.o
-lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/crtend.o /usr/lib/crtn.o
ld: error: /usr/lib/crt1.o is incompatible with elf_i386_fbsd
ld: error: /usr/lib/crti.o is incompatible with elf_i386_fbsd
ld: error: /usr/lib/crtbegin.o is incompatible with elf_i386_fbsd
ld: error: /usr/lib/libgcc_s.so is incompatible with elf_i386_fbsd
ld: error: /lib/libc.so.7 is incompatible with elf_i386_fbsd
ld: error: /usr/lib/libgcc_s.so is incompatible with elf_i386_fbsd
ld: error: /usr/lib/crtend.o is incompatible with elf_i386_fbsd
ld: error: /usr/lib/crtn.o is incompatible with elf_i386_fbsd
cc: error: linker command failed with exit code 1 (use -v to see invocation)

With gcc9:
$ gcc9 -m32 -v main.c
Using built-in specs.
COLLECT_GCC=gcc9
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/lto-wrapper
Target: x86_64-portbld-freebsd13.0
Configured with: /usr/obj/usr/ports/lang/gcc9/work/gcc-9.2.0/configure --disable-multilib --disable-plugin --disable-bootstrap --disable-nls --enable-gnu-indirect-function --libdir=/usr/local/lib/gcc9 --libexecdir=/usr/local/libexec/gcc9 --program-suffix=9 --with-as=/usr/local/bin/as --with-gmp=/usr/local --with-gxx-include-dir=/usr/local/lib/gcc9/include/c++/ --with-ld=/usr/local/bin/ld --with-pkgversion='FreeBSD Ports Collection' --with-system-zlib --enable-languages=c,c++,objc,fortran --prefix=/usr/local --localstatedir=/var --mandir=/usr/local/man --infodir=/usr/local/share/info/gcc9 --build=x86_64-portbld-freebsd13.0
Thread model: posix
gcc version 9.2.0 (FreeBSD Ports Collection) 
COLLECT_GCC_OPTIONS='-m32' '-v' '-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/cc1 -quiet -v -imultilib . main.c -quiet -dumpbase main.c -m32 -mtune=generic -march=x86-64 -auxbase main -version -o /tmp//ccuDb1Fq.s
GNU C17 (FreeBSD Ports Collection) version 9.2.0 (x86_64-portbld-freebsd13.0)
	compiled by GNU C version FreeBSD Clang 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05), GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/include-fixed"
ignoring nonexistent directory "/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../../../x86_64-portbld-freebsd13.0/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/include
 /usr/local/include
 /usr/include
End of search list.
GNU C17 (FreeBSD Ports Collection) version 9.2.0 (x86_64-portbld-freebsd13.0)
	compiled by GNU C version FreeBSD Clang 9.0.1 (git@github.com:llvm/llvm-project.git c1a0a213378a458fbea1a5c77b315c7dce08fd05), GMP version 6.1.2, MPFR version 4.0.2, MPC version 1.1.0, isl version none
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: cf19d6b0f10486489838826952c5e5e6
COLLECT_GCC_OPTIONS='-m32' '-v' '-mtune=generic' '-march=x86-64'
 /usr/local/bin/as -v --32 -o /tmp//ccEzjaPh.o /tmp//ccuDb1Fq.s
GNU assembler version 2.33.1 (x86_64-portbld-freebsd13.0) using BFD version (GNU Binutils) 2.33.1
COMPILER_PATH=/usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/:/usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/:/usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/:/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/:/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/:/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../../../x86_64-portbld-freebsd13.0/bin/
LIBRARY_PATH=/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/:/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../../../x86_64-portbld-freebsd13.0/lib/:/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-m32' '-v' '-mtune=generic' '-march=x86-64'
 /usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/collect2 -plugin /usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/liblto_plugin.so -plugin-opt=/usr/local/libexec/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/lto-wrapper -plugin-opt=-fresolution=/tmp//ccVJsK26.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lgcc_s --eh-frame-hdr -m elf_i386_fbsd -V -dynamic-linker /libexec/ld-elf.so.1 /usr/lib/crt1.o /usr/lib/crti.o /usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/crtbegin.o -L/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0 -L/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../../../x86_64-portbld-freebsd13.0/lib -L/usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../.. /tmp//ccEzjaPh.o -lgcc --push-state --as-needed -lgcc_s --pop-state -lc -lgcc --push-state --as-needed -lgcc_s --pop-state /usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/crtend.o /usr/lib/crtn.o
GNU ld (GNU Binutils) 2.33.1
  Supported emulations:
   aix5ppc
   aix5rs6
   aixppc
   aixrs6
   alpha
   alphavms
   arcv2elf
   arcv2elfx
   arcelf
   arcelf_prof
   arclinux
   arclinux_nps
   arclinux_prof
   arm_wince_pe
   armelf
   armelf_fbsd
   armelf_fuchsia
   armelf_linux
   armelf_linux_eabi
   armelf_linux_fdpiceabi
   armelf_nacl
   armelf_nbsd
   armelf_phoenix
   armelf_vxworks
   armelfb
   armelfb_fbsd
   armelfb_fuchsia
   armelfb_linux
   armelfb_linux_eabi
   armelfb_linux_fdpiceabi
   armelfb_nacl
   armelfb_nbsd
   armnto
   armpe
   armsymbian
   avr1
   avr2
   avr25
   avr3
   avr31
   avr35
   avr4
   avr5
   avr51
   avr6
   avrxmega1
   avrxmega2
   avrxmega3
   avrxmega4
   avrxmega5
   avrxmega6
   avrxmega7
   avrtiny
   crisaout
   criself
   crislinux
   cskyelf
   cskyelf_linux
   d10velf
   d30v_e
   d30v_o
   d30velf
   elf32_dlx
   elf32_sparc
   elf32_sparc_sol2
   elf32_sparc_vxworks
   elf32_spu
   elf32_tic6x_be
   elf32_tic6x_le
   elf32_tic6x_linux_be
   elf32_tic6x_linux_le
   elf32_tic6x_elf_be
   elf32_tic6x_elf_le
   elf32am33lin
   elf32bfin
   elf32bfinfd
   elf32cr16
   elf32cr16c
   elf32crx
   elf32epiphany
   elf32epiphany_4x4
   elf32fr30
   elf32frv
   elf32frvfd
   elf32ft32
   elf32ip2k
   elf32iq10
   elf32iq2000
   elf32lm32
   elf32lm32fd
   elf32lppc
   elf32lppclinux
   elf32lppcnto
   elf32lppcsim
   elf32m32c
   elf32mb_linux
   elf32mbel_linux
   elf32mcore
   elf32mep
   elf32metag
   elf32microblazeel
   elf32microblaze
   elf32moxie
   moxiebox
   elf32mt
   elf32or1k
   elf32or1k_linux
   elf32ppc
   elf32ppc_fbsd
   elf32ppclinux
   elf32ppcnto
   elf32ppcsim
   elf32ppcvxworks
   elf32ppcwindiss
   elf32lriscv
   elf32lriscv_ilp32f
   elf32lriscv_ilp32
   elf32rl78
   elf32rx
   elf32tilegx
   elf32tilegx_be
   elf32tilepro
   elf32vax
   elf32visium
   elf32xc16x
   elf32xc16xl
   elf32xc16xs
   elf32xstormy16
   elf32xtensa
   elf_i386
   elf_i386_be
   elf_i386_fbsd
   elf_i386_ldso
   elf_i386_nacl
   elf_i386_sol2
   elf_i386_vxworks
   elf_iamcu
   elf_s390
   h8300elf
   h8300elf_linux
   h8300helf
   h8300helf_linux
   h8300hnelf
   h8300self
   h8300self_linux
   h8300snelf
   h8300sxelf
   h8300sxelf_linux
   h8300sxnelf
   hppaelf
   hppalinux
   hppanbsd
   hppaobsd
   i386beos
   i386bsd
   i386go32
   i386lynx
   i386moss
   i386msdos
   i386nto
   i386pe
   i386pe_posix
   m32relf
   m32relf_linux
   m32rlelf
   m32rlelf_linux
   m68hc11elf
   m68hc11elfb
   m68hc12elf
   m68hc12elfb
   m68kelf
   m68kelfnbsd
   m9s12zelf
   mcorepe
   mn10200
   mn10300
   msp430elf
   msp430X
   nds32elf
   nds32elf16m
   nds32elf_linux
   nds32belf
   nds32belf16m
   nds32belf_linux
   ns32knbsd
   nios2elf
   nios2linux
   pc532macha
   pdp11
   pjelf
   pjlelf
   ppclynx
   ppcmacos
   ppcpe
   pruelf
   score3_elf
   score7_elf
   sh
   shelf
   shelf_fd
   shelf_linux
   shelf_nbsd
   shelf_nto
   shelf_uclinux
   shelf_vxworks
   shl
   shlelf
   shlelf_fd
   shlelf_linux
   shlelf_nbsd
   shlelf_nto
   shlelf_vxworks
   shpe
   tic30aout
   tic30coff
   tic3xcoff
   tic3xcoff_onchip
   tic4xcoff
   tic54xcoff
   tic80coff
   v850
   v850_rh850
   vanilla
   vaxnbsd
   xgateelf
   z80
   z8001
   z8002
   aarch64elf
   aarch64elf32
   aarch64elfb
   aarch64elf32b
   aarch64cloudabi
   aarch64cloudabib
   aarch64fbsd
   aarch64fbsdb
   aarch64linux
   aarch64linuxb
   aarch64linux32
   aarch64linux32b
   elf32_x86_64
   elf32_x86_64_nacl
   elf32b4300
   elf32bmip
   elf32bmipn32
   elf32bsmip
   elf32btsmip
   elf32btsmip_fbsd
   elf32btsmipn32
   elf32btsmipn32_fbsd
   elf32ebmip
   elf32ebmipvxworks
   elf32elmip
   elf32elmipvxworks
   elf32l4300
   elf32lmip
   elf32lr5900
   elf32lr5900n32
   elf32lsmip
   elf32ltsmip
   elf32ltsmip_fbsd
   elf32ltsmipn32
   elf32ltsmipn32_fbsd
   elf32mipswindiss
   elf64_aix
   elf64bpf
   elf64_ia64
   elf64_ia64_fbsd
   elf64_ia64_vms
   elf64_s390
   elf64_sparc
   elf64_sparc_fbsd
   elf64_sparc_sol2
   elf64alpha
   elf64alpha_fbsd
   elf64alpha_nbsd
   elf64bmip
   elf64btsmip
   elf64btsmip_fbsd
   elf64hppa
   elf64lppc
   elf64lriscv
   elf64lriscv_lp64f
   elf64lriscv_lp64
   elf64ltsmip
   elf64ltsmip_fbsd
   elf64mmix
   elf64ppc
   elf64ppc_fbsd
   elf64rdos
   elf64tilegx
   elf64tilegx_be
   elf_l1om
   elf_l1om_fbsd
   elf_k1om
   elf_k1om_fbsd
   elf_x86_64
   elf_x86_64_cloudabi
   elf_x86_64_fbsd
   elf_x86_64_nacl
   elf_x86_64_sol2
   hppa64linux
   i386pep
   mmo/usr/local/bin/ld: skipping incompatible /usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/libgcc.a when searching for -lgcc
/usr/local/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc
/usr/local/bin/ld: cannot find -lgcc
/usr/local/bin/ld: skipping incompatible /usr/local/lib/gcc9/gcc/x86_64-portbld-freebsd13.0/9.2.0/../../../libgcc_s.so when searching for -lgcc_s
/usr/local/bin/ld: skipping incompatible /usr/lib/libgcc_s.so when searching for -lgcc_s
/usr/local/bin/ld: cannot find -lgcc_s
/usr/local/bin/ld: skipping incompatible /lib/libc.so.7 when searching for /lib/libc.so.7
/usr/local/bin/ld: cannot find /lib/libc.so.7
/usr/local/bin/ld: skipping incompatible /usr/lib/libc_nonshared.a when searching for /usr/lib/libc_nonshared.a
/usr/local/bin/ld: cannot find /usr/lib/libc_nonshared.a
/usr/local/bin/ld: skipping incompatible /usr/lib/libssp_nonshared.a when searching for /usr/lib/libssp_nonshared.a
/usr/local/bin/ld: cannot find /usr/lib/libssp_nonshared.a
collect2: error: ld returned 1 exit status
Comment 2 Alex S 2020-02-07 15:51:37 UTC
Do you have /libexec/ld-elf32.so.1?
Comment 3 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-07 16:11:03 UTC
(In reply to Alex S from comment #2)

No I have no /libexec/ld-elf32.so.1.
Comment 4 Brooks Davis freebsd_committer freebsd_triage 2020-02-07 17:48:09 UTC
From all the symptoms you have described you have a system built with WITHOUT_LIB32 or installed without 32-bit compatibility bits.
Comment 5 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-07 17:54:55 UTC
(In reply to Brooks Davis from comment #4)

No, I built the system with lib32 and kernel 32 compatibility.
People with accounts on freefall can check that system: it has the same issue.
Comment 6 Brooks Davis freebsd_committer freebsd_triage 2020-02-07 18:20:01 UTC
I just built and installed a tree at r357643 amd64 into an empty root directory.  /libexec/ld-elf32.so.1 and /usr/bin/ldd32 exist and /usr/lib32 is populated...

Buildworld was with: make -j16 -DNO_CLEAN buildworld
Installworld was with: make DESTDIR=/home/bed22/freebsd-root -DNO_ROOT -DDB_FROM_SRC installworld

I do see that freefall doesn't have the compat bits installed either, but that isn't particularly informative.
Comment 7 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-07 21:52:32 UTC
(In reply to Brooks Davis from comment #6)

I am trying to update my system to last revision: let's see if this is sufficient to fix the problem.
Comment 8 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-08 15:13:25 UTC
(In reply to Brooks Davis from comment #6)

I am sorry, I just noticed that WITHOUT_LIB32 was indeed defined in my src.conf. I can't explain to myself how I could have not seen it: I had check it at least 3 times! The 4th time, at last, I saw it...

I am completing the new build without that variable. As soon as the build will be finished and I confirm that everything works fine I will close the bug.

Sorry for the noise.
Comment 9 Lorenzo Salvadore freebsd_committer freebsd_triage 2020-02-08 20:22:18 UTC
I confirm everything works once I fixed that silly mistake in my src.conf.
I close the bugs.

Sorry again for the noise.
Comment 10 Kubilay Kocak freebsd_committer freebsd_triage 2020-02-11 03:39:51 UTC
^Triage: Correct (more precise) resolution