Solved make buildworld runs into "./libc.so.7: unsupported file layout "

Hello,
I've downloaded the latest sources for FreeBSD 11.0 RELEASE, exactly:
svn://svn.freebsd.org/base/release/11.0.1
and have done a
# make buildworld with:
script buildworld.log make -j2 buildworld
after 90 minutes it comes to that error, where I can not find any help.
This is the end of the buildworld.log file:
Code:
....
....
--- libc.a ---
building static c library
ar -crD libc.a `NM='nm' NMFLAGS='' lorder bt_close.o <to long ..input ends with 2000 character>
--- libc_p.a ---
ranlib -D libc_p.a
--- libc.so.7 ---
building shared library libc.so.7
clang -m32 -DCOMPAT_32BIT -march=core2 -L/usr/obj/usr/src/lib32/usr/lib32 --sysroot=/usr/obj/usr/src/lib32 -B/usr/obj/usr/src/lib32/usr/lib32  -nodefaultlibs -Wl,--version-script=Version.map  .....<to long ..input ends with 2000 character>
--- libc.a ---
ranlib -D libc.a
./libc.so.7: unsupported file layout
make[4]: "/usr/src/lib/libc/Makefile" line 179: warning: "make -B -C /usr/src/lib/msun -V ARCH_SUBDIR" returned non-zero status
--- _libinstall ---
--- _NLSINS_be_BY.UTF-8.cat ---
--- _libinstall ---
./libc.so.7: unsupported file layout
*** [_libinstall] Error code 1

make[4]: stopped in /usr/src/lib/libc
--- _NLSINS_be_BY.UTF-8.cat ---
./libc.so.7: unsupported file layout
*** [_NLSINS_be_BY.UTF-8.cat] Error code 1

make[4]: stopped in /usr/src/lib/libc
2 errors

make[4]: stopped in /usr/src/lib/libc
*** [lib/libc__L] Error code 2

make[3]: stopped in /usr/src
1 error

make[3]: stopped in /usr/src
*** [libraries] Error code 2

make[2]: stopped in /usr/src
1 error

make[2]: stopped in /usr/src
*** [build32] Error code 2

make[1]: stopped in /usr/src
1 error

make[1]: stopped in /usr/src
*** [buildworld] Error code 2
make: stopped in /usr/src
1 error
make: stopped in /usr/src
I believe the imortend lines are:
Code:
building shared library libc.so.7
clang -m32....
ranlib -D libc.a
./libc.so.7: unsupported file layout
--- _libinstall ---
--- _NLSINS_be_BY.UTF-8.cat ---
--- _libinstall ---
./libc.so.7: unsupported file layout
*** [_libinstall] Error code 1

make[4]: stopped in /usr/src/lib/libc
--- _NLSINS_be_BY.UTF-8.cat ---
./libc.so.7: unsupported file layout
*** [_NLSINS_be_BY.UTF-8.cat] Error code 1
I found less equal problems on the web. Because of what was there written I do:
ls /usr/obj/usr/src/lib/libc
->OK is there
ls -l /usr/obj/usr/src/lib/libc | wc -l
-> 8551 files
ls -la /usr/obj/usr/src/lib/libc/libc.so.7
--> -rwxr-xr-x 1 root wheel 1914098 9 Mrz 13:58 /usr/obj/usr/src/lib/libc/libc.so.7
It looks that it has been build.

file /usr/obj/usr/src/lib/libc/libc.so.7
file = determine file type
--> /usr/obj/usr/src/lib/libc/libc.so.7: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped

readelf -h /usr/obj/usr/src/lib/libc/libc.so.7
readelf = display information about ELF objects
ELF = Executable and Linking Format
Code:
-->  Magic:   7f 45 4c 46 02 01 01 09 00 00 00 00 00 00 00 00
    Class:                             ELF64
    Data:                              2's complement, little endian
    Version:                           1 (current)
    OS/ABI:                            FreeBSD
    ABI Version:                       0
    Type:                              DYN (Shared object file)
    Machine:                           Advanced Micro Devices x86-64
    Version:                           0x1
    Entry point address:               0x3bc20
    Start of program headers:          64 (bytes into file)
    Start of section headers:          1752048 (bytes into file)
    Flags:                             0
    Size of this header:               64 (bytes)
    Size of program headers:           56 (bytes)
    Number of program headers:         6
    Size of section headers:           64 (bytes)
    Number of section headers:         40
    Section header string table index: 37

In https://www.mail-archive.com/freebsd-stable@freebsd.org/msg133416.html he says: "
Hm, that all looks perfectly normal, supposing that you are on amd64." I'm on a virtuall machine with deticated 2 cores of "Intel® Xeon® E5-2680V4 / 2 CPU". I belive the right target is for this AMD64.
I write in make.conf for that:
Code:
CC=clang
CXX=clang++
CPP=clang-cpp

#    Certain software can be optimized for different CPU types.
#    This is most effective if you upgrade your system from source
#
#    AMD64 - All multi-core Intel® Xeon™ processors,
#    (I got: Intel® Xeon® E5-2680V4 / 2 CPU)
#    in /usr/share/examples/etc/make.conf
#     AMD64 architecture: amdfam10, opteron-sse3, athlon64-sse3, k8-sse3,
#                       opteron, athlon64, k8, core2, nocona
CPUTYPE?=core2

BUILD_OPTIMIZED=YES

#copy form old make.conf
OPTIONS_SET=OPTIMIZED_CFLAGS   #deprecated WITH_OPTIMIZED_FLAGS=YES
OPTIMIZED_CFLAGS=YES           #deprecated WITH_OPTIMIZED_CFLAGS=YES
OPTIMIZED_CXXFLAGS=YES           #deprecated WITH_OPTIMIZED_CXXFLAGS=YES
OPTIMIZED_CXXLAGS=YES           #deprecated WITH_OPTIMIZED_CXXLAGS=YES

WITH_OPT_CFLAGS=YES
WITH_CPUFLAGS=YES
WITH_OPTIMIZATION=YES

WITHOUT="X"
#WITHOUT="X11"
X11BASE=${LOCALBASE}

#...

Have anyone a idea what do to - or where to find a solution for that error?

Thanks a lot.
 
I have tried the same make buildworld but without the switch "-j2".
The result is the same but the error looks a bit different in the output:
Code:
building shared library libc.so.7
clang -m32 -DCOMPAT_32BIT -march=core2
      -L/usr/obj/usr/src/lib32/usr/lib32
      --sysroot=/usr/obj/usr/src/lib32
      -B/usr/obj/usr/src/lib32/usr/lib32 
      -nodefaultlibs -Wl,
      --version-script=Version.map  -shared -Wl,-x -Wl,--fatal-warnings -Wl,
      --warn-shared-textrel  -o libc.so.7 -Wl,
      -soname,
      libc.so.7  `NM='nm' NMFLAGS='' lorder bt_close.So
                                            bt_conv.So bt_debug.So bt_delete.So bt_get.So bt_open.So
                                            bt_overflow.So bt_page.So bt_put.So bt_search.So bt_seq.So
                                          ...etc. more about 200 lines with "Shared Lib"s.So
                                          ...
./libc.so.7: unsupported file layout
*** Error code 1

Stop.
make[4]: stopped in /usr/src/lib/libc
*** Error code 1

In addition I have found out that there are two "building shared library libc.so.7" statements into the log-file. With both make buildworld there are:
Code:
(1) building shared library libc.so.7
clang  -nodefaultlibs -Wl,--version-script=Version.map.......
with no error, and

Code:
(2) building shared library libc.so.7
clang -m32 -DCOMPAT_32BIT -march=core2 -L/usr/obj/usr/src/lib32/usr/lib32...
./libc.so.7: unsupported file layout
which gives the error.

It seems that the building of the 32bit version of libc.so has the problem.

Can "-m32 " with "-march=core2" make the problem?

What is the meaning of: "unsupported file layout"?
Thanks
 
I've downloaded the latest sources for FreeBSD 11.0 RELEASE, exactly:
svn://svn.freebsd.org/base/release/11.0.1
Those are the wrong sources. If you need the source for 11.0-RELEASE you need to checkout /base/releng/11.0. Also, remove everything from your make.conf. There's rarely anything to gain here.
 
Thanks,
I will try. But my question are.
I have done:
svn list svn://svn.freebsd.org/base/release/
and it shows a list of releases:
Code:
10.0.0/
10.1.0/
10.2.0/
10.3.0/
11.0.0/
11.0.1/
Why not use 11.0.1, it looks like it is the latest one?
What is the best way to find the latest release version, that has no problems?

I try to learn and experiment with FreeBSD and my on server (no other users).
There are a lot written about optimization, like here:
http://easyos.net/articles/bsd/freebsd/optimization_by_make_conf_in_freebsd
Such sentence there sounds for me great:
"...But, such a software (pre-compiled software) has one big disadvantage - work speed. It can't be used by servers which have high load.

In such case we need to optimize the software. It can be done only if we compile software from the source code. But, in OS like FreeBSD we can even compile the kernel of an operation system. That means if we compile kernel and all software with CPU optimization then everything will work really fast. Such a kernel and software will use all the advantages of your CPU.
"
Why not to use this in make.conf?
 
Why not use 11.0.1, it looks like it is the latest one?
What is the best way to find the latest release version, that has no problems?
To check the release information page on the FreeBSD website. There you'll notice that the currently supported production releases are 11.0 and 10.3.

You'll also notice mentioning of the (developer) snapshots (CURRENT and STABLE).

I try to learn and experiment with FreeBSD and my on server (no other users).
There are a lot written about optimization, like here:
http://easyos.net/articles/bsd/freebsd/optimization_by_make_conf_in_freebsd
I suggest to stick to recent information (this article is from 2012 and a lot can (and will) change in 5 years time) as well as something more credible and reliable. Some of the statements in that article are plain out nonsense. Claiming that pre-compiled software can't be used with servers which have a high load is plain out nonsense. Note that I'm not saying that manually compiling doesn't give any advantages, but in most cases (and especially within modern environments) the advantages are hardly as huge as this article tries to make you believe.

My suggestion: stick to the FreeBSD handbook for now. Optionally the whole documentation section. At the very least you can be pretty much sure that the information is recent and mostly reliable.
 
The /base/release/ directories are only there for administrative purposes. As far as I understood it these are necessary due to the way branches/tags work with subversion. However, they should never be used. Instead you need to use /base/releng/. This contains source trees for the various -RELEASE versions. The 'releng' moniker is bit of a relic from the past. It's short for RELease ENGineering. The old CVS tree used tags like RELENG_6_3 for 6.3-RELEASE. So /base/releng/11.0 will get you the sources for 11.0-RELEASE plus all the security/errata fixes.
 
Thanks again,
I've done
svn checkout svn://svn.freebsd.org/base/release/11.0.0 /usr/src
but I've not removed the options in make.conf. Only set another CPU type because I misunderstood. Is is not ="core2" because my virtual server has 2 cores. It should be ="broadwell" which is the synonym I found in /usr/share/examples/etc/make.conf for "Intel® Xeon® E5-2680V4". And this is the CPU type the virtual server has.

But also with 11.0 form release I've got the same error. Here is the output from script buildworld.log make -j2 buildworld:
Code:
clang -m32 -DCOMPAT_32BIT -march=broadwell
-L/usr/obj/usr/src/lib32/usr/lib32
         --sysroot=/usr/obj/usr/src/lib32
         -B/usr/obj/usr/src/lib32/usr/lib32
          -nodefaultlibs -Wl,
           ............
--- libc.a ---
ranlib -D libc.a
./libc.so.7: unsupported file layout
make[4]: "/usr/src/lib/libc/Makefile" line 179: warning:
       "make -B -C /usr/src/lib/msun -V ARCH_SUBDIR"
       returned non-zero status
--- _libinstall ---
--- _NLSINS_be_BY.UTF-8.cat ---
--- _libinstall ---
./libc.so.7: unsupported file layout
*** [_libinstall] Error code 1

It seems that something is going wrong with building the 32 bit library on this 64 bit system.
Changing the architecture"- march=broadwell" has make no difference so this seem's not the problem. Also "building shared library libc.so.7" for 64 bit, I see in the log, has give no error. Only it stops for the same with 32 bit.
ldconfig /usr/lib32 /usr/local/lib32/compat shows:
---> "ldconfig: warning: /usr/local/lib32/compat: No such file or directory"
With the first installaion form *.iso-FreeBSD-DVD-Release-11.0 I had selected
"(x) 32bit Library" but I'm not sure this has been correct installed.

Again I don' understand what means: "./libc.so.7: unsupported file layout"?
What is this "_NLSINS_be_BY.UTF-8.cat"? I have no UTF-8 language defined.

Next I will kick /etc/make.conf out of the system and fetch from ../base/releng/11.0. See if this fixed the problem.

It would be a big help if I could make buildworld tell just to compile only the 32 bit part as a test, so I haven' to wait, if it works, 2 hours every time.
 
This was my 5th make buildworld!
There is no more a /etc/make.conf on the system
I have fetched the resources from
svn checkout svn://svn.freebsd.org/base/releng/11.0 /usr/src
and do
script buildworld.log make -j2 buildworld
I get the same error like before:
Code:
cc -m32 -DCOMPAT_32BIT -march=i686 -mmmx -msse -msse2
             -L/usr/obj/usr/src/lib32/usr/lib32
              --sysroot=/usr/obj/usr/src/lib32
              -B/usr/obj/usr/src/lib32/usr/lib32 
               -nodefaultlibs -Wl,
                ..................
--- libc.a ---
ranlib -D libc.a
./libc.so.7: unsupported file layout
make[4]: "/usr/src/lib/libc/Makefile" line 179: warning:
  "make -B -C /usr/src/lib/msun -V ARCH_SUBDIR"
    returned non-zero status
--- _libinstall ---
--- _NLSINS_be_BY.UTF-8.cat ---
--- _libinstall ---
./libc.so.7: unsupported file layout
*** [_libinstall] Error code 1

make[4]: stopped in /usr/src/lib/libc
--- _NLSINS_be_BY.UTF-8.cat ---
./libc.so.7: unsupported file layout
*** [_NLSINS_be_BY.UTF-8.cat] Error code 1

make[4]: stopped in /usr/src/lib/libc
2 errors

I don' understand what means: "./libc.so.7: unsupported file layout"?
What is this "_NLSINS_be_BY.UTF-8.cat"? I have no UTF-8 language defined.

How can I check out where the error comes from?

What to do know? please help.
 
Be sure to empty /usr/obj before trying a rebuild, this directory can cause some issues when older files (from a previous build) are still around.
 
Be sure to empty /usr/obj before trying a rebuild, this directory can cause some issues when older files (from a previous build) are still around.
I've done every time (also for others who may be read this):
Code:
cd /usr/src
# make cleandir && make cleandir  if you wont delete the sources but I wont get sure.
rm -rf *
rm -rf .svn
rm .arcconfig .arclint  #rm .svn and .arcconfig .arclint are not be necessary if you just
                                #do an update to the sources, but I wont get sure.
cd /usr/obj
# chflags -R noschg *   #this could be needed but not in my case
rm -rf *
cd -
svn list svn://svn.freebsd.org/base/releng
--->10.1/
      10.2/
      10.3/
      11.0/
      .../
svn checkout svn://svn.freebsd.org/base/releng/11.0 /usr/src 
-->checkt out,  Revision 315022.
script buildworld.log make -j2 buildworld
 
I have done a reboot and then I got also the problem with:
"/usr/lib32/libc.so.7 unsupported file layout"
like it is asked in
"Everything has an unsupported file layout all of a sudden"
https://forums.freebsd.org/threads/23585/
I do some fsck and this seems solve the problem for booting. I found a comment by google for a solution:
" FORUM: In my (limited) experience, this error only occurs if a disk (or RAID controller)
lies to the file system, claiming that some IOs were done, but in reality
they haven't been done *YET*. The file system then runs IOs that logically depend
on those pending IOs, and those newer IOs make it to disk. But then, on power down,
the first IO gets silently abandoned (verlassen) by the disk.
If you have a crappy cheap RAID controller with bad firmware,
I could see it happening...
--> this could it be at my Netcup server provider.


If the problem can't be fixed, you can just disable soft updates on the file system
with tunefs(8). It will cost you a tiny bit of performance, but performance is the
least of your worries
"
May be the hardware of the Netcup virtual server is bad - but I don't know, however the vserver is much cheap.

I switched soft updates of - do booting - and try again how above is written to make buildworld without any make.conf, src.conf etc and a fresh fetch form the source I got here told.
But the same error cames again on the point when compiling:
building shared library libc.so.7
cc -m32 -DCOMPAT_32BIT...
independent with clang or cc ore something else....???

I thing the main thing to go further is to check out what for an error this is:
/lib/libc.so.7: unsupported file layout

if it would not such a long "clang ...." command I would try: check the sources out and do the compile on the command line in debug mode to see more what happens - but I have never developed in UNIX, so I don't know exactly how to do this.
Any help, ideas?
 
Hello
and sorry for the long thread. As I has mention it could be a problem with compiling the sources for 32 bit.
I found the option WITHOUT_LIB32=
put this in src.conf and copied src.conf back to /etc. And with that option make buildworld compiled until the end.
The question is why it cannot compile 32 bit libraries, etc... for the userland, but this is another question.
 
Back
Top