Bug 917161 - FTBFS: glibc-2.17-3.fc19 with kernel-headers-3.9.0-0.rc0.git11.1.fc19.i686
Summary: FTBFS: glibc-2.17-3.fc19 with kernel-headers-3.9.0-0.rc0.git11.1.fc19.i686
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: glibc
Version: 19
Hardware: i686
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Carlos O'Donell
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-03-01 21:17 UTC by John Reiser
Modified: 2016-11-24 15:45 UTC (History)
7 users (show)

Fixed In Version: glibc-2.17-4.fc20
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-04-25 22:07:38 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
sem_post.i (162.81 KB, text/plain)
2013-03-01 23:35 UTC, John Reiser
no flags Details
/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/config.log (39.83 KB, text/plain)
2013-03-04 17:49 UTC, John Reiser
no flags Details
rpm -qa | sort (40.12 KB, text/plain)
2013-03-04 19:30 UTC, John Reiser
no flags Details

Description John Reiser 2013-03-01 21:17:53 UTC
Description of problem: glibc-2.17-3.fc19 fails rpmbuild using kernel-headers-3.9.0-0.rc0.git11.1.fc19.i686


Version-Release number of selected component (if applicable):
glibc-2.17-3.fc19

How reproducible: every time


Steps to Reproduce:
1. yumdownloader --source glibc; rpm --install glibc-2.17-3.fc19.src.rpm
2. cd rpmbuild/SPECS; rpmbuild -bc glibc.spec
3.
  
Actual results:
In file included from ../nptl/descr.h:30:0,
                 from ../nptl/sysdeps/i386/tls.h:106,
                 from ../include/errno.h:22,
                 from ../nptl/sysdeps/unix/sysv/linux/sem_post.c:20:
../nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h:227:3: error: expected expression before 'do'
   do {               \
   ^
../nptl/sysdeps/unix/sysv/linux/sem_post.c:48:17: note: in expansion of macro 'lll_futex_wake'
       int err = lll_futex_wake (&isem->value, 1,


Expected results: successful rebuild


Additional info:

Comment 1 Carlos O'Donell 2013-03-01 23:06:25 UTC
This compiles fine for me locally using 3.8.0 headers and upstream.

What's with the 3.9.0 version for kernel headers when only 3.8.0 is out?

What compiler are you using? gcc 4.8.0?

Can you provide pre-processed source for the file that fails to compile?
e.g. Re-run the compile command with -save-temps, and attach the *.i file.

In the meantime I'll get a FC19 i686 VM setup.

Comment 2 John Reiser 2013-03-01 23:35:39 UTC
Created attachment 704375 [details]
sem_post.i

> What's with the 3.9.0 version for kernel headers when only 3.8.0 is out?

"yum update" [rawhide] installs kernel-headers-3.9.0-0.rc0.git11.1.fc19.i686.  glibc.spec has BuildRequires kernel-headers >= 2.6.22 and no upper limit, so 3.9.0 is OK.

$ gcc --version
gcc (GCC) 4.8.0 20130220 (Red Hat 4.8.0-0.14)

There's an obvious source conflict.  lll_futex_wake() does not return a value in rawhide kernel-headers-3.9.0, but sem_post.c expects one.

Comment 3 Carlos O'Donell 2013-03-04 03:38:18 UTC
John,

Thanks for the information. In should be safe to build glibc with newer kernel headers since glibc will only use the newest features it is aware of and nothing newer. However, as in this case, you might run into issues that no glibc developers have run into yet.

(1) How is it that you have a kernel headers package 3.9.0 when there is only a 3.8.0 kernel out?

(2) Can you provide pre-processed source?

(3) There is no obvious source conflict.

The rawhide kernel-headers-3.9.0 package does not provide lll_futex_wake(), it is provided by glibc's lowlevellock.h for the target machine. The kernel headers package only provides headers that are used for the build.

In this specific case there is no source conflict. However, in the general case there is a source conflict.

The i686 glibc build should never use sem_post.c, it has an optimized sem_post.S for i486, i586 and i686 which overrides the generic C version. I don't know how it possibly could have built sem_post.c instead. Are you overriding CFLAGS in your RPM builds? Perhaps targeting `i386?'

In the general sense there is a source conflict. The x86 and x86_64 lowlevellock.h version of lll_futex_wake should be returning a value such that it works even when experimenting with CFLAGS that disable the use of the optimized assembly versions. However, note that the upstream glibc developers don't test such configurations as part of our release QA, and that they are outside of our support matrix.

Note that sem_post is the only function that actually checks the return of lll_futex_wake. It is only with PI FUTEX's that I think you can have a failure here e.g. returns EINVAL. Which is why no other caller of lll_futex_wake checks the return.

In summary:
- A normal build for i686 should use sem_post.S not sem_post.c, and thus should not fail.
- There is no source conflict, but there it should be cleaned up.
- The root of the problem is somewhere in the build CFLAGS used for the glibc build.

I think if we can track down why the build fails to use sem_post.S then we've found the problem. I can't see how the kernel headers effect this.

Does that make sense?

Comment 4 John Reiser 2013-03-04 16:59:06 UTC
(1) I have kernel headers from 3.9.0 because I ran "yum update" on a rawhide i686 box with fedora-rawhide enabled as a repo, and as a result yum installed kernel-headers-3.9.0-0.rc0.git14.1.fc19.i686.

(2) In Comment #2 above I attached the intermediate file sem_post.i which resulted from adding -save-temps to the gcc command line.  What do you want for "preprocessed source"?

(3) I am running Fedora 19 rawhide i686 on AMD Athlon x86_64 2GHz box.  "uname -a" reports:
Linux localhost.localdomain 3.9.0-0.rc0.git14.1.fc19.i686.PAE #1 SMP Fri Mar 1 14:00:38 UTC 2013 i686 i686 i386 GNU/Linux

I further re-verified my environment:
-----
$ rpm -q glibc kernel-headers kernel-PAE
glibc-2.17-3.fc19.i686
kernel-headers-3.9.0-0.rc0.git14.1.fc19.i686
kernel-PAE-3.9.0-0.rc0.git8.1.fc19.i686
kernel-PAE-3.9.0-0.rc0.git11.1.fc19.i686
kernel-PAE-3.9.0-0.rc0.git14.1.fc19.i686

$ rpm --verify glibc-2.17-3.fc19.i686 kernel-headers-3.9.0-0.rc0.git14.1.fc19.i686 kernel-PAE-3.9.0-0.rc0.git14.1.fc19.i686
..?......    /usr/sbin/glibc_post_upgrade.i686
..?......    /boot/System.map-3.9.0-0.rc0.git14.1.fc19.i686.PAE

$ md5sum glibc-2.17-3.fc19.src.rpm
f71c2bbc802e577bfb3f3bf12a9289cf  glibc-2.17-3.fc19.src.rpm

$ rpm --install glibc-2.17-3.fc19.src.rpm
warning: user mockbuild does not exist - using root
warning: group mockbuild does not exist - using root

$ cd rpmbuild/SPECS
$ cp -a glibc.spec glibc.spec.bak
$ vi glibc.spec
$ diff -u glibc.spec.bak glibc.spec   ## only change: remove "-s"
--- glibc.spec.bak	2013-02-27 23:33:36.000000000 -0500
+++ glibc.spec	2013-03-04 11:00:50.659347088 -0500
@@ -22,7 +22,7 @@
 %define multiarcharches ppc %{power64} %{ix86} x86_64 %{sparc}
 %define systemtaparches %{ix86} x86_64
 # Remove -s to get verbose output.
-%define silentrules PARALLELMFLAGS=-s
+%define silentrules PARALLELMFLAGS=
 
 Summary: The GNU libc libraries
 Name: glibc

$ rpmbuild -bc glibc.spec >rpmbuild-bc-glibc.out 2>&1
$ tail rpmbuild-bc-glibc.out
In file included from ../nptl/descr.h:30:0,
                 from ../nptl/sysdeps/i386/tls.h:106,
                 from ../include/errno.h:22,
                 from ../nptl/sysdeps/unix/sysv/linux/sem_post.c:20:
../nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h:227:3: error: expected expression before 'do'
   do {               \
   ^
../nptl/sysdeps/unix/sysv/linux/sem_post.c:48:17: note: in expansion of macro 'lll_futex_wake'
       int err = lll_futex_wake (&isem->value, 1,
                 ^
make[2]: *** [/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl/sem_post.o] Error 1
-----
so the same error has been reproduced.


Can you reproduce the error that I see?  I don't use 'mock', but I'm running "native" so that should not matter.

Comment 5 Carlos O'Donell 2013-03-04 17:36:46 UTC
John,

Could you please attach config.log from the build?

If you don't have access to config.log, then please include the first 4 lines of the build log that you are grepping from. The first four lines indicate which system directories are being used by the build.

Lastly could you include the full command line that was used to build sem_post.c please?

Thanks.

Comment 6 Carlos O'Donell 2013-03-04 17:45:08 UTC
John,

I can reproduce the issue.

GCC 4.8 now supports atomic sync builtins for i386.

This allows the normal i386 glibc build to work all the way up to building semp_post.c, and then fail.

The problem is that you are building for i386 instead of say i486, i586, or i686, the latter are all supported.

Are you certain you don't have any override for the compiler that adds `-march=i386' to your build?

I've raised the issue upstream here to see what other developers think:
http://sourceware.org/ml/libc-alpha/2013-03/msg00061.html

Comment 7 John Reiser 2013-03-04 17:49:53 UTC
Created attachment 705086 [details]
/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/config.log

Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.DGQUMn
+ umask 022
+ cd /home/jreiser/rpmbuild/BUILD
+ cd glibc-2.17-c758a686
+ GCC=gcc
+ GXX=g++
+ BuildFlags='-march=i386 -mtune=generic'
+ BuildFlags='-march=i386 -mtune=generic -mno-tls-direct-seg-refs'
+ BuildFlags='-march=i386 -mtune=generic -mno-tls-direct-seg-refs -fasynchronous-unwind-tables'
+ case 2.17 in
+ BuildFlags='-march=i386 -mtune=generic -mno-tls-direct-seg-refs -fasynchronous-unwind-tables -DNDEBUG'
+ EnableKernel=--enable-kernel=2.6.32
+ echo gcc
++ sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'
++ echo c_stubs/configure libidn/configure nptl/configure rtkaio/configure
+ AddOns=,c_stubs,libidn
+ AddOns=,rtkaio,c_stubs,libidn
+ build
+ builddir=build-i386-redhat-linux
+ rm -rf build-i386-redhat-linux
+ mkdir build-i386-redhat-linux
+ cd build-i386-redhat-linux
+ build_CFLAGS='-march=i386 -mtune=generic -mno-tls-direct-seg-refs -fasynchronous-unwind-tables -DNDEBUG -g -O3 '
+ configure_CFLAGS='-march=i386 -mtune=generic -mno-tls-direct-seg-refs -fasynchronous-unwind-tables -DNDEBUG -g -O3  -fno-asynchronous-unwind-tables'
+ ../configure CC=gcc CXX=g++ 'CFLAGS=-march=i386 -mtune=generic -mno-tls-direct-seg-refs -fasynchronous-unwind-tables -DNDEBUG -g -O3  -fno-asynchronous-unwind-tables' --prefix=/usr --enable-add-ons=ports,nptl,rtkaio,c_stubs,libidn --with-headers=/usr/include --enable-kernel=2.6.32 --enable-bind-now --build=i386-redhat-linux --enable-multi-arch --enable-obsolete-rpc --enable-systemtap --disable-profile --enable-nss-crypt



gcc ../nptl/sysdeps/unix/sysv/linux/sem_post.c -c -std=gnu99 -fgnu89-inline  -DNDEBUG -O3 -Wall -Winline -Wwrite-strings -fasynchronous-unwind-tables -fmerge-all-constants -frounding-math -g -march=i386 -mno-tls-direct-seg-refs -mtune=generic -Wstrict-prototypes         -I../include -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux -I../nptl/sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/i386/nptl -I../sysdeps/unix/sysv/linux/i386 -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../rtkaio/sysdeps/pthread -I../sysdeps/pthread -I../rtkaio/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../rtkaio/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../rtkaio/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I../ports -I../nptl -I../rtkaio  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-redhat-linux/4.8.0/include -isystem /usr/include  -D_LIBC_REENTRANT -DNO_TLS_DIRECT_SEG_REFS -include ../include/libc-symbols.h   -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -DIN_LIB=libpthread    -o /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl/sem_post.o -MD -MP -MF /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl/sem_post.o.dt -MT /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl/sem_post.o
../nptl/sysdeps/unix/sysv/linux/sem_post.c: In function '__new_sem_post':
../nptl/sysdeps/unix/sysv/linux/sem_post.c:43:3: warning: implicit declaration of function 'atomic_compare_and_exchange_bool_rel' [-Wimplicit-function-declaration]
   while (atomic_compare_and_exchange_bool_rel (&isem->value, cur + 1, cur));
   ^
../nptl/sysdeps/unix/sysv/linux/sem_post.c:45:3: warning: implicit declaration of function 'atomic_full_barrier' [-Wimplicit-function-declaration]
   atomic_full_barrier ();
   ^
In file included from ../nptl/descr.h:30:0,
                 from ../nptl/sysdeps/i386/tls.h:106,
                 from ../include/errno.h:22,
                 from ../nptl/sysdeps/unix/sysv/linux/sem_post.c:20:
../nptl/sysdeps/unix/sysv/linux/i386/lowlevellock.h:227:3: error: expected expression before 'do'
   do {               \
   ^
../nptl/sysdeps/unix/sysv/linux/sem_post.c:48:17: note: in expansion of macro 'lll_futex_wake'
       int err = lll_futex_wake (&isem->value, 1,
                 ^
make[2]: *** [/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/nptl/sem_post.o] Error 1

Comment 8 John Reiser 2013-03-04 17:55:39 UTC
(In reply to comment #6)
> Are you certain you don't have any override for the compiler that adds
> `-march=i386' to your build?

I have not done anything other than install Fedora rawhide for 32-bit x86 (the DVD.iso does have "i386" in its name, but it installs an i686 kernel), and run "yum update".  I am not using "setarch" or anything similar.

However, "i386" does appear as the next-to-last component of the output of "uname -a":
Linux localhost.localdomain 3.9.0-0.rc0.git14.1.fc19.i686.PAE #1 SMP Fri Mar 1 14:00:38 UTC 2013 i686 i686 i386 GNU/Linux

Comment 9 Carlos O'Donell 2013-03-04 18:05:00 UTC
John,

Thanks for the clarification. It seems that I need to take this up with the Fedora developers to see what action needs to be taken.

As it stands glibc doesn't support that FC19 configuration.

Comment 10 Carlos O'Donell 2013-03-04 18:24:05 UTC
John,

Can I get a list of all of your installed packages? e.g. `rpm -qa`?

Comment 11 John Reiser 2013-03-04 19:30:16 UTC
Created attachment 705123 [details]
rpm -qa  |  sort

Here's what is installed.

Comment 12 Carlos O'Donell 2013-03-04 22:57:23 UTC
John,

If you install `redhat-rpm-config' (provides several key build macros) before building does it help?

Comment 13 Carlos O'Donell 2013-03-04 23:36:54 UTC
John,

I have a WIP that should fix this issue.

It basically looks like this:
(a) We treat i386 as an alias for "Whatever works on x86."
(b) We compile for i686 when someone requests a target build for i386.

This should fix your issue. I'm testing this now.

diff --git a/glibc.spec b/glibc.spec
index 4018373..a0ba603 100644
--- a/glibc.spec
+++ b/glibc.spec
@@ -27,7 +27,7 @@
 Summary: The GNU libc libraries
 Name: glibc
 Version: %{glibcversion}
-Release: 3%{?dist}
+Release: 4%{?dist}
 # GPLv2+ is used in a bunch of programs, LGPLv2+ is used for libraries.
 # Things that are linked directly into dynamically linked programs
 # and shared libraries (e.g. crt files, lib*_nonshared.a) have an additional
@@ -424,10 +424,14 @@ GXX=g++
 %ifarch %{ix86}
 BuildFlags="-march=%{_target_cpu} -mtune=generic"
 %endif
-%ifarch i686
+# We don't support building for i386. The generic i386 architecture lacks the
+# atomic primitives required for NPTL support. However, when a user asks to
+# build for i386 they just mean "for whatever works on x86" and we interpret
+# that as i686. Thus we treat i386 as an alias for i686.
+%ifarch i386 i686
 BuildFlags="-march=i686 -mtune=generic"
 %endif
-%ifarch i386 i486 i586
+%ifarch i486 i586
 BuildFlags="$BuildFlags -mno-tls-direct-seg-refs"
 %endif
 %ifarch x86_64
@@ -1201,6 +1205,9 @@ rm -f *.filelist*
 %endif
 
 %changelog
+* Mon Mar 4 2013 Carlos O'Donell <carlos> - 2.17-4
+  - Fixed i386 glibc builds (#917161).
+
 * Wed Feb 27 2013 Carlos O'Donell <carlos> - 2.17-3
   - Renamed release engineering directory to `releng' (#903754).
   - Fix building with gcc 4.8.0 (#911307).
---

If you could test this change locally that would be really helpful.

Comment 14 John Reiser 2013-03-05 00:07:56 UTC
(In reply to comment #12)
> If you install `redhat-rpm-config' (provides several key build macros)
> before building does it help?

$ yum install redhat-rpm-config
   [snip]
Installed:
  redhat-rpm-config.noarch 0:9.1.0-39.fc19

Dependency Installed:
  dwz.i686 0:0.9-1.fc19              perl-srpm-macros.noarch 0:1-7.fc19

$ rpmbuild -bc glibc.spec
   [snip]
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.gizNqw
+ umask 022
+ cd /home/jreiser/rpmbuild/BUILD
+ cd glibc-2.17-c758a686
+ GCC=gcc
+ GXX=g++
+ BuildFlags='-march=i686 -mtune=generic'
+ BuildFlags='-march=i686 -mtune=generic'
+ BuildFlags='-march=i686 -mtune=generic -fasynchronous-unwind-tables'
+ case 2.17 in
+ BuildFlags='-march=i686 -mtune=generic -fasynchronous-unwind-tables -DNDEBUG'
+ EnableKernel=--enable-kernel=2.6.32
+ echo gcc
++ sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'
++ echo c_stubs/configure libidn/configure nptl/configure rtkaio/configure
+ AddOns=,c_stubs,libidn
+ AddOns=,rtkaio,c_stubs,libidn
+ build
+ builddir=build-i686-redhat-linux


So that looks very promising because I see "i686" everywhere instead of the previous "i386".  I'll wait until it finishes, then uninstall redhat-rpm-config, and try the patch to glibc.spec.

Comment 15 John Reiser 2013-03-05 02:57:16 UTC
The build succeeds in the presence of an installed redhat-rpm-config.  The sem_post compilation used the i386/i686/sem_post.S specialized case:

gcc ../nptl/sysdeps/unix/sysv/linux/i386/i686/sem_post.S -c    -I../include -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i686-redhat-linux/nptl -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i686-redhat-linux -I../nptl/sysdeps/unix/sysv/linux/i386/i686 -I../sysdeps/unix/sysv/linux/i386/i686 -I../nptl/sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/i386/nptl -I../sysdeps/unix/sysv/linux/i386 -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../rtkaio/sysdeps/pthread -I../sysdeps/pthread -I../rtkaio/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../rtkaio/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../rtkaio/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/i686/fpu/multiarch -I../sysdeps/i386/i686/fpu -I../sysdeps/i386/i686/multiarch -I../nptl/sysdeps/i386/i686 -I../sysdeps/i386/i686 -I../sysdeps/i386/i486 -I../nptl/sysdeps/i386/i486 -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I../ports -I../nptl -I../rtkaio  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-redhat-linux/4.8.0/include -isystem /usr/include  -D_LIBC_REENTRANT -include ../include/libc-symbols.h   -DNO_TLS_DIRECT_SEG_REFS -DNOT_IN_libc=1 -DIS_IN_libpthread=1 -DIN_LIB=libpthread    -DASSEMBLER  -DGAS_SYNTAX -g -Wa,--noexecstack  -Wa,-mtune=i686 -o /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i686-redhat-linux/nptl/sem_post.o -MD -MP -MF /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i686-redhat-linux/nptl/sem_post.o.dt -MT /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i686-redhat-linux/nptl/sem_post.o

Comment 16 John Reiser 2013-03-05 03:19:25 UTC
(In reply to comment #13)
> diff --git a/glibc.spec b/glibc.spec
> index 4018373..a0ba603 100644
> --- a/glibc.spec
> +++ b/glibc.spec
   [snip]

The patch fails for me (after "yum remove redhat-rpm-config", which did not remove dwz nor perl-srpm-macros).  The error is:

gcc ../sysdeps/i386/string-inlines.c -c -std=gnu99 -fgnu89-inline  -DNDEBUG -O3 -Wall -Winline -Wwrite-strings -fasynchronous-unwind-tables -fmerge-all-constants -frounding-math -g -march=i686 -mtune=generic -Wstrict-prototypes   -mno-tls-direct-seg-refs -fno-tree-loop-distribute-patterns       -I../include -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/string -I/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux -I../nptl/sysdeps/unix/sysv/linux/i386 -I../nptl/sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/x86 -I../sysdeps/unix/sysv/linux/i386/nptl -I../sysdeps/unix/sysv/linux/i386 -I../ports/sysdeps/unix/sysv/linux -I../nptl/sysdeps/unix/sysv/linux -I../nptl/sysdeps/pthread -I../rtkaio/sysdeps/pthread -I../sysdeps/pthread -I../rtkaio/sysdeps/unix/sysv/linux -I../sysdeps/unix/sysv/linux -I../sysdeps/gnu -I../sysdeps/unix/inet -I../ports/sysdeps/unix/sysv -I../nptl/sysdeps/unix/sysv -I../rtkaio/sysdeps/unix/sysv -I../sysdeps/unix/sysv -I../sysdeps/unix/i386 -I../ports/sysdeps/unix -I../nptl/sysdeps/unix -I../rtkaio/sysdeps/unix -I../sysdeps/unix -I../sysdeps/posix -I../sysdeps/i386/fpu -I../sysdeps/x86/fpu -I../nptl/sysdeps/i386 -I../sysdeps/i386 -I../sysdeps/x86 -I../sysdeps/wordsize-32 -I../sysdeps/ieee754/ldbl-96 -I../sysdeps/ieee754/dbl-64 -I../sysdeps/ieee754/flt-32 -I../sysdeps/ieee754 -I../sysdeps/generic -I../ports -I../nptl -I../rtkaio  -I.. -I../libio -I. -nostdinc -isystem /usr/lib/gcc/i686-redhat-linux/4.8.0/include -isystem /usr/include  -D_LIBC_REENTRANT -include ../include/libc-symbols.h   -DNO_TLS_DIRECT_SEG_REFS     -o /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/string/string-inlines.o -MD -MP -MF /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/string/string-inlines.o.dt -MT /home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/string/string-inlines.o 
../sysdeps/i386/string-inlines.c:38:1: error: redefinition of '__memcpy_by2'
 __memcpy_by2 (void *dest, const void *src, size_t n)
 ^
In file included from ../sysdeps/i386/string-inlines.c:33:0:
../sysdeps/x86/bits/string.h:101:1: note: previous definition of '__memcpy_by2' was here
 __memcpy_by2 (void *__dest, const void *__src, size_t __n)
 ^ 
In file included from <command-line>:0:0:
../sysdeps/i386/string-inlines.c:42:29: error: redefinition of '__memcpy_by4'
 strong_alias (__memcpy_by2, __memcpy_by4)
                             ^
./../include/libc-symbols.h:87:26: note: in definition of macro '_strong_alias'
   extern __typeof (name) aliasname __attribute__ ((alias (#name)));
                          ^
../sysdeps/i386/string-inlines.c:42:1: note: in expansion of macro 'strong_alias'
 strong_alias (__memcpy_by2, __memcpy_by4)
 ^
   [snip two hundred more lines of complaints]
make[2]: *** [/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/build-i386-redhat-linux/string/string-inlines.o] Error 1
make[2]: Leaving directory `/home/jreiser/rpmbuild/BUILD/glibc-2.17-c758a686/string'
-----


The %build begins:
Executing(%build): /bin/sh -e /var/tmp/rpm-tmp.jxcCvt
+ umask 022
+ cd /home/jreiser/rpmbuild/BUILD
+ cd glibc-2.17-c758a686
+ GCC=gcc
+ GXX=g++
+ BuildFlags='-march=i386 -mtune=generic'
+ BuildFlags='-march=i686 -mtune=generic'
+ BuildFlags='-march=i686 -mtune=generic -fasynchronous-unwind-tables'
+ case 2.17 in
+ BuildFlags='-march=i686 -mtune=generic -fasynchronous-unwind-tables -DNDEBUG'
+ EnableKernel=--enable-kernel=2.6.32
+ echo gcc
++ sed -e 's!/configure!!g;s!\(linuxthreads\|nptl\|rtkaio\|powerpc-cpu\)\( \|$\)!!g;s! \+$!!;s! !,!g;s!^!,!;/^,\*$/d'
++ echo c_stubs/configure libidn/configure nptl/configure rtkaio/configure
+ AddOns=,c_stubs,libidn
+ AddOns=,rtkaio,c_stubs,libidn
+ build
+ builddir=build-i386-redhat-linux
+ rm -rf build-i386-redhat-linux
+ mkdir build-i386-redhat-linux
+ cd build-i386-redhat-linux
+ build_CFLAGS='-march=i686 -mtune=generic -fasynchronous-unwind-tables -DNDEBUG -g -O3 '
+ configure_CFLAGS='-march=i686 -mtune=generic -fasynchronous-unwind-tables -DNDEBUG -g -O3  -fno-asynchronous-unwind-tables'
+ ../configure CC=gcc CXX=g++ 'CFLAGS=-march=i686 -mtune=generic -fasynchronous-unwind-tables -DNDEBUG -g -O3  -fno-asynchronous-unwind-tables' --prefix=/usr --enable-add-ons=ports,nptl,rtkaio,c_stubs,libidn --with-headers=/usr/include --enable-kernel=2.6.32 --enable-bind-now --build=i386-redhat-linux --enable-multi-arch --enable-obsolete-rpc --enable-systemtap --disable-profile --enable-nss-crypt
checking build system type... i386-redhat-linux-gnu
checking host system type... i386-redhat-linux-gnu
   [snip]
-----
which does have "configure_CFLAGS='-march=i686 -mtune=generic ..." but it has also
  + BuildFlags='-march=i386 -mtune=generic'
  + BuildFlags='-march=i686 -mtune=generic'
and
  checking build system type... i386-redhat-linux-gnu
which looks confusing.

Comment 17 John Reiser 2013-03-05 14:52:02 UTC
Carlos,

It seems to me that if building glibc is so sensitive that "rpmbuild -bc" fails to complete unless redhat-rpm-config is present, then adding:
   BuildRequires: redhat-rpm-config
to glibc.spec would be appropriate.  It's certainly the easiest and fastest fix.

More generally, it seems to me that the rpm-build package (the provider of /usr/bin/rpmbuild) should
   Requires: redhat-rpm-config
at least within Fedora.  While .noarch packages might not need it at all [I don't really know], and most architecture-specific packages [excepting glibc!] might not need it just for "rpmbuild -bc" to complete, it is still true that practical Fedora  conventions for a package containing compiled binary programs (conventions such as separate compressed debuginfo) do require the presence of redhat-rpm-config.  'mock' apparently guarantees this, but the time and space and repo administration that are required by mock should not be necessary for "native" builds.

Comment 18 Carlos O'Donell 2013-03-18 00:17:08 UTC
Fixed in rawhide.

We interpret `i386' as `Whatever works on x86' and alias it to i686.

You should not need redhat-rpm-config to build glibc, it should build correctly without it as a build prerequisite.

Comment 19 John Reiser 2013-03-24 19:55:12 UTC
(In reply to comment #18)
> Fixed in rawhide.

One week later, there is no build in rawhide that contains the fix.  Re-open.

The latest build is http://koji.fedoraproject.org/koji/buildinfo?buildID=403223 for glibc-2.17-4.fc19.  It was started Mon, 18 Mar 2013 03:55:59 UTC and completed in less than 90 minutes.  Upon downloading the .src.rpm, there is no mention of "917161" (this bug) in the .spec nor the SOURCES, and I can find nothing in the patches to fix this bug.

Comment 20 Carlos O'Donell 2013-03-25 13:24:11 UTC
(In reply to comment #19)
> (In reply to comment #18)
> > Fixed in rawhide.
> 
> One week later, there is no build in rawhide that contains the fix.  Re-open.
> 
> The latest build is
> http://koji.fedoraproject.org/koji/buildinfo?buildID=403223 for
> glibc-2.17-4.fc19.  It was started Mon, 18 Mar 2013 03:55:59 UTC and
> completed in less than 90 minutes.  Upon downloading the .src.rpm, there is
> no mention of "917161" (this bug) in the .spec nor the SOURCES, and I can
> find nothing in the patches to fix this bug.

Please bear with me as I'm very new to all of the Fedora development process.

The build that you quote is for an F19 build, and F19 is no longer rawhide as of 2013-03-12, at which point F19 branched from rawhide to being pre-Alpha preparations.

Rawhide is F20, and the rawhide composes and builds are not something that I think I have to control, they should happen nightly.

This is definitely fixed in rawhide. For your review I have started a rawhide build for glibc-2.17-4.fc20:
http://koji.fedoraproject.org/koji/taskinfo?taskID=5168555

I apologize for not using the "Fixed in version" field to indicate "glibc-2.17-4.fc20."

Does that clarify the situation?

Comment 21 John Reiser 2013-03-25 15:44:08 UTC
The big picture is that "rpmbuild -bc glibc.spec" applied to glibc-2.17.4.fc20 (from koji taskID=5168555 of Comment #20) still fails on native i686 when redhat-rpm-config is not installed.  The point of failure is the same as Comment #16, namely syntax errors when compiling ../sysdeps/i386/string-inlines.c.  So the change to the build recipe does not work 100% yet.  Some part still believes it is i386 (not i686), and fails because of this.  Thus a Status of ASSIGNED still is appropriate.

Looking at "smaller" details in the Fedora development process, quoting from Comment #20:
   Rawhide is F20, and the rawhide composes and builds are not something
   that I think I have to control, they should happen nightly.
From the ChangeLog for glibc-2.17.4.fc20 I see that Carlos did commit a change early on Mon Mar 18, one week ago.  However the koji page for glibc http://koji.fedoraproject.org/koji/packageinfo?packageID=57 shows that there were no fc20 builds until 5168555 today.  Also, the column "Built by" suggests that builds do not happen automatically.  So the evidence is that builds must be initiated by a maintainer.

This bug 917161 was filed against rawhide before f19 branched off.  The fix was applied to the Fedora source after the f19 branch.  For an ordinary package, this means that two builds should be initiated: rawhide and f19.  For glibc which is in the critical path, the Fedora rules might specify an extra review for f19, or give discretion to maintainers about whether an f19 build is required.  Such additional status would be good to mention when closing the bug as "Fixed".  This would help clarify the small confusion that glibc-2.17.4.fc19 does not have the fix, but "the same" version glibc-2.17.4 for fc20 does have it.  It would also lessen the surprise of the fix suddenly appearing in the next 2.17.5.fc19 if that arises.

Comment 22 Carlos O'Donell 2013-03-25 16:17:09 UTC
John,

I tested this locally without redhat-rpm-config and it built for me. I will go through the test again to see what I might have missed.

Regarding rawhide builds. I have updated the Fedora Rawhide wiki page to indicate that rawhide builds must be manually kicked off by maintainers. I wasn't aware of this and didn't understand the requirement. This should now be fixed by the glibc-2.17-4.fc20 build. Which also fixes an upgrade breakage between F19 and F20 since F20 was lagging behind F19 and had no newer package for glibc to facilitate the upgrade.

Comment 23 Carlos O'Donell 2013-03-27 03:44:40 UTC
John,

Many thanks for the excellent follow-through.

I've been able to reproduce this now. I had to use an F19 i686 VM to see what the final flags used by the build system were, and now I can reproduce it upstream also.

The final fix is only slighly more complicated in that in addition to an override in the glibc.spec it requires an corresponding override in the glibc sources.

Comment 24 Fedora End Of Life 2013-04-03 19:15:48 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 19 development cycle.
Changing version to '19'.

(As we did not run this process for some time, it could affect also pre-Fedora 19 development
cycle bugs. We are very sorry. It will help us with cleanup during Fedora 19 End Of Life. Thank you.)

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora19

Comment 25 Carlos O'Donell 2013-04-25 22:07:38 UTC
This will be fixed when we pull in the next upstream update.

The solution that was implemented upstream is to abort the build if building for i386 since upstream no longer supports i386.

You will get a clear message from the package configure script that the configuration you are building is not supported.

I think that's the most we want to do in this case where Fedora tries to compile for i386 without redhat-rpm-config installed.

Comment 26 Carlos O'Donell 2013-04-25 22:09:22 UTC
The error you'll see will be either:

*** Building with -march=i386/-mcpu=i386 is not supported.
*** Please use host i786, i686, i586, or i486.
*** For example: /source/glibc/configure CFLAGS='-O2 -march=i686'

or:


*** ERROR: Support for i386 is deprecated.
*** Please use host i786, i686, i585 or i486.
*** For example: /src/glibc/configure --host=i686-pc-linux-gnu ...


Note You need to log in before you can comment on or make changes to this bug.