forked from LibreELEC/LibreELEC.tv
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patharch.x86_64
30 lines (26 loc) · 1.14 KB
/
arch.x86_64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# determines TARGET_CPU, if not forced by user
if [ -z "${TARGET_CPU}" ]; then
TARGET_CPU="x86-64"
fi
# determine architecture's family
TARGET_SUBARCH="x86_64"
TARGET_GCC_ARCH="${TARGET_SUBARCH/-/}"
TARGET_KERNEL_ARCH="x86"
# setup ARCH specific *FLAGS
TARGET_CFLAGS="-march=${TARGET_CPU}"
TARGET_LDFLAGS=""
# build with microarchitecture feature support defined by the TARGET_CPU value
# see https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/home for further details
if [ -z "${TARGET_FEATURES}" ]; then
TARGET_FEATURES="64bit cmov cx8 fpu fxsr mmx osfxsr sce sse sse2"
TARGET_FEATURES_X86_64_V2="cmpxchg16b lahf-sahf popcnt sse3 sse4_1 sse4_2 ssse3"
TARGET_FEATURES_X86_64_V3="avx avx2 bmi1 bmi2 f16c fma lzcnt movbe osxsave"
if [ "${TARGET_CPU}" = "x86-64" ]; then
TARGET_FEATURES+=" no_sahf"
elif [ "${TARGET_CPU}" = "x86-64-v2" ]; then
TARGET_FEATURES+=" ${TARGET_FEATURES_X86_64_V2}"
elif [ "${TARGET_CPU}" = "x86-64-v3" ]; then
TARGET_FEATURES+=" ${TARGET_FEATURES_X86_64_V2} ${TARGET_FEATURES_X86_64_V3}"
fi
fi
TARGET_FEATURES="$(echo ${TARGET_FEATURES} | xargs -n1 | sort -u | xargs)"