Re: error: ‘__libc_single_threaded_internal’ undeclared
Adhemerval Zanella
adhemerval.zanella@linaro.org
Sun Nov 20 18:15:45 GMT 2022
On Sun, Nov 20, 2022 at 2:41 PM Saifi Khan <saifi.khan@nishan.io> wrote:
>
> > -------Original Message-------
> > From: Adhemerval Zanella
> >
> > Do you mean by 'out-of-source-tree' that you are just trying to
> > compile the source without all the internal files and definitions?
> >
>
> Adhemerval, thanks for your kind reply.
>
> The directory tree structure looks like this
>
> /opt/work/linux/glibc/
> ├── build
> └── src
>
> In the build directory, i first execute a configure script (b02.sh)
>
> DIR_ONE=/opt/work/linux/glibc
>
> DIR_SRC=${DIR_ONE}/src
> DIR_DST=${DIR_ONE}/root
>
> CC="gcc-12"
> CXX="g++-12"
> CFLAGS="-O2 -pipe"
> CXXFLAGS="${CFLAGS}"
>
> CC="gcc-12" CXX="g++-12" CFLAGS="-O2 -pipe" CXXFLAGS="${CFLAGS}" ${DIR_SRC}/configure \
> --prefix=${DIR_DST} \
> --exec-prefix=${DIR_DST} \
> --datarootdir=${DIR_DST}/doc/share \
> --datadir=${DIR_DST}/doc \
> --docdir=${DIR_DST}/doc \
> --htmldir=${DIR_DST}/doc \
> --mandir=${DIR_DST}/doc/man \
> --infodir=${DIR_DST}/doc/info \
> --enable-add-ons \
> --disable-hidden-plt \
> --disable-profile \
> --enable-stack-protector=no \
> --enable-shared \
> --enable-ld=yes \
> --with-gnu-ld \
> --without-selinux
> exit 0;
>
> next i execute the build script (b04.sh)
>
> make -j1
>
> that's when the above mentioned error was seen.
>
> Do you think anything needs to be changed in the options that are being passed to the configure script ?
>
> warm regards
> Saifi.
This is due --disable-hidden-plt option, which is a bit rotten option
that I think we should remove
it (it is required for Hurd, but it can handle on its internal
definition). Even the following fix:
diff --git a/include/libc-symbols.h b/include/libc-symbols.h
index f4437ff6ad..221fa18294 100644
--- a/include/libc-symbols.h
+++ b/include/libc-symbols.h
@@ -599,7 +599,12 @@ for linking")
extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs);
# else
# define hidden_proto(name, attrs...)
-# define hidden_proto_alias(name, alias, attrs...)
+# define __hidden_proto_hiddenattr(attrs...) \
+ __attribute__ ((visibility ("hidden"), ##attrs))
+# define __hidden_proto_alias(name, thread, internal, attrs...) \
+ extern thread __typeof (name) internal __hidden_proto_hiddenattr (attrs);
+# define hidden_proto_alias(name, alias, attrs...) \
+ __hidden_proto_alias (name, , alias, ##attrs)
# define hidden_tls_proto(name, attrs...)
# endif
# else
It fails later for setrlimit64.c build (at least for aarch64). I
advise just removing it, it is not actively tested.
Also, --enable-add-ons is not required anymore, --enable-shared is the
default, --enable-ld=yes and --with-gnu-ld
is also not required.
More information about the Libc-help
mailing list