Re: error: ‘__libc_single_threaded_internal’ undeclared

Adhemerval Zanella adhemerval.zanella@linaro.org
Sun Nov 20 17:18:14 GMT 2022


On Sun, Nov 20, 2022 at 10:55 AM Saifi Khan <saifi.khan@nishan.io> wrote:
>
> Hi:
>
> Trying to perform a 'out-of-source-tree' build glibc 'main' on K:  6.0.0-4-amd64, L: (Debian GLIBC 2.36-5), C: gcc 12.2.0.
>
> The following error is encountered.
>
> gcc-12 ../sysdeps/unix/sysv/linux/sigsuspend.c -c -std=gnu11 -fgnu89-inline  -O2 -pipe -Wall -Wwrite-strings -Wundef -Werror -fmerge-all-constants -frounding-math -fno-stack-protector -fno-common -Wstrict-prototypes -Wold-style-definition -fmath-errno    -fPIC -fexceptions -fasynchronous-unwind-tables  -ftls-model=initial-exec      -I../include -I/opt/work/linux/glibc/build/signal  -I/opt/work/linux/glibc/build  -I../sysdeps/unix/sysv/linux/x86_64/64  -I../sysdeps/unix/sysv/linux/x86_64  -I../sysdeps/unix/sysv/linux/x86/include -I../sysdeps/unix/sysv/linux/x86  -I../sysdeps/x86/nptl  -I../sysdeps/unix/sysv/linux/wordsize-64  -I../sysdeps/x86_64/nptl  -I../sysdeps/unix/sysv/linux/include -I../sysdeps/unix/sysv/linux  -I../sysdeps/nptl  -I../sysdeps/pthread  -I../sysdeps/gnu  -I../sysdeps/unix/inet  -I../sysdeps/unix/sysv  -I../sysdeps/unix/x86_64  -I../sysdeps/unix  -I../sysdeps/posix  -I../sysdeps/x86_64/64  -I../sysdeps/x86_64/fpu/multiarch  -I../sysdeps/x86_64/fpu  -I../sysdeps/x86
>  /fpu  -I../sysdeps/x86_64/multiarch  -I../sysdeps/x86_64  -I../sysdeps/x86/include -I../sysdeps/x86  -I../sysdeps/ieee754/float128  -I../sysdeps/ieee754/ldbl-96/include -I../sysdeps/ieee754/ldbl-96  -I../sysdeps/ieee754/dbl-64  -I../sysdeps/ieee754/flt-32  -I../sysdeps/wordsize-64  -I../sysdeps/ieee754  -I../sysdeps/generic  -I.. -I../libio -I.  -D_LIBC_REENTRANT -include /opt/work/linux/glibc/build/libc-modules.h -DMODULE_NAME=libc -include ../include/libc-symbols.h  -DPIC -DSHARED     -DTOP_NAMESPACE=glibc -o /opt/work/linux/glibc/build/signal/sigsuspend.os -MD -MP -MF /opt/work/linux/glibc/build/signal/sigsuspend.os.dt -MT /opt/work/linux/glibc/build/signal/sigsuspend.os
> In file included from ../sysdeps/unix/sysv/linux/x86_64/single-thread.h:2,
>                  from ../sysdeps/unix/sysdep.h:19,
>                  from ../sysdeps/unix/x86_64/sysdep.h:18,
>                  from ../sysdeps/unix/sysv/linux/x86_64/sysdep.h:23,
>                  from ../sysdeps/unix/sysv/linux/sysdep-cancel.h:23,
>                  from ../sysdeps/unix/sysv/linux/sigsuspend.c:19:
> ../sysdeps/unix/sysv/linux/sigsuspend.c: In function ‘__sigsuspend’:
> ../sysdeps/unix/sysv/linux/single-thread.h:38:27: error: ‘__libc_single_threaded_internal’ undeclared (first use in this function); did you mean ‘__libc_single_threaded’?
>
>    38 | # define SINGLE_THREAD_P (__libc_single_threaded_internal != 0)
>       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/unix/sysdep.h:115:37: note: in expansion of macro ‘SINGLE_THREAD_P’
>   115 | # define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P
>       |                                     ^~~~~~~~~~~~~~~
> ../sysdeps/unix/sysdep.h:121:9: note: in expansion of macro ‘NO_SYSCALL_CANCEL_CHECKING’
>   121 |     if (NO_SYSCALL_CANCEL_CHECKING)                                          \
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/unix/sysv/linux/sigsuspend.c:26:10: note: in expansion of macro ‘SYSCALL_CANCEL’
>    26 |   return SYSCALL_CANCEL (rt_sigsuspend, set, __NSIG_BYTES);
>       |          ^~~~~~~~~~~~~~
> ../sysdeps/unix/sysv/linux/single-thread.h:38:27: note: each undeclared identifier is reported only once for each function it appears in
>    38 | # define SINGLE_THREAD_P (__libc_single_threaded_internal != 0)
>       |                           ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/unix/sysdep.h:115:37: note: in expansion of macro ‘SINGLE_THREAD_P’
>   115 | # define NO_SYSCALL_CANCEL_CHECKING SINGLE_THREAD_P
>       |                                     ^~~~~~~~~~~~~~~
> ../sysdeps/unix/sysdep.h:121:9: note: in expansion of macro ‘NO_SYSCALL_CANCEL_CHECKING’
>   121 |     if (NO_SYSCALL_CANCEL_CHECKING)                                          \
>       |         ^~~~~~~~~~~~~~~~~~~~~~~~~~
> ../sysdeps/unix/sysv/linux/sigsuspend.c:26:10: note: in expansion of macro ‘SYSCALL_CANCEL’
>    26 |   return SYSCALL_CANCEL (rt_sigsuspend, set, __NSIG_BYTES);
>       |          ^~~~~~~~~~~~~~
> make[2]: *** [/opt/work/linux/glibc/build/sysd-rules:229: /opt/work/linux/glibc/build/signal/sigsuspend.os] Error 1
> make[2]: Leaving directory '/opt/work/linux/glibc/src/signal'
> make[1]: *** [Makefile:484: signal/subdir_lib] Error 2
> make[1]: Leaving directory '/opt/work/linux/glibc/src'
> make: *** [Makefile:9: all] Error 2
>
> Has anybody encountered this before ? Any pointers ?
>
> warm regards
> Saifi.

Do you mean by 'out-of-source-tree' that you are just trying to
compile the source without all
the internal files and definitions? If so you will need to copy and/or
add any required definition
(requires either by compiler or by the linker).


More information about the Libc-help mailing list