HarmonyOS 鸿蒙Next编译适配opus静态库问题
HarmonyOS 鸿蒙Next编译适配opus静态库问题
我在编译适配鸿蒙的动态库是需要依赖opus静态库,在ubantu上编译opus 1.3.1 静态库时出现一下问题
这是我的编译命令
CC=/usr/ohos-sdk/ohos-sdk/linux/native/llvm/bin/clang CFLAGS="–target=aarch64-linux-ohos -fPIC --sysroot=/usr/ohos-sdk/ohos-sdk/linux/native/sysroot" LDFLAGS="–target=aarch64-linux-ohos -fPIC --sysroot=/usr/ohos-sdk/ohos-sdk/linux/native/sysroot" LD=/usr/ohos-sdk/ohos-sdk/linux/native/llvm/bin/ld.lld ./configure --host=arm-linux --enable-static --prefix=$(pwd)/my_build
make V=1
编译后出现
这样的问题,有没有大佬能提供一下解决思路
我也有编译脚本
如下
export OHOS_TOOLCHAIN=/usr/ohos-sdk/ohos-sdk/linux/native/llvm
export OHOS_SYSROOT=/usr/ohos-sdk/ohos-sdk/linux/native/sysroot
export CC=${OHOS_TOOLCHAIN}/bin/clang
export CPP=${OHOS_TOOLCHAIN}/bin/clang++
export AR=${OHOS_TOOLCHAIN}/bin/llvm-ar
export AS=${OHOS_TOOLCHAIN}/bin/llvm-as
export NM=${OHOS_TOOLCHAIN}/bin/llvm-nm
export STRIP=${OHOS_TOOLCHAIN}/bin/llvm-strip
export RANLIB=${OHOS_TOOLCHAIN}/bin/llvm-ranlib
export LD="${OHOS_TOOLCHAIN}/bin/lld --target=arm-linux-ohos"
export LDFLAGS="-fuse-ld=lld"
export CFLAGS="-fPIC --target=arm-linux-ohos -march=armv7-a -mfloat-abi=softfp"
export CPPFLAGS="-fPIC --target=arm-linux-ohos --sysroot=${OHOS_SYSROOT} -march=armv7-a -mfloat-abi=softfp"
./configure --host=arm-linux </p>
--prefix=$(pwd)/my_build </p>
--enable-static
make clean
make -j4
我看看感谢
楼主搞定了吗?
libtool: link: /usr/ohos-sdk/ohos-sdk/linux/native/llvm/bin/clang -shared -fPIC -DPIC celt/.libs/bands.o celt/.libs/celt.o celt/.libs/celt_encoder.o celt/.libs/celt_decoder.o celt/.libs/cwrs.o celt/.libs/entcode.o celt/.libs/entdec.o celt/.libs/entenc.o celt/.libs/kiss_fft.o celt/.libs/laplace.o celt/.libs/mathops.o celt/.libs/mdct.o celt/.libs/modes.o celt/.libs/pitch.o celt/.libs/celt_lpc.o celt/.libs/quant_bands.o celt/.libs/rate.o celt/.libs/vq.o celt/arm/.libs/armcpu.o celt/arm/.libs/arm_celt_map.o celt/arm/.libs/celt_neon_intr.o celt/arm/.libs/pitch_neon_intr.o silk/.libs/CNG.o silk/.libs/code_signs.o silk/.libs/init_decoder.o silk/.libs/decode_core.o silk/.libs/decode_frame.o silk/.libs/decode_parameters.o silk/.libs/decode_indices.o silk/.libs/decode_pulses.o silk/.libs/decoder_set_fs.o silk/.libs/dec_API.o silk/.libs/enc_API.o silk/.libs/encode_indices.o silk/.libs/encode_pulses.o silk/.libs/gain_quant.o silk/.libs/interpolate.o silk/.libs/LP_variable_cutoff.o silk/.libs/NLSF_decode.o silk/.libs/NSQ.o silk/.libs/NSQ_del_dec.o silk/.libs/PLC.o silk/.libs/shell_coder.o silk/.libs/tables_gain.o silk/.libs/tables_LTP.o silk/.libs/tables_NLSF_CB_NB_MB.o silk/.libs/tables_NLSF_CB_WB.o silk/.libs/tables_other.o silk/.libs/tables_pitch_lag.o silk/.libs/tables_pulses_per_block.o silk/.libs/VAD.o silk/.libs/control_audio_bandwidth.o silk/.libs/quant_LTP_gains.o silk/.libs/VQ_WMat_EC.o silk/.libs/HP_variable_cutoff.o silk/.libs/NLSF_encode.o silk/.libs/NLSF_VQ.o silk/.libs/NLSF_unpack.o silk/.libs/NLSF_del_dec_quant.o silk/.libs/process_NLSFs.o silk/.libs/stereo_LR_to_MS.o silk/.libs/stereo_MS_to_LR.o silk/.libs/check_control_input.o silk/.libs/control_SNR.o silk/.libs/init_encoder.o silk/.libs/control_codec.o silk/.libs/A2NLSF.o silk/.libs/ana_filt_bank_1.o silk/.libs/biquad_alt.o silk/.libs/bwexpander_32.o silk/.libs/bwexpander.o silk/.libs/debug.o silk/.libs/decode_pitch.o silk/.libs/inner_prod_aligned.o silk/.libs/lin2log.o silk/.libs/log2lin.o silk/.libs/LPC_analysis_filter.o silk/.libs/LPC_inv_pred_gain.o silk/.libs/table_LSF_cos.o silk/.libs/NLSF2A.o silk/.libs/NLSF_stabilize.o silk/.libs/NLSF_VQ_weights_laroia.o silk/.libs/pitch_est_tables.o silk/.libs/resampler.o silk/.libs/resampler_down2_3.o silk/.libs/resampler_down2.o silk/.libs/resampler_private_AR2.o silk/.libs/resampler_private_down_FIR.o silk/.libs/resampler_private_IIR_FIR.o silk/.libs/resampler_private_up2_HQ.o silk/.libs/resampler_rom.o silk/.libs/sigm_Q15.o silk/.libs/sort.o silk/.libs/sum_sqr_shift.o silk/.libs/stereo_decode_pred.o silk/.libs/stereo_encode_pred.o silk/.libs/stereo_find_predictor.o silk/.libs/stereo_quant_pred.o silk/.libs/LPC_fit.o silk/float/.libs/apply_sine_window_FLP.o silk/float/.libs/corrMatrix_FLP.o silk/float/.libs/encode_frame_FLP.o silk/float/.libs/find_LPC_FLP.o silk/float/.libs/find_LTP_FLP.o silk/float/.libs/find_pitch_lags_FLP.o silk/float/.libs/find_pred_coefs_FLP.o silk/float/.libs/LPC_analysis_filter_FLP.o silk/float/.libs/LTP_analysis_filter_FLP.o silk/float/.libs/LTP_scale_ctrl_FLP.o silk/float/.libs/noise_shape_analysis_FLP.o silk/float/.libs/process_gains_FLP.o silk/float/.libs/regularize_correlations_FLP.o silk/float/.libs/residual_energy_FLP.o silk/float/.libs/warped_autocorrelation_FLP.o silk/float/.libs/wrappers_FLP.o silk/float/.libs/autocorrelation_FLP.o silk/float/.libs/burg_modified_FLP.o silk/float/.libs/bwexpander_FLP.o silk/float/.libs/energy_FLP.o silk/float/.libs/inner_product_FLP.o silk/float/.libs/k2a_FLP.o silk/float/.libs/LPC_inv_pred_gain_FLP.o silk/float/.libs/pitch_analysis_core_FLP.o silk/float/.libs/scale_copy_vector_FLP.o silk/float/.libs/scale_vector_FLP.o silk/float/.libs/schur_FLP.o silk/float/.libs/sort_FLP.o silk/arm/.libs/arm_silk_map.o silk/arm/.libs/biquad_alt_neon_intr.o silk/arm/.libs/LPC_inv_pred_gain_neon_intr.o silk/arm/.libs/NSQ_del_dec_neon_intr.o silk/arm/.libs/NSQ_neon.o src/.libs/opus.o src/.libs/opus_decoder.o src/.libs/opus_encoder.o src/.libs/opus_multistream.o src/.libs/opus_multistream_encoder.o src/.libs/opus_multistream_decoder.o src/.libs/repacketizer.o src/.libs/opus_projection_encoder.o src/.libs/opus_projection_decoder.o src/.libs/mapping_matrix.o src/.libs/analysis.o src/.libs/mlp.o src/.libs/mlp_data.o -lm --sysroot=/usr/ohos-sdk/ohos-sdk/linux/native/sysroot --sysroot=/usr/ohos-sdk/ohos-sdk/linux/native/sysroot -Wl,-soname -Wl,libopus.so.0 -o .libs/libopus.so.0.8.0
这是make V=1最后出问题的巨长命令