From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x334.google.com (mail-ot1-x334.google.com [IPv6:2607:f8b0:4864:20::334]) by sourceware.org (Postfix) with ESMTPS id 0ED333858D32 for ; Thu, 10 Aug 2023 17:50:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 0ED333858D32 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-ot1-x334.google.com with SMTP id 46e09a7af769-6bd0a0a675dso1071522a34.2 for ; Thu, 10 Aug 2023 10:50:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1691689817; x=1692294617; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=gWtLCnAvN1b9qGLY9FIjqkDaMx3ks+Wdgk6p121ZQlQ=; b=jRTtKa9tZM75+3Q2sE/0M12kZgMCuWZ8/oPrkDYItXqSSaXPpXZHGf53WH5tHEWbSR 41FFcA1K8Dfgo48kJuDyJvIoWhEYe25AbyTuron4myTFbepNoAX32KJzuxfubjrtx5AW qk2YXHFeSzsEFyPV5tGEORwoJ9uq+VFiyLywysMd5exNoBllqHuU/+GzRyDk9ol86QWg L0ftmZ77w89GvAvSRiKa0jr/k5EYcCZ7IX1Ji4IhzOiZFcexfMql5z4mGntbLXKzBVph ZrhHJDh2RLuA7qct67SFBbocojqBdMIC+Q/k5vx9hw9mk5hG3CLcp2G7TQ3lRFrGUOKC AR7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691689817; x=1692294617; h=content-transfer-encoding:in-reply-to:organization:from:references :to:content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gWtLCnAvN1b9qGLY9FIjqkDaMx3ks+Wdgk6p121ZQlQ=; b=YkWWMzpL56pTrCOAiXNUatWeMSkSdKfom+o86PLUTwK1t0eLG7MsMmOcq1WtPOL7+M 1PGbZT6FqYXSD6YYohcY+3d69No99A8WyZMa0BjK0O7LORgAER+GSj9Aa8JKzK94DIOy DSl9EpPOmHv0zo0YauApSTlcZHMPH3wwjjfMQs1x+gR3ijHD1cPEHnNxmNaqJystB/p2 igGC/KyFC9fAvYw8KsFcT76sAS6BnSD9xaHetXhzhCE/buV9chhXyTGudTKbh5na1thR XxXSedANe3jUG+Tn9HUY3JnEZSq6035T+FKi5ZLf8D8eBDqu0Da45jJOkmjcu9uUYozH Rl7Q== X-Gm-Message-State: AOJu0Yxm1kcVHkqhmXmMIKf7i34Kw7n6bMM0tCcBSjyzwoq/l1D3Sbcc KNa45MU/hQc6Xa+JEvuoj+Ark3L5iWd0aJn8vTKfuA== X-Google-Smtp-Source: AGHT+IEs4s2y4aQpl+QYE2iHgy3V2j0sWIdZY8v5bEQABndI6Au9ZtmFF6ZOXFPEK83XmtLbGybj8g== X-Received: by 2002:a9d:73d3:0:b0:6bc:e6bc:5dbf with SMTP id m19-20020a9d73d3000000b006bce6bc5dbfmr3295552otk.23.1691689817337; Thu, 10 Aug 2023 10:50:17 -0700 (PDT) Received: from [192.168.15.31] ([191.205.87.248]) by smtp.gmail.com with ESMTPSA id c21-20020a9d4815000000b006b9a98b9659sm855179otf.19.2023.08.10.10.50.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 10 Aug 2023 10:50:16 -0700 (PDT) Message-ID: <0f056187-277b-8b9c-96ac-1ae9d5073d96@linaro.org> Date: Thu, 10 Aug 2023 14:48:59 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.14.0 Subject: Re: Compiling glibc 2.14.1 on CentOS 6.10 Content-Language: en-US To: Alberto Mijares , libc-help References: From: Adhemerval Zanella Netto Organization: Linaro In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-12.8 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,URIBL_BLACK autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: 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.