# Everything has an unsupported file layout all of a sudden



## Garrosh (May 4, 2011)

Hello everyone!

This week my video card gave up on me. I replaced it today, but the error that caused the booting sequence to fail is still present:

```
/libexec/ld-elf.so.1: /usr/lib32/libedit.so.7
Enter full pathname of shell or RETURN for /bin/sh:
```
As it happens, I'm running a vanilla amd64 build of the FreeBSD kernel. So I figured I'd have to go and see what's going on:

```
/rescue/csh
# bash
/libexec/ld-elf.so.1: /usr/lib32/libncurses.so.8: unsupported file layout
# ls
/libexec/ld-elf.so.1: /usr/lib32/libutil.so.8: unsupported file layout
# cd ..
# ls
/libexec/ld-elf.so.1: /usr/lib32/libutil.so.8: unsupported file layout
# mount /dev/ad0s1 /mnt
/libexec/ld-elf.so.1: /usr/lib32/libutil.so.8: unsupported file layout
# fsck -y
/libexec/ld-elf.so.1: /usr/lib32/libc.so.7: unsupported file layout
```

How can I tell my system to stop trying to load lib32 libraries?


----------



## gordon@ (May 4, 2011)

Can you post the output of *ldconfig -r* and *ldconfig -32 -r*?


----------



## Garrosh (May 4, 2011)

```
#ldconfig -r
/libexec/ld-elf.so.1: /usr/lib32/libc.so.7: unsupported file layout
#ldconfig -32 -r
/libexec/ld-elf.so.1: /usr/lib32/libc.so.7: unsupported file layout
```
I'll go ahead and guess that's not standard output.


----------



## gordon@ (May 4, 2011)

Sorry, use /rescue/ldconfig


----------



## Garrosh (May 4, 2011)

```
#/rescue/ldconfig -32 -r
ldconfig: "/var/run/ld-elf32.so.hints":invalid file format
```
However, the output for */rescue/ldconfig -r* is an output of 188 lines long of:

```
167:-lsdp.3 => /usr/local/lib32/compat/libsdp.so.3
168:-lradius.3 => /usr/local/lib32/compat/libradius.so.3
[snip]
188:-lzpool.1 => /usr/local/lib32/compat/libzpool.so.3
```
I cannot find a way to paste the whole output verbatim since the source computer won't boot. I do hope this sample is sufficient. If not, please let me know.


----------



## gordon@ (May 4, 2011)

It sounds like you have a corrupted hints file, try running:
`# /rescue/ldconfig /usr/lib /usr/local/lib`
then
`# /rescue/ldconfig /usr/lib32 /usr/local/lib32/compat`

See if that works.


----------



## Garrosh (May 5, 2011)

```
# /rescue/ldconfig -32 -r
ldconfig: "/var/run/ld-elf32.so.hints": invalid file format
# /rescue/ldconfig /usr/lib /usr/local/lib
ldconfig: mkstemp(/var/run/ld-elf.so.hints.ScPTGv): Read-only file system
# /rescue/mount -uw /
# /rescue/ldconfig /usr/lib /usr/local/lib
# /rescue/ldconfig /usr/lib32 /usr/local/lib32/compat
# /rescue/ldconfig -32 -r
ldconfig: "/var/run/ld-elf32.so.hints": invalid file format
```

So, again, I suppose this is not the standard output.

Unfortunately, I have no more time to spend on this issue as I have to use that computer to work from. Therefore, I see no other option than to do a clean install after formating.


----------



## Garrosh (May 5, 2011)

I've had a little time to day to analyze what happened to my system. Apparently, I brute forced an install of wine 32 bit on my system and my video card gave up at the same time. So all I saw was smoke and errors I didn't diagnose properly.

Moral: 32 bit apps are bad on 64 bit system. Obviously.

Question: does the /rescue architecture provide the tools to fix such an abomination? I ask for personal knowledge as I've done a clean install already.


----------



## gordon@ (May 6, 2011)

This was my fault, it should have been:
`# /rescue/ldconfig /usr/lib /usr/local/lib`
then
`# /rescue/ldconfig -32 /usr/lib32 /usr/local/lib32/compat`


----------



## SirDice (May 6, 2011)

Also keep in mind that if you boot to single user mode only the root (/) filesystem will be mounted and it's mounted read-only.

This is were this error comes from:

```
# /rescue/ldconfig /usr/lib /usr/local/lib
ldconfig: mkstemp(/var/run/ld-elf.so.hints.ScPTGv): Read-only file system
```


----------



## Garrosh (May 7, 2011)

Thank you, but as you may have noted, the line I typed following the error was:

[CMD=]# /rescue/mount -uw /
[/CMD]

This made sure my root partition was now mounted as read-write, and allowed me to use the command provided by gordon.


----------



## Garrosh (May 11, 2011)

As it turns out, the root of my problems was a bad quality electricity input to my desktop. It caused damage almost everywhere inside my root partition and this was the only side effect I could detect at first. 

The big clue was when everything stopped working after a complete format while compiling from one of the ttys. No logs or segfaults, nothing.


----------



## BernardoCR (Jul 22, 2011)

*Please, help*

I tried typing this /rescue/ldconfig commands on FreeBSD, now every command I make it returns:


```
root@vlife:/home/224_121# ls
/libexec/ld-elf.so.1: /usr/lib32/libc.so.7: unsupported file layout
```
Could you please help?

These are the commands I made:


```
/rescue/ldconfig -32 /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/mysql
ldconfig /lib /usr/lib /usr/lib/compat /usr/local/lib /usr/local/lib/mysql
/rescue/ldconfig -32 -r
/rescue/ldconfig /usr/lib32 /usr/local/lib32/compat
/rescue/ldconfig /usr/lib /usr/local/lib
/rescue/ldconfig -32 /usr/lib32 /usr/local/lib/mysql/plugin/
/rescue/ldconfig -32 /usr/lib32 /usr/local/lib/mysql/plugin/libudf_blitzed.so
/rescue/ldconfig -32 /usr/lib32 /usr/local/lib/
/rescue/ldconfig -32 /usr/lib32 /lib
/rescue/ldconfig -32 /usr/lib32 /usr/local/lib32/compat
/rescue/ldconfig -32 /usr/lib32 /usr/local/lib32/compat/rescue/ldconfig -32 /usr/lib32 /usr/local/lib32/compat/rescue/ldconfig
 -32 /usr/lib32 /usr/local/lib32/compat
```


----------



## gordon@ (Jul 24, 2011)

If it's not one thing is the other. =)

Try this:
`# /rescue/ldconfig /lib /usr/lib /usr/local/lib`
then
`# /rescue/ldconfig -32 /usr/lib32 /usr/local/lib32/compat`

I always seem to forget something (in this case the /lib).


----------



## blackhaz (Apr 1, 2019)

Guys, I know this thread is 8 years old but it saved my back just now in 2019. I owe everyone beer.


----------

