https://bugzilla.redhat.com/show_bug.cgi?id=1041924
--- Comment #9 from Ralf Corsepius rc040203@freenet.de --- (In reply to Andy Lutomirski from comment #7)
Re: the g++ call to link the executables: does it matter for linking? In any case, I patched it.
Yes, it does.
Linking will fail, when GCC requires one of the flags in RPM_OPT_FLAGS.
A classic such case is picking up the correct multilibs to link against, because some cflags/cxxflags cause GCC to implicitly switch library-paths.
E.g. building a package for i386 on an x86_64 requires GCC to be passed -m32, which would then cause GCC to implicitly link against i386-libraries instead of x86_64-libraries. In Fedora, this issue currently is hidden, because GCCs' default architectures (the architecture GCC uses without additional flags) matches those of the corresponding Fedora release.
I.e. on Fedora-i386 GCC's default-arch is "i386", on Fedora-x86_64 it's x86_64. However, this is just random/lucky coincidence. In the past we've had situations where a Fedora's distribution arch did not match default arch of the corresponding GCC, and had required special CFLAGS (IIRC, this did apply on the sparc and the powerpc).