public inbox for libc-help@sourceware.org
 help / color / mirror / Atom feed
* Building 2.27 on CentOS
@ 2018-05-29  9:21 Andreas Hubert
  2018-05-29 11:25 ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Hubert @ 2018-05-29  9:21 UTC (permalink / raw)
  To: libc-help

[-- Attachment #1: Type: text/plain, Size: 2091 bytes --]

Hi everyone,

I’d like to build glibc under a CentOS to be packed in a RPM and a different root dir.
But currently I have problems with my build and hope someone can help me.

gcc   -nostdlib -nostartfiles -r -o /root/rpmbuild/BUILD/glibc-build/elf/librtld.os '-Wl,-(' /root/rpmbuild/BUILD/glibc-build/elf/dl-allobjs.os /root/rpmbuild/BUILD/glibc-build/elf/rtld-libc.a -lgcc '-Wl,-)' \
        -Wl,-Map,/root/rpmbuild/BUILD/glibc-build/elf/librtld.os.map
gcc   -nostdlib -nostartfiles -shared -o /root/rpmbuild/BUILD/glibc-build/elf/ld.so.new         \
        -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs       \
        /root/rpmbuild/BUILD/glibc-build/elf/librtld.os -Wl,--version-script=/root/rpmbuild/BUILD/glibc-build/ld.map          \
        -Wl,-soname=ld-linux-x86-64.so.2                      \
        -Wl,-defsym=_begin=0
/root/rpmbuild/BUILD/glibc-build/elf/librtld.os: In function `dl_main':
rtld.c:(.text+0x25ab): undefined reference to `__open'
rtld.c:(.text+0x2b19): undefined reference to `__access'
rtld.c:(.text+0x441c): undefined reference to `__access'
/root/rpmbuild/BUILD/glibc-build/elf/librtld.os: In function `lose.isra.5':
dl-load.c:(.text+0x485a): undefined reference to `__close'
/root/rpmbuild/BUILD/glibc-build/elf/librtld.os: In function `_dl_map_object_from_fd':
dl-load.c:(.text+0x490c): undefined reference to `__GI___fxstat64'
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /root/rpmbuild/BUILD/glibc-build/elf/librtld.os: relocation R_X86_64_PC32 against undefined symbol `__GI___fxstat64' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [/root/rpmbuild/BUILD/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory `/root/rpmbuild/BUILD/glibc-2.27/elf'
make[1]: *** [elf/subdir_lib] Error 2
make[1]: Leaving directory `/root/rpmbuild/BUILD/glibc-2.27'
make: *** [all] Error 2

Thanks for any help
Andreas

[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-05-29  9:21 Building 2.27 on CentOS Andreas Hubert
@ 2018-05-29 11:25 ` Florian Weimer
  2018-05-29 12:05   ` Andreas Hubert
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2018-05-29 11:25 UTC (permalink / raw)
  To: Andreas Hubert; +Cc: libc-help

On 05/29/2018 11:21 AM, Andreas Hubert wrote:
> I’d like to build glibc under a CentOS to be packed in a RPM and a different root dir.
> But currently I have problems with my build and hope someone can help me.

I regularly build upstream glibc with DTS 7 and have not seen anything 
like this.  How do you invoke configure and make?

Thanks,
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-05-29 11:25 ` Florian Weimer
@ 2018-05-29 12:05   ` Andreas Hubert
  2018-06-01 10:45     ` Andreas Hubert
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Hubert @ 2018-05-29 12:05 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 970 bytes --]

Basically just run
configure —prefix=/somewhere/else
make

I tried with different options and CFLAGS etc. but currently I always end up with the same error.
Currently I try with CC=“gcc -fPIC” but make takes really a while on my machine..
When I use make -j6 then I get another error that some .os file does not exist, which I guess in this case is because the multiple jobs disturb each other.
I tried to attach config.log and make.log, but it seemed it didn’t came through on this mailinglist then.

> Am 29.05.2018 um 13:25 schrieb Florian Weimer <fweimer@redhat.com>:
> 
> On 05/29/2018 11:21 AM, Andreas Hubert wrote:
>> I’d like to build glibc under a CentOS to be packed in a RPM and a different root dir.
>> But currently I have problems with my build and hope someone can help me.
> 
> I regularly build upstream glibc with DTS 7 and have not seen anything like this.  How do you invoke configure and make?
> 
> Thanks,
> Florian


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-05-29 12:05   ` Andreas Hubert
@ 2018-06-01 10:45     ` Andreas Hubert
  2018-06-01 11:33       ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Hubert @ 2018-06-01 10:45 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 5636 bytes --]

To have a really clean environment for testing, I just tried it with a docker container based on centos/devtoolset-7-toolchain-centos7 and just added bison and make. So that’s my docker file:

```
FROM centos/devtoolset-7-toolchain-centos7

USER 0
RUN yum install -y --setopt=tsflags=nodocs bison devtoolset-7-make && yum clean all -y
USER 1001
```

From there I was just running `configure —prefix=/my/new/dir` and then make
Still facing the same error:

```
make[3]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/elf'
gcc   -nostdlib -nostartfiles -r -o /builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os '-Wl,-(' /builddir/rpmbuild/SOURCES/glibc-build/elf/dl-allobjs.os /builddir/rpmbuild/SOURCES/glibc-build/elf/rtld-libc.a -lgcc '-Wl,-)' \
          -Wl,-Map,/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os.map
gcc   -nostdlib -nostartfiles -shared -o /builddir/rpmbuild/SOURCES/glibc-build/elf/ld.so.new              \
          -Wl,-z,combreloc -Wl,-z,relro -Wl,--hash-style=both -Wl,-z,defs       \
          /builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os -Wl,--version-script=/builddir/rpmbuild/SOURCES/glibc-build/ld.map            \
          -Wl,-soname=ld-linux-x86-64.so.2                      \
          -Wl,-defsym=_begin=0
/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: In function `process_envvars':
/builddir/rpmbuild/SOURCES/glibc-2.27/elf/rtld.c:2677: undefined reference to `__open'
/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: In function `dl_main':
/builddir/rpmbuild/SOURCES/glibc-2.27/elf/rtld.c:1629: undefined reference to `__access'
/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: In function `process_envvars':
/builddir/rpmbuild/SOURCES/glibc-2.27/elf/rtld.c:2651: undefined reference to `__access'
/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: In function `lose':
/builddir/rpmbuild/SOURCES/glibc-2.27/elf/dl-load.c:780: undefined reference to `__close'
/builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: In function `_dl_get_file_id':
/builddir/rpmbuild/SOURCES/glibc-2.27/elf/../sysdeps/posix/dl-fileid.h:37: undefined reference to `__GI___fxstat64'
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: /builddir/rpmbuild/SOURCES/glibc-build/elf/librtld.os: relocation R_X86_64_PC32 against undefined symbol `__GI___fxstat64' can not be used when making a shared object; recompile with -fPIC
/opt/rh/devtoolset-7/root/usr/libexec/gcc/x86_64-redhat-linux/7/ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make[2]: *** [Makefile:478: /builddir/rpmbuild/SOURCES/glibc-build/elf/ld.so] Error 1
make[2]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/elf'
make[1]: *** [Makefile:215: elf/subdir_lib] Error 2
make[1]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27'
make: *** [Makefile:9: all] Error 2
```

And as a side note, if I try it with `make -j6` I get this error:
```
make[2]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/locale'
make  subdir=localedata -C localedata ..=../ subdir_lib
make[2]: Entering directory '/builddir/rpmbuild/SOURCES/glibc-2.27/localedata'
.././scripts/mkinstalldirs /builddir/rpmbuild/SOURCES/glibc-build/localedata
.././scripts/mkinstalldirs /builddir/rpmbuild/SOURCES/glibc-build/localedata
.././scripts/mkinstalldirs /builddir/rpmbuild/SOURCES/glibc-build/localedata
mkdir -p -- /builddir/rpmbuild/SOURCES/glibc-build/localedata
mkdir -p -- /builddir/rpmbuild/SOURCES/glibc-build/localedata
rm -f /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.o; > /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.o
mkdir -p -- /builddir/rpmbuild/SOURCES/glibc-build/localedata
rm -f /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.os; > /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.os
rm -f /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.oS; > /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.oS
/bin/sh: /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.oS: File exists
make[2]: *** [../Makerules:920: /builddir/rpmbuild/SOURCES/glibc-build/localedata/stamp.oS] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/localedata'
make[1]: *** [Makefile:215: localedata/subdir_lib] Error 2
make[1]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27'
make: *** [Makefile:9: all] Error 2
```

Any suggestions what am I missing or how can make this finally compile?

> Am 29.05.2018 um 14:04 schrieb Andreas Hubert <anhubert@googlemail.com>:
> 
> Basically just run
> configure —prefix=/somewhere/else
> make
> 
> I tried with different options and CFLAGS etc. but currently I always end up with the same error.
> Currently I try with CC=“gcc -fPIC” but make takes really a while on my machine..
> When I use make -j6 then I get another error that some .os file does not exist, which I guess in this case is because the multiple jobs disturb each other.
> I tried to attach config.log and make.log, but it seemed it didn’t came through on this mailinglist then.
> 
>> Am 29.05.2018 um 13:25 schrieb Florian Weimer <fweimer@redhat.com>:
>> 
>> On 05/29/2018 11:21 AM, Andreas Hubert wrote:
>>> I’d like to build glibc under a CentOS to be packed in a RPM and a different root dir.
>>> But currently I have problems with my build and hope someone can help me.
>> 
>> I regularly build upstream glibc with DTS 7 and have not seen anything like this.  How do you invoke configure and make?
>> 
>> Thanks,
>> Florian
> 


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-06-01 10:45     ` Andreas Hubert
@ 2018-06-01 11:33       ` Florian Weimer
  2018-06-01 11:38         ` Andreas Hubert
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2018-06-01 11:33 UTC (permalink / raw)
  To: Andreas Hubert; +Cc: libc-help

On 06/01/2018 12:45 PM, Andreas Hubert wrote:
> To have a really clean environment for testing, I just tried it with a docker container based on centos/devtoolset-7-toolchain-centos7 and just added bison and make. So that’s my docker file:
> 
> ```
> FROM centos/devtoolset-7-toolchain-centos7
> 
> USER 0
> RUN yum install -y --setopt=tsflags=nodocs bison devtoolset-7-make && yum clean all -y
> USER 1001
> ```
> 
>  From there I was just running `configure —prefix=/my/new/dir` and then make
> Still facing the same error:
> 
> ```
> make[3]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/elf'

This looks like you are running under rpmbuild.  Please post the spec 
file, or upload it somewhere where we can see it.

You also have a funny character in the configure command line, but I 
assume that's just your email client.

All I can say so far that the glibc-2.27 tag generally builds fine with 
DTS 7.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-06-01 11:33       ` Florian Weimer
@ 2018-06-01 11:38         ` Andreas Hubert
  2018-06-01 11:43           ` Florian Weimer
  0 siblings, 1 reply; 8+ messages in thread
From: Andreas Hubert @ 2018-06-01 11:38 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 1407 bytes --]

My goal is to pack this in a RPM, but currently I just try to build it directly on the command line. Only after that works my next step would be to make it work with a spec file.
Maybe I have something wrong with my DTS 7 setup.. do you maybe have any sources you follow to setup you build environment that I could try to follow?

Thanks
Andreas

> Am 01.06.2018 um 13:33 schrieb Florian Weimer <fweimer@redhat.com>:
> 
> On 06/01/2018 12:45 PM, Andreas Hubert wrote:
>> To have a really clean environment for testing, I just tried it with a docker container based on centos/devtoolset-7-toolchain-centos7 and just added bison and make. So that’s my docker file:
>> ```
>> FROM centos/devtoolset-7-toolchain-centos7
>> USER 0
>> RUN yum install -y --setopt=tsflags=nodocs bison devtoolset-7-make && yum clean all -y
>> USER 1001
>> ```
>> From there I was just running `configure —prefix=/my/new/dir` and then make
>> Still facing the same error:
>> ```
>> make[3]: Leaving directory '/builddir/rpmbuild/SOURCES/glibc-2.27/elf'
> 
> This looks like you are running under rpmbuild.  Please post the spec file, or upload it somewhere where we can see it.
> 
> You also have a funny character in the configure command line, but I assume that's just your email client.
> 
> All I can say so far that the glibc-2.27 tag generally builds fine with DTS 7.
> 
> Thanks,
> Florian


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-06-01 11:38         ` Andreas Hubert
@ 2018-06-01 11:43           ` Florian Weimer
  2018-06-01 13:54             ` Andreas Hubert
  0 siblings, 1 reply; 8+ messages in thread
From: Florian Weimer @ 2018-06-01 11:43 UTC (permalink / raw)
  To: Andreas Hubert; +Cc: libc-help

On 06/01/2018 01:38 PM, Andreas Hubert wrote:
> My goal is to pack this in a RPM, but currently I just try to build it directly on the command line. Only after that works my next step would be to make it work with a spec file.

In this case, please show us the *exact* commands you use, not garbled 
by your mail client.  This includes the SCL activation step.

> Maybe I have something wrong with my DTS 7 setup.. do you maybe have any sources you follow to setup you build environment that I could try to follow?

I install devtoolset-7-gcc and devtoolset-7-gcc-c++, and the configure 
glibc with:

../git/configure --prefix=/usr CC=/opt/rh/devtoolset-7/root/usr/bin/gcc 
CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
make -j4

Alternatively, running

scl enable devtoolset-7 -- bash

and entering

../git/configure --prefix=/usr
make -j4

in the subshell (!) works as well.

Thanks,
Florian

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Building 2.27 on CentOS
  2018-06-01 11:43           ` Florian Weimer
@ 2018-06-01 13:54             ` Andreas Hubert
  0 siblings, 0 replies; 8+ messages in thread
From: Andreas Hubert @ 2018-06-01 13:54 UTC (permalink / raw)
  To: Florian Weimer; +Cc: libc-help

[-- Attachment #1: Type: text/plain, Size: 1801 bytes --]

The commands I provided where the exact ones, just double dash is garbled by my mail client: — vs --
But I think I found now the reason. Since you claimed you always compile like that and never had issues, I tried with a vagrant virtual box on centos and it worked without any problem and also way faster.

The problem I had was because I was running the build in docker container on MacOS inside a mounted volume.
So I will try to first copy my base directory inside the docker container to build it there and then copy back the resulting files and if this still fails I have to check how I could run my builds on a VM directly instead of docker.

Thanks for your hints which took me to the conclusion that something with my environment must be wrong.

> Am 01.06.2018 um 13:43 schrieb Florian Weimer <fweimer@redhat.com>:
> 
> On 06/01/2018 01:38 PM, Andreas Hubert wrote:
>> My goal is to pack this in a RPM, but currently I just try to build it directly on the command line. Only after that works my next step would be to make it work with a spec file.
> 
> In this case, please show us the *exact* commands you use, not garbled by your mail client.  This includes the SCL activation step.
> 
>> Maybe I have something wrong with my DTS 7 setup.. do you maybe have any sources you follow to setup you build environment that I could try to follow?
> 
> I install devtoolset-7-gcc and devtoolset-7-gcc-c++, and the configure glibc with:
> 
> ../git/configure --prefix=/usr CC=/opt/rh/devtoolset-7/root/usr/bin/gcc CXX=/opt/rh/devtoolset-7/root/usr/bin/g++
> make -j4
> 
> Alternatively, running
> 
> scl enable devtoolset-7 -- bash
> 
> and entering
> 
> ../git/configure --prefix=/usr
> make -j4
> 
> in the subshell (!) works as well.
> 
> Thanks,
> Florian


[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-06-01 13:54 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-29  9:21 Building 2.27 on CentOS Andreas Hubert
2018-05-29 11:25 ` Florian Weimer
2018-05-29 12:05   ` Andreas Hubert
2018-06-01 10:45     ` Andreas Hubert
2018-06-01 11:33       ` Florian Weimer
2018-06-01 11:38         ` Andreas Hubert
2018-06-01 11:43           ` Florian Weimer
2018-06-01 13:54             ` Andreas Hubert

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).