I have compiled my system with -march=core2 -mtune=corei7 to run on two machines, one with core2-duo and one with i7. On the core2 machine when I compile some packages it errors out with Illegal instruction. The same packages can be compiled on the i7 machine. I recompiled the core system (the LFS packages) as generic 64-bit, but I still get the same errors. It is only some packages that gives this errors, other compiles fine. Here are some examples:
curl:
Code:
configure: Configured to build curl/libcurl:
curl version: 7.40.0
Host setup: x86_64-unknown-linux-gnu
Install prefix: /usr
Compiler: gcc
SSL support: enabled (OpenSSL)
SSH support: no (--with-libssh2)
zlib support: enabled
GSS-API support: no (--with-gssapi)
TLS-SRP support: enabled
resolver: POSIX threaded
IPv6 support: no (--enable-ipv6)
Unix sockets support: enabled
IDN support: enabled
Build libcurl: Shared=yes, Static=no
Built-in manual: enabled
--libcurl option: enabled (--disable-libcurl-option)
Verbose errors: enabled (--disable-verbose)
SSPI support: no (--enable-sspi)
ca cert bundle: /etc/ssl/ca-bundle.crt
ca cert path: no
LDAP support: enabled (OpenLDAP)
LDAPS support: enabled
RTSP support: enabled
RTMP support: enabled (librtmp)
metalink support: no (--with-libmetalink)
HTTP2 support: disabled (--with-nghttp2)
Protocols: DICT FILE FTP FTPS GOPHER HTTP HTTPS IMAP IMAPS LDAP LDAPS POP3 POP3S RTMP RTSP SMB SMBS SMTP SMTPS TELNET TFTP
Making all in lib
make[1]: Entering directory '/tmp/curl/src/curl-7.40.0/lib'
make all-am
make[2]: Entering directory '/tmp/curl/src/curl-7.40.0/lib'
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -O2 -march=x86-64 -mtune=generic -pthread -MT libcurl_la-file.lo -MD -MP -MF .deps/libcurl_la-file.Tpo -c -o libcurl_la-file.lo `test -f 'file.c' || echo './'`file.c
libtool: compile: gcc -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -O2 -march=x86-64 -mtune=generic -pthread -MT libcurl_la-file.lo -MD -MP -MF .deps/libcurl_la-file.Tpo -c file.c -fPIC -DPIC -o .libs/libcurl_la-file.o
mv -f .deps/libcurl_la-file.Tpo .deps/libcurl_la-file.Plo
/bin/sh ../libtool --tag=CC --mode=compile gcc -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -O2 -march=x86-64 -mtune=generic -pthread -MT libcurl_la-timeval.lo -MD -MP -MF .deps/libcurl_la-timeval.Tpo -c -o libcurl_la-timeval.lo `test -f 'timeval.c' || echo './'`timeval.c
libtool: compile: gcc -DHAVE_CONFIG_H -I../include/curl -I../include -I../include -I../lib -I../lib -DBUILDING_LIBCURL -O2 -march=x86-64 -mtune=generic -pthread -MT libcurl_la-timeval.lo -MD -MP -MF .deps/libcurl_la-timeval.Tpo -c timeval.c -fPIC -DPIC -o .libs/libcurl_la-timeval.o
timeval.c: In function 'curlx_tvdiff_secs':
timeval.c:133:7: internal compiler error: Illegal instruction
(double)(newer.tv_usec-older.tv_usec)/1000000.0;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:1129: recipe for target 'libcurl_la-timeval.lo' failed
make[2]: *** [libcurl_la-timeval.lo] Error 1
make[2]: Leaving directory '/tmp/curl/src/curl-7.40.0/lib'
Makefile:703: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/tmp/curl/src/curl-7.40.0/lib'
Makefile:849: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
The part of the code that causes the error:
Code:
double curlx_tvdiff_secs(struct timeval newer, struct timeval older)
{
if(newer.tv_sec != older.tv_sec)
return (double)(newer.tv_sec-older.tv_sec)+
(double)(newer.tv_usec-older.tv_usec)/1000000.0;
else
return (double)(newer.tv_usec-older.tv_usec)/1000000.0;
}
sudo:
Code:
/bin/sh ../../libtool --mode=compile gcc -c -I../../include -I../.. -I. -I. -I../.. -DLIBDIR=\"/usr/lib\" -D__STDC_WANT_LIB_EXT1__=1 -O2 -march=x86-64 -mtune=generic -fvisibility=hidden -fPIE -fstack-protector-strong -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -D_PATH_SUDOERS=\"/etc/sudoers\" -DSUDOERS_UID=0 -DSUDOERS_GID=0 -DSUDOERS_MODE=0440 -DLOCALEDIR=\"/usr/share/locale\" ./timestamp.c
libtool: compile: gcc -c -I../../include -I../.. -I. -I. -I../.. -DLIBDIR=\"/usr/lib\" -D__STDC_WANT_LIB_EXT1__=1 -O2 -march=x86-64 -mtune=generic -fvisibility=hidden -fstack-protector-strong -D_GNU_SOURCE -D_FORTIFY_SOURCE=2 -D_PATH_SUDOERS=\"/etc/sudoers\" -DSUDOERS_UID=0 -DSUDOERS_GID=0 -DSUDOERS_MODE=0440 -DLOCALEDIR=\"/usr/share/locale\" ./timestamp.c -fPIC -DPIC -o .libs/timestamp.o
./timestamp.c: In function ‘timestamp_status’:
./timestamp.c:490:5: internal compiler error: Illegal instruction
timeout.tv_nsec = ((60.0 * def_timestamp_timeout) - (double)timeout.tv_sec)
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:1046: recipe for target 'timestamp.lo' failed
make[1]: *** [timestamp.lo] Error 1
make[1]: Leaving directory '/tmp/sudo/src/sudo-1.8.12/plugins/sudoers'
Makefile:90: recipe for target 'all' failed
make: *** [all] Error 2
The part of the code that causes the error:
Code:
/* Compare stored time stamp with current time. */
sudo_timespecsub(×tamp_key.ts, &entry.ts, &diff);
timeout.tv_sec = 60 * def_timestamp_timeout;
timeout.tv_nsec = ((60.0 * def_timestamp_timeout) - (double)timeout.tv_sec)
* 1000000000.0;
if (sudo_timespeccmp(&diff, &timeout, <)) {
status = TS_CURRENT;
groff:
Code:
In file included from color.cpp:23:0:
/tmp/groff/src/groff-1.22.3/src/include/lib.h:163:1: internal compiler error: Illegal instruction
const double PI = 3.14159265358979323846;
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
/tmp/groff/src/groff-1.22.3/Makefile.comm:94: recipe for target 'color.o' failed
make[2]: *** [color.o] Error 1
make[2]: Leaving directory '/tmp/groff/src/groff-1.22.3/src/libs/libgroff'
Makefile:820: recipe for target 'src/libs/libgroff' failed
make[1]: *** [src/libs/libgroff] Error 2
make[1]: Leaving directory '/tmp/groff/src/groff-1.22.3'
Makefile:801: recipe for target 'all' failed
make: *** [all] Error 2
binutils:
Code:
gcc -DHAVE_CONFIG_H -I. -I../../binutils-2.25/binutils -I. -I../../binutils-2.25/binutils -I../bfd -I../../binutils-2.25/binutils/../bfd -I../../binutils-2.25/binutils/../include -DLOCALEDIR="\"/usr/share/locale\"" -Dbin_dummy_emulation=bin_vanilla_emulation -W -Wall -Wstrict-prototypes -Wmissing-prototypes -Wshadow -O2 -march=x86-64 -mtune=generic -MT readelf.o -MD -MP -MF .deps/readelf.Tpo -c -o readelf.o ../../binutils-2.25/binutils/readelf.c
../../binutils-2.25/binutils/readelf.c: In function ‘process_symbol_table’:
../../binutils-2.25/binutils/readelf.c:10406:5: internal compiler error: Illegal instruction
counts[0], (counts[0] * 100.0) / nbuckets);
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:932: recipe for target 'readelf.o' failed
make[4]: *** [readelf.o] Error 1
make[4]: Leaving directory '/tmp/binutils/src/binutils-build/binutils'
Makefile:974: recipe for target 'all-recursive' failed
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory '/tmp/binutils/src/binutils-build/binutils'
Makefile:625: recipe for target 'all' failed
make[2]: *** [all] Error 2
make[2]: Leaving directory '/tmp/binutils/src/binutils-build/binutils'
Makefile:3482: recipe for target 'all-binutils' failed
make[1]: *** [all-binutils] Error 2
make[1]: Leaving directory '/tmp/binutils/src/binutils-build'
Makefile:832: recipe for target 'all' failed
make: *** [all] Error 2
The part of the code that causes the error:
Code:
if (nbuckets > 0)
{
unsigned long i;
printf (" 0 %-10lu (%5.1f%%)\n",
counts[0], (counts[0] * 100.0) / nbuckets);
for (i = 1; i <= maxlength; ++i)
{
nzero_counts += counts[i] * i;
printf ("%7lu %-10lu (%5.1f%%) %5.1f%%\n",
i, counts[i], (counts[i] * 100.0) / nbuckets,
(nzero_counts * 100.0) / nsyms);
}
}
bison:
Code:
lib/hash.c:134:5: internal compiler error: Illegal instruction
DEFAULT_GROWTH_THRESHOLD,
^
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.
Makefile:3461: recipe for target 'lib/hash.o' failed
make[2]: *** [lib/hash.o] Error 1
make[2]: Leaving directory '/tmp/bison/src/bison-3.0.4'
Makefile:4522: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/tmp/bison/src/bison-3.0.4'
Makefile:2625: recipe for target 'all' failed
make: *** [all] Error 2
The part of the code that causes the error:
Code:
#define DEFAULT_GROWTH_THRESHOLD 0.8f
#define DEFAULT_GROWTH_FACTOR 1.414f
[...]
/* Use this to initialize or reset a TUNING structure to
some sensible values. */
static const Hash_tuning default_tuning =
{
DEFAULT_SHRINK_THRESHOLD,
DEFAULT_SHRINK_FACTOR,
DEFAULT_GROWTH_THRESHOLD,
DEFAULT_GROWTH_FACTOR,
false
};
I can compile the following packages on the core2 machine: acl, attr, autoconf, automake, bash, bc
Any ideas what could be the cause of this problem?