diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass index 01fbd62dc12c1..6a515f9b5c690 100644 --- a/eclass/toolchain.eclass +++ b/eclass/toolchain.eclass @@ -1619,9 +1619,16 @@ gcc_do_filter_flags() { [[ -n ${l1_cache_size} && ${l1_cache_size} =~ ^[0-9]+$ ]] || break l1_cache_sizes[${l1_cache_size}]=1 done - # If any of them are different, just pick the first one. + # If any of them are different, abort. We can't just pass one value of + # l1-cache-size because it doesn't cancel out the -march=native one. if [[ ${#l1_cache_sizes[@]} -gt 1 ]] ; then - append-flags --param=l1-cache-size=${l1_cache_size} + eerror "Different values of l1-cache-size detected!" + eerror "GCC will fail to bootstrap when comparing files with these flags." + eerror "This CPU is likely big.little/hybrid hardware with power/efficiency cores." + eerror "Please install app-misc/resolve-march-native and run 'resolve-march-native'" + eerror "to find a safe value of CFLAGS for this CPU. Note that this may vary" + eerror "depending on the core it ran on. taskset can be used to fix the cores used." + die "Varying l1-cache-size found, aborting (bug #915389, gcc PR#111768)" fi fi