Using the GCC option '-mieee-fp' (Controls whether or not the compiler uses IEEE floating point comparisons. These handle correctly the case where the result of a comparison is unordered) with expect--5.42.1-r1 or expect-5.43.0 fails with identical errors: libexpect5.43.a(pty_termios.o): In function `exp_getptymaster': pty_termios.c:(.text+0x1e9): undefined reference to `openpty' during linking. Reproducible: Always Steps to Reproduce: 1. Include '-mieee-fp' in CFLAGS in /etc/make.conf. 2. emerge dev-tcltk/expect-5.xx.x 3. Actual Results: gcc -pipe -Wall -march=k8 -mieee-fp -pipe -O2 -fno-strict-aliasing -O2 -Wl,--export-dynamic -o expectk exp_main_tk.o libexpect5.43.a -L/usr/lib64 -ltk8.4 -L/usr/lib64 -ltcl8.4 -L/usr/lib64 -lX11 -ldl -lieee -lm -Wl,-rpath,/usr/lib64:/usr/lib:/usr/lib64:/usr/lib64 /usr/lib64/libieee.a:(.data+0x0): multiple definition of `_LIB_VERSION' /usr/lib64/libieee.a:(.data+0x0): first defined here libexpect5.43.a(pty_termios.o): In function `exp_getptymaster': pty_termios.c:(.text+0x1e9): undefined reference to `openpty' collect2: ld returned 1 exit status make: *** [expect] Error 1 make: *** Waiting for unfinished jobs.... /usr/lib64/libieee.a:(.data+0x0): multiple definition of `_LIB_VERSION' /usr/lib64/libieee.a:(.data+0x0): first defined here libexpect5.43.a(pty_termios.o): In function `exp_getptymaster': pty_termios.c:(.text+0x1e9): undefined reference to `openpty' collect2: ld returned 1 exit status make: *** [expectk] Error 1 !!! ERROR: dev-tcltk/expect-5.43.0 failed. Expected Results: Successful emerge. The workaround is to remove '-mieee-fp' from CFLAGS. BTW, this is the only package which has given me problems when specifying '-mieee-fp'.
Don't put stupid C[XX]FLAGS into make.conf
jakub@gentoo.org's comments are singularly unhelpful, and rude besides. Someone though that there was a good reasone to include the option in GCC, and there are no indications in the documentation of when it should not be used. And frankly, I'd prefer that my code use IEEE comparisons, especially since they now ensure that the results of aun unordered comparison are handled CORRECTLY as opposed to incorrectly.
See http://www.gnu.org/software/libc/manual/html_node/FP-Comparison-Functions.html for an explanation of why -mieee-fp exists.
So ask upstream to fix it. We won't be filtering every obscure flag that someone for whatever reason picks up and thinks to be a great one to put into make.conf and later on finds that it breaks things.