FS#27823 - [glibc 2.15-3] - cannot compile this PKG from ABS

Attached to Project: Arch Linux
Opened by John (graysky) - Wednesday, 04 January 2012, 15:53 GMT
Last edited by Allan McRae (Allan) - Thursday, 26 January 2012, 01:15 GMT
Task Type Bug Report
Category Packages: Core
Status Closed
Assigned To Allan McRae (Allan)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 3
Private No

Details

Description: Compile from ABS fails. My machine is running x86_64, has [testing] enabled, and is up-to-date.

Additional info:
* package version(s) 2.15-3

Steps to reproduce:

1) Compiled and installed linux-api-headers 3.1.6-1
2) Ran makepkg -srci on glibc which ended in errors - see attached log.
This task depends upon

Closed by  Allan McRae (Allan)
Thursday, 26 January 2012, 01:15 GMT
Reason for closing:  Won't fix
Additional comments about closing:  See final comment
Comment by John (graysky) - Wednesday, 04 January 2012, 20:23 GMT
I can confirm this now when building in a clean chroot as well... (x86_64 without [testing] enabled):

rch -I../nptl/sysdeps/x86_64 -I../sysdeps/x86_64 -I../sysdeps/wordsize-64 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64/wordsize-64 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic/elf -I../sysdeps/generic -I../nptl -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/include -isystem /usr/lib/gcc/x86_64-unknown-linux-gnu/4.6.2/include-fixed -isystem /usr/include -D_LIBC_REENTRANT -include ../include/libc-symbols.h -DNOT_IN_libc=1 -DIS_IN_libm=1 -o /build/src/glibc-build/math/s_ilogb.o -MD -MP -MF /build/src/glibc-build/math/s_ilogb.o.dt -MT /build/src/glibc-build/math/s_ilogb.o
make[2]: *** [/build/src/glibc-build/math/s_floor.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory `/build/src/glibc/math'
make[1]: *** [math/others] Error 2
make[1]: Leaving directory `/build/src/glibc'
make: *** [all] Error 2
==> ERROR: A failure occurred in build().
Aborting...
==> ERROR: Build failed, check /tmp/WORK/chroot64/facade/build
Comment by Allan McRae (Allan) - Wednesday, 04 January 2012, 20:32 GMT
graysky: your report does not even include the build error...

Edit: I now realize you are the original reporter too. So it is only your second comment that does not include it.
Comment by Allan McRae (Allan) - Wednesday, 04 January 2012, 20:43 GMT
Please give details on your CFLAGS etc. They do not seem to be the default.
Comment by John (graysky) - Wednesday, 04 January 2012, 21:05 GMT
Allan - building outside of the chroot (original report):

CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="${CFLAGS}"

Building inside of the chroot used the makepkg.conf that pacman provides; I didn't edit it.

I should add that I have been using this set of CFLAGS for a long time and never had a problem building the toolchain before.
Comment by Allan McRae (Allan) - Wednesday, 04 January 2012, 21:06 GMT
Inside the chroot, are all the packages as provided by Arch (i.e. not rebuilt yourself)?
Comment by John (graysky) - Wednesday, 04 January 2012, 21:08 GMT
Correct:

CHROOT=/tmp/WORK/chroot
mkdir $CHROOT
sudo mkarchroot $CHROOT/root base base-devel sudo
cp /var/abs/core/glibc ./ && cd glibc
sudo makechrootpkg -c -r $CHROOT
Comment by Allan McRae (Allan) - Wednesday, 04 January 2012, 21:34 GMT
I can not replicate on multiple machines...

Can you post the build log from the clean chroot?
Comment by John (graysky) - Wednesday, 04 January 2012, 21:43 GMT
@Allan - I just nuked the chroot and rebuilt. This time it completed without error. I then edited $CHROOT/root/etc/makepkg.conf changing the CFLAGS and CXXFLAGS from:

CFLAGS="-march=x86_64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=x86_64 -mtune=generic -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

to:

CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"

When I repeated the build, it errored out as it did outside of my chroot. I cannot explain why it didn't complete the first time; I know I didn't edit anything when constructing the chroot.

In any case, it seems as though the march=native CFLAG is to blame. Is this an upstream regression or something in our files? Again, I have been using the march=native CFLAGS since gcc v4.2

EDIT: Failing to build with the march=native CFLAGS is a problem since using a custom set of CFLAGS is the whole reason why users would want to rebuild the tool chain in the first place.
Comment by Allan McRae (Allan) - Thursday, 05 January 2012, 00:53 GMT
This is likely caused by the "math64crash" patch which is a hack that works for -march=x86_64. When you use -march=native, the compilation is going down a different code path which this will break.

Nothing I can do about this until upstream fixes the crashing.
Comment by John (graysky) - Thursday, 05 January 2012, 01:26 GMT
Thanks, Allan. Just want our stuff to be as rock stable as possible. You wanna close the bug report since it's upstream and not us?
Comment by jing xiang (key_jing) - Friday, 06 January 2012, 15:59 GMT
=============================
CFLAGS="-march=core2 -mtune=generic -O2 -pipe -msse4.1 -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu,--no-keep-memory"
=============================

I compile unsuccessful,I remove -msse4.1, compile successful
Comment by Allan McRae (Allan) - Tuesday, 10 January 2012, 12:39 GMT
Try this version of the patch.
Comment by John (graysky) - Tuesday, 10 January 2012, 20:19 GMT
@Allan - You're the man. Built successfully using your new patch in a clean chroot using:

$ grep FLAGS $CHROOT/root/etc/makepkg.conf
CFLAGS="-march=native -O2 -pipe -fstack-protector --param=ssp-buffer-size=4 -D_FORTIFY_SOURCE=2"
CXXFLAGS="${CFLAGS}"
LDFLAGS="-Wl,-O1,--sort-common,--as-needed,-z,relro,--hash-style=gnu"
MAKEFLAGS="-j4"
Comment by Allan McRae (Allan) - Wednesday, 11 January 2012, 11:43 GMT Comment by Michael Werner (Xaseron) - Thursday, 12 January 2012, 09:13 GMT
Thank you Allan.
With your new package everything works fine. I am now able to use Xen again :-)
Comment by John (graysky) - Saturday, 14 January 2012, 15:21 GMT
Works here too, Allan.
Comment by Allan McRae (Allan) - Thursday, 26 January 2012, 01:15 GMT
Not much I can do to fix this properly at the moment. If you are rebuilding glibc-2.15-4, remove the "rm sysdeps..." line. You will want to change "--enable-multi-lib" to "--disable-multi-lib" anyway...

Loading...