File tree 1 file changed +41
-0
lines changed
1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change @@ -3289,6 +3289,47 @@ EOF
3289
3289
3290
3290
[[ ${STOP_BOOTSTRAP_AFTER} == stage3 ]] && exit 0
3291
3291
3292
+ # do some sanity USE-flag enabling based on CPU, use cpuid2cpuflags
3293
+ # if keyworded for this arg, else see if there's fallbacks to be
3294
+ # made
3295
+ mkdir -p " ${EPREFIX} /etc/portage/package.use"
3296
+ if emerge -1v cpuid2cpuflags ; then
3297
+ hash -r
3298
+ echo " */* $( cpuid2cpuflags) " \
3299
+ > " ${EPREFIX} /etc/portage/package.use/00cpu-flags"
3300
+ else
3301
+ case " ${CHOST} " in
3302
+ arm64-* darwin* )
3303
+ # https://github.com/RustCrypto/utils/issues/378
3304
+ local flags=( " aes" " sha1" " sha2" )
3305
+ local line
3306
+ sysctl hw.optional | while read -r line ; do
3307
+ line=${line# hw.optional.}
3308
+ [[ ${line%%*: } == " 1" ]] || continue
3309
+ line=${line%: * }
3310
+ case " ${line} " in
3311
+ " neon" )
3312
+ flags+=( " ${line} " )
3313
+ ;;
3314
+ " armv8_" * )
3315
+ line=${line# armv8_}
3316
+ case " ${line} " in
3317
+ " crc32" )
3318
+ flags+=( " ${line} " )
3319
+ ;;
3320
+ " 2_sha" * )
3321
+ flags+=( " ${line# 2_} " )
3322
+ ;;
3323
+ esac
3324
+ ;;
3325
+ esac
3326
+ done
3327
+ echo " */* CPU_FLAGS_ARM: ${flags} " \
3328
+ > " ${EPREFIX} /etc/portage/package.use/00cpu-flags"
3329
+ ;;
3330
+ esac
3331
+ fi
3332
+
3292
3333
local cmd=" emerge -v --deep --update --changed-use @world"
3293
3334
if [[ -e ${EPREFIX} /var/cache/edb/mtimedb ]] && \
3294
3335
grep -q resume " ${EPREFIX} " /var/cache/edb/mtimedb ;
You can’t perform that action at this time.
0 commit comments