public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
From: Adhemerval Zanella Netto <adhemerval.zanella@linaro.org>
To: Alberto Mijares <amijaresp@gmail.com>,
	libc-help <libc-help@sourceware.org>
Subject: Re: Compiling glibc 2.14.1 on CentOS 6.10
Date: Thu, 10 Aug 2023 14:48:59 -0300	[thread overview]
Message-ID: <0f056187-277b-8b9c-96ac-1ae9d5073d96@linaro.org> (raw)
In-Reply-To: <CAGZBXN9nj44dZgXDXmR11M5gzhyAg4yBuKKcq+vUJHbiwk4WFg@mail.gmail.com>



On 09/08/23 21:29, Alberto Mijares via Libc-help wrote:
> Hello all,
> 
> This is my first post to this list and I'm not a developer so please
> forgive me if I look like a newbie.
> 
> I was assigned with the task to compile PHP 5.6 with an up-to-date
> OpenSSL version for CentOS 6.10 so they can integrate their legacy app
> with a third-party service. It has been a long journey  and now I'm
> very close.
> 
> Right now I'm trying to compile cmake. which is a requirement for
> brotli and this one for Apache -> mod_php56.
> 
> The compilation of cmake fails because it cannot find a reference to
> sendmmsg, only available since glibc 2.14 (according to a post
> somewhere). CentOS comes with glibc 2.12.
> 
> So, that's why I'm trying to compile glibc 2.14.1. I'm using pkgsrc as
> building framework and after a few patches I managed to get to this
> point
> 
> make[2]: Entering directory `/usr/pkgsrc/wip/glibc/work/glibc-2.14.1/elf'
> cc -L/opt/zvi/gcc7/lib/gcc/x86_64-redhat-linux/7.5.0
> -Wl,-R/opt/zvi/gcc7/lib/gcc/x86_64-redhat-linux/7.5.0
> -L/opt/zvi/gcc7/lib64 -Wl,-R/opt/zvi/gcc7/lib64 -Wl,-zrelro
> -L/opt/zvi/lib -L/usr/lib64 -Wl,-R/usr/lib64 -Wl,-R/opt/zvi/lib
> -nostdlib -nostartfiles -r -o
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/librtld.map.o
> '-Wl,-(' /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/dl-allobjs.os
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/libc_pic.a
> -lgcc '-Wl,-)' -Wl,-Map,/usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/librtld.mapT
> /opt/zvi/x86_64-redhat-linux/bin/ld:
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/libc_pic.a(init-first.os):(.data+0x0):
> multiple definition of `__libc_multiple_libcs';
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/dl-allobjs.os:(.bss+0xf4):
> first defined here
> /opt/zvi/x86_64-redhat-linux/bin/ld:
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/libc_pic.a(dl-addr.os):
> in function `_dl_addr_inside_object':
> dl-addr.c:(.text+0x353): multiple definition of
> `_dl_addr_inside_object';
> /usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/dl-allobjs.os:(.text+0x11d2e):
> first defined here
> collect2: error: ld returned 1 exit status
> make[2]: *** [/usr/pkgsrc/wip/glibc/work/glibc-2.14.1/glibc-configure/elf/librtld.map]
> Error 1
> make[2]: Leaving directory `/usr/pkgsrc/wip/glibc/work/glibc-2.14.1/elf'
> make[1]: *** [elf/subdir_lib] Error 2
> make[1]: Leaving directory `/usr/pkgsrc/wip/glibc/work/glibc-2.14.1'
> make: *** [all] Error 2
> *** Error code 2
> 
> Stop.
> bmake[1]: stopped in /usr/pkgsrc/wip/glibc
> *** Error code 1
> 
> Stop.
> bmake: stopped in /usr/pkgsrc/wip/glibc
> 
> This is what I'm using:
> gcc version 7.5.0 (GCC)
> GNU Make 3.81
> GNU ld (GNU Binutils) 2.40
> Linux  2.6.32-754.el6.x86_64
> pkgsrc-2023Q2
> 
> For getting there, I bootstrapped pkgsrc with the system tools and the
> compiled gcc7. Then, all the packages were made with gcc7 and combo.
> 
> Any hint, suggestion or advice would be very appreciated. Of course
> I'm willing to provide more info if needed.

This is most likely on how you configured your compiler.  Using the process
on build-many-glibc.py with the sources gcc-7:

$ x86_64-glibc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/home/azanella/toolchain/install/compilers/7/x86_64-linux-gnu/bin/x86_64-glibc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/home/azanella/toolchain/install/compilers/7/x86_64-linux-gnu/bin/../libexec/gcc/x86_64-glibc-linux-gnu/7.5.0/lto-wrapper
Target: x86_64-glibc-linux-gnu
Configured with: /home/azanella/toolchain/src/gcc/configure --prefix=/home/azanella/toolchain/install/compilers/x86_64-linux-gnu --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-glibc-linux-gnu --with-sysroot=/home/azanella/toolchain/install/compilers/x86_64-linux-gnu/sysroot --with-multilib-list=m64,m32,mx32 --disable-libssp --disable-libcilkrts --with-gmp=/home/azanella/toolchain/install/host-libraries --with-mpfr=/home/azanella/toolchain/install/host-libraries --with-mpc=/home/azanella/toolchain/install/host-libraries --disable-libsanitizer --disable-libstdcxx-pch --enable-languages=c,c++ --enable-shared --enable-threads
Thread model: posix
gcc version 7.5.0 (GCC)

I could build glibc-2.14 branch with just the following patch (to avoid
configure block the usage of newer gcc and make)

---
diff --git a/configure b/configure
index 6cf85e52ed..412cd36360 100755
--- a/configure
+++ b/configure
@@ -4939,7 +4939,7 @@ $as_echo_n "checking version of $CC... " >&6; }
   ac_prog_version=`$CC -v 2>&1 | sed -n 's/^.*version \([egcygnustpi-]*[0-9.]*\).*$/\1/p'`
   case $ac_prog_version in
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    3.4* | 4.[0-9]* )
+    3.4* | 4.[0-9]* | 4.[1-9][0-9].* | [5-9].* )
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;

@@ -5002,7 +5002,7 @@ $as_echo_n "checking version of $MAKE... " >&6; }
   ac_prog_version=`$MAKE --version 2>&1 | sed -n 's/^.*GNU Make[^0-9]*\([0-9][0-9.]*\).*$/\1/p'`
   case $ac_prog_version in
     '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
-    3.79* | 3.[89]*)
+    [4-9].* | [1-9][0-9]*)
        ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
     *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;

diff --git a/configure.in b/configure.in
index fbc64b9a7e..76005d7745 100644
--- a/configure.in
+++ b/configure.in
@@ -1026,11 +1026,11 @@ fi
 # These programs are version sensitive.
 AC_CHECK_TOOL_PREFIX
 AC_CHECK_PROG_VER(CC, ${ac_tool_prefix}gcc ${ac_tool_prefix}cc, -v,
-  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* ],
+  [version \([egcygnustpi-]*[0-9.]*\)], [3.4* | 4.[0-9]* | 4.[1-9][0-9].* | [5-9].* ],
   critic_missing="$critic_missing gcc")
 AC_CHECK_PROG_VER(MAKE, gnumake gmake make, --version,
   [GNU Make[^0-9]*\([0-9][0-9.]*\)],
-  [3.79* | 3.[89]*], critic_missing="$critic_missing make")
+  [[4-9].* | [1-9][0-9]*], critic_missing="$critic_missing make")

 AC_CHECK_PROG_VER(MSGFMT, gnumsgfmt gmsgfmt msgfmt, --version,
   [GNU gettext.* \([0-9]*\.[0-9.]*\)],
diff --git a/malloc/obstack.c b/malloc/obstack.c
index 75440d9c79..90d0100d2c 100644
--- a/malloc/obstack.c
+++ b/malloc/obstack.c
@@ -117,8 +117,8 @@ int obstack_exit_failure = EXIT_FAILURE;
 /* A looong time ago (before 1994, anyway; we're not sure) this global variable
    was used by non-GNU-C macros to avoid multiple evaluation.  The GNU C
    library still exports it because somebody might use it.  */
-struct obstack *_obstack_compat;
-compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
+//struct obstack *_obstack_compat;
+//compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0);
 #  endif
 # endif
---

x86_64-linux-gnu-gcc7$ ./elf/ld.so ./libc.so
GNU C Library stable release version 2.14.1, by Roland McGrath et al.
[...]
Compiled by GNU CC version 7.5.0.
Compiled on a Linux 5.19.0 system on 2023-08-10.
[...]

i686-linux-gnu-gcc7$ ./elf/ld.so ./libc.so
GNU C Library stable release version 2.14.1, by Roland McGrath et al.
[...]
Compiled by GNU CC version 7.5.0.
Compiled on a Linux 5.19.0 system on 2023-08-10.
[...]

I also to use --disable-werror, since we not that judicious with compile warning
back then.  So I would suggest you to first check on how your bootstrap compiler
was generated.

      reply	other threads:[~2023-08-10 17:50 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-10  0:29 Alberto Mijares
2023-08-10 17:48 ` Adhemerval Zanella Netto [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0f056187-277b-8b9c-96ac-1ae9d5073d96@linaro.org \
    --to=adhemerval.zanella@linaro.org \
    --cc=amijaresp@gmail.com \
    --cc=libc-help@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).