fix $ARCH

This commit is contained in:
2025-09-04 17:55:24 -05:00
parent 0fe6f2423f
commit cc7e60ec37
3 changed files with 9 additions and 11 deletions

4
Jenkinsfile vendored
View File

@@ -42,7 +42,7 @@ pipeline {
stage('build on darwin ') { stage('build on darwin ') {
agent { label "darwin" } agent { label "darwin" }
steps { steps {
sh "STATIC=${STATIC} ${OPT_LTO} ./scripts/build.sh" sh "${OPT_LTO} ./scripts/build.sh"
} }
} }
} }
@@ -61,7 +61,7 @@ pipeline {
agent { label "linux && ${ARCH}" } agent { label "linux && ${ARCH}" }
steps { steps {
withDockerCreds { withDockerCreds {
sh "STATIC=${STATIC} ${OPT_LTO} ./scripts/docker_run_image.sh ${DISTRO}" sh "${OPT_LTO} ./scripts/docker_run_image.sh ${DISTRO}"
} }
} }
} }

View File

@@ -123,10 +123,10 @@ set_compile_opts() {
# arm prefers -mcpu over -march for native builds # arm prefers -mcpu over -march for native builds
# https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu # https://community.arm.com/arm-community-blogs/b/tools-software-ides-blog/posts/compiler-flags-across-architectures-march-mtune-and-mcpu
local arch_flags=() local arch_flags=()
if [[ ${HOSTTYPE} == "aarch64" && "${CPU}" == 'native' ]]; then if [[ ${HOSTTYPE} == "aarch64" && "${ARCH}" == 'native' ]]; then
arch_flags+=("-mcpu=${CPU}") arch_flags+=("-mcpu=${ARCH}")
else else
arch_flags+=("-march=${CPU}") arch_flags+=("-march=${ARCH}")
fi fi
# can fail static builds with -fpic # can fail static builds with -fpic
@@ -134,7 +134,7 @@ set_compile_opts() {
C_FLAGS+=("${arch_flags[@]}" "-fPIC") C_FLAGS+=("${arch_flags[@]}" "-fPIC")
CXX_FLAGS=("${C_FLAGS[@]}") CXX_FLAGS=("${C_FLAGS[@]}")
CPP_FLAGS=("${C_FLAGS[@]}") CPP_FLAGS=("${C_FLAGS[@]}")
RUSTFLAGS+=("-C target-cpu=${CPU}") RUSTFLAGS+=("-C target-cpu=${ARCH}")
CMAKE_FLAGS+=("-DCMAKE_C_FLAGS=${C_FLAGS[*]}") CMAKE_FLAGS+=("-DCMAKE_C_FLAGS=${C_FLAGS[*]}")
CMAKE_FLAGS+=("-DCMAKE_CXX_FLAGS=${CXX_FLAGS[*]}") CMAKE_FLAGS+=("-DCMAKE_CXX_FLAGS=${CXX_FLAGS[*]}")
MESON_FLAGS+=("-Dc_args=${C_FLAGS[*]}" "-Dcpp_args=${CPP_FLAGS[*]}") MESON_FLAGS+=("-Dc_args=${C_FLAGS[*]}" "-Dcpp_args=${CPP_FLAGS[*]}")
@@ -620,7 +620,7 @@ build_ffmpeg() {
--pkg-config='pkg-config' \ --pkg-config='pkg-config' \
--pkg-config-flags="${PKG_CFG_FLAGS}" \ --pkg-config-flags="${PKG_CFG_FLAGS}" \
--arch="${ARCH}" \ --arch="${ARCH}" \
--cpu="${CPU}" \ --cpu="${ARCH}" \
--enable-gpl \ --enable-gpl \
--enable-version3 \ --enable-version3 \
--enable-nonfree \ --enable-nonfree \

View File

@@ -13,9 +13,7 @@ DEFAULT_LTO=true
DEFAULT_OPT=3 DEFAULT_OPT=3
# static or shared build # static or shared build
DEFAULT_STATIC=true DEFAULT_STATIC=true
# CPU type (amd64/v{1,2,3}...) # architecture type (x86-64-v{1,2,3,4}, armv8-a, etc)
DEFAULT_CPU=native
# architecture type
DEFAULT_ARCH=native DEFAULT_ARCH=native
# prefix to install to, default is local install # prefix to install to, default is local install
DEFAULT_PREFIX='local' DEFAULT_PREFIX='local'
@@ -31,7 +29,7 @@ libvmaf \
# user-overridable compile option variable names # user-overridable compile option variable names
FB_COMP_OPTS=( FB_COMP_OPTS=(
CLEAN LTO OPT STATIC CPU ARCH PREFIX ENABLE CLEAN LTO OPT STATIC ARCH PREFIX ENABLE
) )
# sets FB_COMP_OPTS to allow for user-overriding # sets FB_COMP_OPTS to allow for user-overriding