feat: add arm64 optimisations

This commit is contained in:
Andrii Podanenko 2023-03-24 17:08:48 +02:00
parent 9583431031
commit b3544cf147
2 changed files with 13 additions and 4 deletions

View File

@ -56,7 +56,7 @@ ARCH=$(uname -m)
CC_OPT="-O3 -Wno-error=implicit-fallthrough" CC_OPT="-O3 -Wno-error=implicit-fallthrough"
if [ "$ARCH" = "aarch64" ]; then if [ "$ARCH" = "aarch64" ]; then
CC_OPT="${CC_OPT} -march=armv8-a+crc" CC_OPT="${CC_OPT} -march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi fi
./configure --prefix=/usr/local/nginx \ ./configure --prefix=/usr/local/nginx \

View File

@ -29,7 +29,17 @@ cd /tmp
git clone https://github.com/rockchip-linux/mpp.git git clone https://github.com/rockchip-linux/mpp.git
cd mpp cd mpp
mkdir build || true && cd build mkdir build || true && cd build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local ../
ARCH=$(uname -m)
EXTRA_CFLAGS=""
EXTRA_CXXFLAGS=""
if [ "$ARCH" = "aarch64" ]; then
EXTRA_CFLAGS="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
EXTRA_CXXFLAGS="-march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_C_FLAGS="${EXTRA_CFLAGS}" -DCMAKE_CXX_FLAGS="${EXTRA_CXXFLAGS}" ../
make -j$(nproc) make -j$(nproc)
make install make install
ldconfig ldconfig
@ -58,7 +68,7 @@ EXTRA_CFLAGS="-I/usr/local/include"
EXTRA_LDFLAGS="-L/usr/local/lib" EXTRA_LDFLAGS="-L/usr/local/lib"
if [ "$ARCH" = "aarch64" ]; then if [ "$ARCH" = "aarch64" ]; then
EXTRA_CFLAGS="${EXTRA_CFLAGS} -march=armv8-a+crc" EXTRA_CFLAGS="${EXTRA_CFLAGS} -march=armv8-a+crc -mfpu=neon-fp-armv8 -mfloat-abi=hard"
fi fi
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
@ -83,7 +93,6 @@ PKG_CONFIG_PATH="/usr/local/lib/pkgconfig" ./configure \
--enable-libsoxr \ --enable-libsoxr \
--enable-libssh \ --enable-libssh \
--enable-libvorbis \ --enable-libvorbis \
--enable-libvpx \
--enable-libzimg \ --enable-libzimg \
--enable-libwebp \ --enable-libwebp \
--enable-libx264 \ --enable-libx264 \