Solved Compiling only FreeBSD libc

Hi
I am making some experiments with code of libc and have a requirement to compile and test them pretty often.
I would like to know if there is a way to compile only libc.

Right now only way I know is to use make buildworld to build everything. This takes a lot of time.
I have also tried and executed make from *src/lib/libc but it has finished with errors. So any kind of advice
Would be much appreciated.

Kind regards
 
Use meta-mode.

Then, even make buildworld will be reasonably fast, but you can also do make -C lib/libc without issues.

At least that's the theory, I didn't actually try building libc in isolation, but other parts where it worked fine.
 
Code:
cd /usr/src/lib/libnetbsd && make
cd /usr/src/lib/libc && make

That should be enough :) libnetbsd is required for some tests. I usually use the resulting libc via LD_PRELOAD=/usr/obj/...
 
zirias@ cracauer@ I tried both make in libc directory and make -c lib/libc which are basically the same. Errors I am getting
Are redefinition of basic types lile __int8_t or __uint8_t and in the end it stops due to to too many errors emitted.

Bash:
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error co
 
I can confirm it doesn't work for me either. First error is
Code:
ld: error: cannot preempt symbol: _DYNAMIC
>>> referenced by libc_start1.c:144 (/xcarb3/usr/src/lib/libc/csu/libc_start1.c:144)
>>>               libc_start1.o:(__libc_start1) in archive /xcarb3/usr/obj/xcarb3/usr/src/amd64.amd64/lib/libc/libc.a

ld: error: cannot preempt symbol: _DYNAMIC

Don't have leisure to investigate right now.
 
I just checked it on a somewhat recent -CURRENT, make -C lib/libc built perfectly fine there 🤷‍♂️

But as mentioned above, I'm using meta-mode. I could imagine without it, some dependecies might not be correct .... :-/
 
I tried this with 13.2-STABLE and it worked fine. I turned off tests. No ccache or meta-mode.
Code:
cd /usr/src/lib/libc; make  -j8 MAKEOBJDIRPREFIX=/tmp/xx WITHOUT_TESTS=yes

Bash:
Code:
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** Error co
You have likely broken something.
 
This are the errors I get when I run:

make -C lib/libc -j8 MAKEOBJDIRPREFIX=/tmp/objdir

Bash:
cc  -O2 -pipe -fno-common   -DNO__SCCSID -DNO__RCSID -I/usr/home/tgk/src/freebsd/src/lib/libc/include -I/usr/home/tgk/src/freebsd/src/include -I/usr/home/tgk/src/freebsd/src/lib/libc/amd64 -DNLS  -ftls-model=initial-exec -DCRT_IRELOC_RELA  -DINIT_IRELOCS="init_cpu_features()" -I/usr/home/tgk/src/freebsd/src/lib/libc/csu/amd64 -D__DBINTERFACE_PRIVATE -I/usr/home/tgk/src/freebsd/src/contrib/gdtoa -I/usr/home/tgk/src/freebsd/src/contrib/libc-vis -DINET6 -I/usr/home/tgk/src/freebsd/src/build/usr/home/tgk/src/freebsd/src/lib/libc -I/usr/home/tgk/src/freebsd/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/home/tgk/src/freebsd/src/lib/libmd -I/usr/home/tgk/src/freebsd/src/contrib/jemalloc/include -I/usr/home/tgk/src/freebsd/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/home/tgk/src/freebsd/src/lib/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -gz=zlib -MD  -MF.depend.auxv.o -MTauxv.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments    -I/usr/home/tgk/src/freebsd/src/lib/libutil -I/usr/home/tgk/src/freebsd/src/lib/msun/amd64 -I/usr/home/tgk/src/freebsd/src/lib/msun/x86 -I/usr/home/tgk/src/freebsd/src/lib/msun/src -c /usr/home/tgk/src/freebsd/src/lib/libc/gen/auxv.c -o auxv.o
/usr/home/tgk/src/freebsd/src/lib/libc/gen/auxv.c:148:8: error: use of undeclared identifier 'AT_USRSTACKBASE'
                case AT_USRSTACKBASE:
                     ^
/usr/home/tgk/src/freebsd/src/lib/libc/gen/auxv.c:152:8: error: use of undeclared identifier 'AT_USRSTACKLIM'
                case AT_USRSTACKLIM:
                     ^
/usr/home/tgk/src/freebsd/src/lib/libc/gen/auxv.c:381:7: error: use of undeclared identifier 'AT_USRSTACKBASE'
        case AT_USRSTACKBASE:
             ^
/usr/home/tgk/src/freebsd/src/lib/libc/gen/auxv.c:391:7: error: use of undeclared identifier 'AT_USRSTACKLIM'
        case AT_USRSTACKLIM:
             ^
4 errors generated.
*** [auxv.o] Error code 1

Bash:
--- arc4random.o ---
 -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments -I/usr/home/tgk/src/freebsd/src/sys -I/usr/home/tgk/src/freebsd/src/sys/crypto/chacha20   -I/usr/home/tgk/src/freebsd/src/lib/libutil -I/usr/home/tgk/src/freebsd/src/lib/msun/amd64 -I/usr/home/tgk/src/freebsd/src/lib/msun/x86 -I/usr/home/tgk/src/freebsd/src/lib/msun/src -c /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c -o arc4random.o
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:55:22: error: redefinition of typedef '__int8_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef signed char             __int8_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:45:22: note: previous definition is here
typedef signed char             __int8_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:56:24: error: redefinition of typedef '__uint8_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef unsigned char           __uint8_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:46:24: note: previous definition is here
typedef unsigned char           __uint8_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:57:17: error: redefinition of typedef '__int16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef short                   __int16_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:47:17: note: previous definition is here
typedef short                   __int16_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:58:25: error: redefinition of typedef '__uint16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef unsigned short          __uint16_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:48:25: note: previous definition is here
typedef unsigned short          __uint16_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:59:15: error: redefinition of typedef '__int32_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef int                     __int32_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:49:15: note: previous definition is here
typedef int                     __int32_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:60:23: error: redefinition of typedef '__uint32_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef unsigned int            __uint32_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:50:23: note: previous definition is here
typedef unsigned int            __uint32_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:62:16: error: redefinition of typedef '__int64_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef long                    __int64_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:52:16: note: previous definition is here
typedef long                    __int64_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:63:24: error: redefinition of typedef '__uint64_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef unsigned long           __uint64_t;
                                ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:53:24: note: previous definition is here
typedef unsigned long           __uint64_t;
                                ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:81:19: error: redefinition of typedef '__intfptr_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __intfptr_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:76:19: note: previous definition is here
typedef __int64_t       __intfptr_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:82:19: error: redefinition of typedef '__intptr_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __intptr_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:75:19: note: previous definition is here
typedef __int64_t       __intptr_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:93:19: error: redefinition of typedef '__intmax_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __intmax_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:67:19: note: previous definition is here
typedef __int64_t       __intmax_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:98:18: error: redefinition of typedef '__int_least8_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int8_t        __int_least8_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:63:18: note: previous definition is here
typedef __int8_t        __int_least8_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:99:19: error: redefinition of typedef '__int_least16_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int16_t       __int_least16_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:64:19: note: previous definition is here
typedef __int16_t       __int_least16_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:100:19: error: redefinition of typedef '__int_least32_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int32_t       __int_least32_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:65:19: note: previous definition is here
typedef __int32_t       __int_least32_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:101:19: error: redefinition of typedef '__int_least64_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __int_least64_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:66:19: note: previous definition is here
typedef __int64_t       __int_least64_t;
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:103:19: error: redefinition of typedef '__ptrdiff_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __ptrdiff_t;            /* ptr1 - ptr2 */
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:103:19: note: previous definition is here
typedef __int64_t       __ptrdiff_t;    /* ptr1 - ptr2 */
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:106:20: error: redefinition of typedef '__size_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __uint64_t      __size_t;               /* sizeof() */
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:93:20: note: previous definition is here
typedef __uint64_t      __size_t;       /* sizeof() */
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:107:19: error: redefinition of typedef '__ssize_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __int64_t       __ssize_t;              /* byte count or error */
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:94:19: note: previous definition is here
typedef __int64_t       __ssize_t;      /* byte count or error */
                        ^
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/arc4random.c:33:
In file included from /usr/include/fcntl.h:50:
In file included from /usr/home/tgk/src/freebsd/src/sys/sys/_types.h:113:
In file included from /usr/include/machine/_types.h:6:
/usr/include/x86/_types.h:109:20: error: redefinition of typedef '__uintfptr_t' is a C11 feature [-Werror,-Wtypedef-redefinition]
typedef __uint64_t      __uintfptr_t;
                        ^
/usr/home/tgk/src/freebsd/src/sys/sys/_types.h:78:20: note: previous definition is here
typedef __uint64_t      __uintfptr_t;
                        ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
*** [arc4random.o] Error code 1

make: stopped in /usr/home/tgk/src/freebsd/src/lib/libc
--- cap_sandboxed.o ---
cc  -O2 -pipe -fno-common   -DNO__SCCSID -DNO__RCSID -I/usr/home/tgk/src/freebsd/src/lib/libc/include -I/usr/home/tgk/src/freebsd/src/include -I/usr/home/tgk/src/freebsd/src/lib/libc/amd64 -DNLS  -ftls-model=initial-exec -DCRT_IRELOC_RELA  -DINIT_IRELOCS="init_cpu_features()" -I/usr/home/tgk/src/freebsd/src/lib/libc/csu/amd64 -D__DBINTERFACE_PRIVATE -I/usr/home/tgk/src/freebsd/src/contrib/gdtoa -I/usr/home/tgk/src/freebsd/src/contrib/libc-vis -DINET6 -I/usr/home/tgk/src/freebsd/src/build/usr/home/tgk/src/freebsd/src/lib/libc -I/usr/home/tgk/src/freebsd/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/home/tgk/src/freebsd/src/lib/libmd -I/usr/home/tgk/src/freebsd/src/contrib/jemalloc/include -I/usr/home/tgk/src/freebsd/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/home/tgk/src/freebsd/src/lib/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -gz=zlib -MD  -MF.depend.cap_sandboxed.o -MTcap_sandboxed.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments    -I/usr/home/tgk/src/freebsd/src/lib/libutil -I/usr/home/tgk/src/freebsd/src/lib/msun/amd64 -I/usr/home/tgk/src/freebsd/src/lib/msun/x86 -I/usr/home/tgk/src/freebsd/src/lib/msun/src -c /usr/home/tgk/src/freebsd/src/lib/libc/gen/cap_sandboxed.c -o cap_sandboxed.o

--- basename_compat.o ---
cc  -O2 -pipe -fno-common   -DNO__SCCSID -DNO__RCSID -I/usr/home/tgk/src/freebsd/src/lib/libc/include -I/usr/home/tgk/src/freebsd/src/include -I/usr/home/tgk/src/freebsd/src/lib/libc/amd64 -DNLS  -ftls-model=initial-exec -DCRT_IRELOC_RELA  -DINIT_IRELOCS="init_cpu_features()" -I/usr/home/tgk/src/freebsd/src/lib/libc/csu/amd64 -D__DBINTERFACE_PRIVATE -I/usr/home/tgk/src/freebsd/src/contrib/gdtoa -I/usr/home/tgk/src/freebsd/src/contrib/libc-vis -DINET6 -I/usr/home/tgk/src/freebsd/src/build/usr/home/tgk/src/freebsd/src/lib/libc -I/usr/home/tgk/src/freebsd/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/home/tgk/src/freebsd/src/lib/libmd -I/usr/home/tgk/src/freebsd/src/contrib/jemalloc/include -I/usr/home/tgk/src/freebsd/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/home/tgk/src/freebsd/src/lib/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -gz=zlib -MD  -MF.depend.basename_compat.o -MTbasename_compat.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments    -I/usr/home/tgk/src/freebsd/src/lib/libutil -I/usr/home/tgk/src/freebsd/src/lib/msun/amd64 -I/usr/home/tgk/src/freebsd/src/lib/msun/x86 -I/usr/home/tgk/src/freebsd/src/lib/msun/src -c /usr/home/tgk/src/freebsd/src/lib/libc/gen/basename_compat.c -o basename_compat.o

2 errors

make: stopped in /usr/home/tgk/src/freebsd/src/lib/libc

If I make without tests WITHOUT_TESTS=yes I get following errors

Bash:
--- errno.o ---
--- elf_utils.o ---
/usr/home/tgk/src/freebsd/src/lib/libc/gen/elf_utils.c:84:20: error: use of undeclared identifier 'AT_USRSTACKBASE'
        if (_elf_aux_info(AT_USRSTACKBASE, &usrstack, sizeof(usrstack)) != 0) {
                          ^
/usr/home/tgk/src/freebsd/src/lib/libc/gen/elf_utils.c:91:20: error: use of undeclared identifier 'AT_USRSTACKLIM'
        if (_elf_aux_info(AT_USRSTACKLIM, &stacksz, sizeof(stacksz)) != 0) {
                          ^
2 errors generated.
*** [elf_utils.o] Error code 1

make: stopped in /usr/home/tgk/src/freebsd/src/lib/libc
--- errno.o ---
cc  -O2 -pipe -fno-common   -DNO__SCCSID -DNO__RCSID -I/usr/home/tgk/src/freebsd/src/lib/libc/include -I/usr/home/tgk/src/freebsd/src/include -I/usr/home/tgk/src/freebsd/src/lib/libc/amd64 -DNLS  -ftls-model=initial-exec -DCRT_IRELOC_RELA  -DINIT_IRELOCS="init_cpu_features()" -I/usr/home/tgk/src/freebsd/src/lib/libc/csu/amd64 -D__DBINTERFACE_PRIVATE -I/usr/home/tgk/src/freebsd/src/contrib/gdtoa -I/usr/home/tgk/src/freebsd/src/contrib/libc-vis -DINET6 -I/usr/home/tgk/src/freebsd/src/build/usr/home/tgk/src/freebsd/src/lib/libc -I/usr/home/tgk/src/freebsd/src/lib/libc/resolv -D_ACL_PRIVATE -DPOSIX_MISTAKE -I/usr/home/tgk/src/freebsd/src/lib/libmd -I/usr/home/tgk/src/freebsd/src/contrib/jemalloc/include -I/usr/home/tgk/src/freebsd/src/lib/libc/locale -DBROKEN_DES -DPORTMAP -DDES_BUILTIN -I/usr/home/tgk/src/freebsd/src/lib/libc/rpc -DWANT_HYPERV -DYP -DNS_CACHING -DSYMBOL_VERSIONING -g -gz=zlib -MD  -MF.depend.errno.o -MTerrno.o -std=gnu99 -Wno-format-zero-length -fstack-protector-strong -Wsystem-headers -Werror -Wall -Wno-format-y2k -Wno-uninitialized -Wno-pointer-sign -Wdate-time -Wno-empty-body -Wno-string-plus-int -Wno-unused-const-variable -Wno-error=unused-but-set-variable -Wno-tautological-compare -Wno-unused-value -Wno-parentheses-equality -Wno-unused-function -Wno-enum-conversion -Wno-unused-local-typedef -Wno-address-of-packed-member -Wno-switch -Wno-switch-enum -Wno-knr-promoted-parameter  -Qunused-arguments    -I/usr/home/tgk/src/freebsd/src/lib/libutil -I/usr/home/tgk/src/freebsd/src/lib/msun/amd64 -I/usr/home/tgk/src/freebsd/src/lib/msun/x86 -I/usr/home/tgk/src/freebsd/src/lib/msun/src -c /usr/home/tgk/src/freebsd/src/lib/libc/gen/errno.c -o errno.o
--- dlfcn.o ---
In file included from /usr/home/tgk/src/freebsd/src/lib/libc/gen/dlfcn.c:46:
In file included from /usr/home/tgk/src/freebsd/src/libexec/rtld-elf/rtld.h:45:
/usr/home/tgk/src/freebsd/src/libexec/rtld-elf/amd64/rtld_machdep.h:36:10: fatal error: 'machine/tls.h' file not found
#include <machine/tls.h>
         ^~~~~~~~~~~~~~~
1 error generated.
*** [dlfcn.o] Error code 1

make: stopped in /usr/home/tgk/src/freebsd/src/lib/libc
2 errors

make: stopped in /usr/home/tgk/src/freebsd/src/lib/libc
 
Maybe a stupid question, but did you do a full make buildworld before?

This looks a lot like missing "dir-dependencies". And while at least meta-mode promises to solve this for good, AFAIR it also needs one "bootstrap" build to work correctly.
 
Maybe a stupid question, but did you do a full make buildworld before?

This looks a lot like missing "dir-dependencies". And while at least meta-mode promises to solve this for good, AFAIR it also needs one "bootstrap" build to work correctly.
Yes I did. I will clean and rebuild and after that try again
 
On 13.1-RELEASE-p6 make -C lib/libc -j8 MAKEOBJDIRPREFIX=/tmp/objdir works perfectly fine. Not sure which version you are on, how OS was installed, if all sources are downloaded and up to date.
 
Hi everyone. I have managed to build only libc. I don't know for sure what was the problem. I started from scratch cleaned everything and rebuilt
FreeBSD userland. After that building only libc works.
 
Back
Top