gpt4 book ai didi

linux - ubuntu make 显示完整命令

转载 作者:太空宇宙 更新时间:2023-11-04 12:06:04 26 4
gpt4 key购买 nike

我正尝试在 ubuntu 上交叉编译 libmp3lame,但在某些时候它失败了,错误日志被截断了,所以我无法真正检测到发生了什么

shell 输出的最后几行是:

/bin/bash ../libtool  --tag=CC   --mode=link /home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc  -mfloat-abi=softfp -marm -march=armv7-a -Os -O3   -I/home/rafa/Desktop/m2/build_dir/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include/arm-linux-androideabi/ -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi -fPIE       -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi -fPIE -pie   -static  -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o ../libmp3lame/libmp3lame.la -lm 
libtool: link: /home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc -mfloat-abi=softfp -marm -march=armv7-a -Os -O3 -I/home/rafa/Desktop/m2/build_dir/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include -I/home/rafa/Desktop/missao/ndk17/sysroot/usr/include/arm-linux-androideabi/ -fPIE -fPIE -pie -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o -L/home/rafa/Desktop/m2/build_dir/lib -L/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib -L/home/rafa/Desktop/missao/ndk17/sysroot/usr/lib/arm-linux-androideabi ../libmp3lame/.libs/libmp3lame.a -lm
/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtbegin_dynamic.o: No such file or directory
/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: error: cannot open crtend_android.o: No such file or directory

在:

/home/rafa/Desktop/missao/ndk17/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld

我怎样才能强制 make 显示完整的命令而不是 /../ 来帮助我知道发生了什么

===================更新========================

试图弄清楚它是一个非常长的脚本来构建 ffmpeg 到 android [它在编译 libmp3lame 时失败了

我会尝试粘贴相关字段:

export NDK=/home/rafa/Desktop/missao/ndk17

OS="linux-x86_64"
ARM_SYSROOT=$NDK/platforms/android-27/arch-arm
ARM_PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$OS

CPU=armv7-a
ARCH=arm
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -mtune=cortex-a8 -march=$CPU -Os -O3"
ADDITIONAL_CONFIGURE_FLAG="--enable-neon "
SYSROOT=$ARM_SYSROOT
HOST=arm-linux-androideabi
CROSS_PREFIX=$ARM_PREBUILT/bin/$HOST-
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS "
PREBUILT=$ARM_PREBUILT

TOOLCHAIN=$NDK/sysroot/usr/include/$HOST/
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export CPP="${CROSS_PREFIX}cpp"
export CXX="${CROSS_PREFIX}g++"
export CC="${CROSS_PREFIX}gcc"
export LD="${CROSS_PREFIX}ld"
export AR="${CROSS_PREFIX}ar"
export NM="${CROSS_PREFIX}nm"
export RANLIB="${CROSS_PREFIX}ranlib"
export LDFLAGS="-L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE -pie "
export CFLAGS="$OPTIMIZE_CFLAGS -I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN -L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE "
export CXXFLAGS="$CFLAGS "
export CPPFLAGS="-I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN --sysroot=$SYSROOT "
export STRIP=${CROSS_PREFIX}strip
export PATH="$PATH:$PREFIX/bin:$NDK/build"

命令:

pushd lame
./configure \
--prefix=$PREFIX \
--host=$HOST \
--enable-static \
--disable-shared \
--with-sysroot=/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib

make clean
make
make install
popd

它正在寻找的文件在

/home/rafa/Desktop/missao/ndk17/platforms/android-27/arch-arm/usr/lib

但是我在 sysroot 和 LDFLAGS 上设置了这个目录,但它仍然找不到它

最佳答案

在测试了几种配置后,我发现了一种有效的配置,分享 如果有人遇到类似的问题

       export NDK=/home/rafa/Desktop/missao/ndk17

OS="linux-x86_64"
ARM_SYSROOT=$NDK/platforms/android-27/arch-arm
ARM_PREBUILT=$NDK/toolchains/arm-linux-androideabi-4.9/prebuilt/$OS

CPU=armv7-a
ARCH=arm
OPTIMIZE_CFLAGS="-mfloat-abi=softfp -mfpu=neon -marm -mtune=cortex-a8 -march=$CPU -Os -O3"
ADDITIONAL_CONFIGURE_FLAG="--enable-neon "
SYSROOT=$ARM_SYSROOT
HOST=arm-linux-androideabi
CROSS_PREFIX=$ARM_PREBUILT/bin/$HOST-
OPTIMIZE_CFLAGS="$OPTIMIZE_CFLAGS "
PREBUILT=$ARM_PREBUILT
export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig"
export CPP="${CROSS_PREFIX}cpp"
export CXX="${CROSS_PREFIX}g++"
export CC="${CROSS_PREFIX}gcc"
export LD="${CROSS_PREFIX}ld"
export AR="${CROSS_PREFIX}ar"
export NM="${CROSS_PREFIX}nm"
export RANLIB="${CROSS_PREFIX}ranlib"
export LDFLAGS="-L$PREFIX/lib -L$SYSROOT/usr/lib -L$NDK/sysroot/usr/lib/$HOST -fPIE -pie --sysroot=$SYSROOT "
export CFLAGS="$OPTIMIZE_CFLAGS -I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN -fPIE "
export CXXFLAGS="$CFLAGS "
export CPPFLAGS="-I$PREFIX/include -I$NDK/sysroot/usr/include -I$TOOLCHAIN --sysroot=$SYSROOT "
export STRIP=${CROSS_PREFIX}strip
export PATH="$PATH:$PREFIX/bin:$NDK/build"

并运行:

pushd lame
./configure \
--prefix=$PREFIX \
--host=$HOST \
--enable-static \
--disable-shared \
--disable-frontend \ #I just need the libraries
--with-sysroot=$SYSROOT
make clean
make
make install
popd

关于linux - ubuntu make 显示完整命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50659661/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com