提问人:xihare 提问时间:7/28/2023 最后编辑:xihare 更新时间:7/28/2023 访问量:27
LAME 编码器 OSX 交叉编译在 Linux 上失败
LAME encoder OSX cross-compile fails on Linux
问:
我已经使用项目osxcross在我的linux操作系统(WSL2)上安装了osx交叉编译工具链。我正在使用工具链通过源代码编译 LAME 编码器。使用我的配置选项进行配置后,构建阶段失败。我发现问题出在链接器上,特别是因为 flto 标志。
这是我用来配置所需必要选项的命令:
./configure --host=x86_64-apple-darwin --enable-static --disable-shared --enable-nasm --prefix=“$HOME/custom_build” CFLAGS=“-O3 -flto” CC=“x86_64-apple-darwin21。 4-clang” CXX=“x86_64-apple-darwin21.4-clang++” AR=x86_64-apple-darwin21.4-ar AS=x86_64-apple-darwin21.4-as RANLIB=x86_64-apple-darwin21.4-ranlib STRIP=x86_64-apple-darwin21.4-strip OBJDUMP=x86_64-apple-darwin21.4-ObjectDump NM=x86_64-apple-darwin21.4-nm PKG_CONFIG=x86_64-apple-darwin21.4-pkg-config LD=x86_64-苹果-达尔文21.4-ld LIBTOOL=x86_64-苹果-达尔文21.4-libtool LIPO=x86_64-苹果-达尔文21.4-lipo NMEDIT=x86_64-苹果-达尔文21.4-nmedit DSYMUTIL=x86_64-苹果-达尔文21.4-dsymutil OTOOL=x86_64-苹果-达尔文21.4-otool
整个终端输出:输出
配置日志:config.log
终端输出会引发一些危险信号,因为它指示链接器已失败,如下所示,
checking for ld used by x86_64-apple-darwin21.4-clang... x86_64-apple-darwin21.4-ld
checking if the linker (x86_64-apple-darwin21.4-ld) is GNU ld... no
如果继续编译所有代码,则错误如下make
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
错误的详细输出:
/bin/bash ../libtool --tag=CC --mode=link x86_64-apple-darwin21.4-clang -O3 -Wall -O3 -flto -static -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o ../libmp3lame/libmp3lame.la -lncurses -liconv -lm
libtool: link: x86_64-apple-darwin21.4-clang -O3 -Wall -O3 -flto -o lame lame_main.o main.o brhist.o console.o get_audio.o lametime.o parse.o timestatus.o ../libmp3lame/.libs/libmp3lame.a -lncurses -liconv -lm
undef: _id3tag_set_genre
undef: _id3tag_set_album
undef: _id3tag_set_track
undef: _id3tag_set_fieldvalue
undef: _id3tag_set_fieldvalue_utf16
undef: _id3tag_set_textinfo_utf16
undef: _lame_set_error_protection
undef: _lame_set_experimentalZ
undef: _lame_set_experimentalY
undef: _lame_set_VBR_min_bitrate_kbps
undef: _lame_set_quality
undef: _lame_set_original
undef: _lame_set_force_ms
undef: _id3tag_set_albumart
undef: _lame_set_preset
undef: _lame_set_decode_only
undef: _lame_set_scale
undef: _lame_set_scale_left
undef: _lame_set_scale_right
undef: _lame_set_asm_optimizations
undef: _lame_set_free_format
undef: _id3tag_add_v2
undef: _id3tag_set_year
undef: _id3tag_v1_only
undef: _id3tag_space_v1
undef: _id3tag_pad_v2
undef: _id3tag_set_pad
undef: _lame_set_mode
undef: _lame_set_lowpasswidth
undef: _lame_set_highpasswidth
undef: _lame_set_compression_ratio
undef: _lame_set_findReplayGain
undef: _lame_set_VBR_max_bitrate_kbps
undef: _lame_set_decode_on_the_fly
undef: _lame_set_bWriteVbrTag
undef: _id3tag_v2_only
undef: _lame_get_free_format
undef: _id3tag_genre_list
undef: _lame_get_bitrate
undef: _get_lame_os_bitness
undef: _get_lame_version
undef: _lame_encode_flush
undef: _lame_set_out_samplerate
undef: _lame_get_encoder_delay
undef: _lame_set_brate
undef: _lame_set_num_channels
undef: _lame_get_id3v1_tag
undef: _lame_get_decode_on_the_fly
undef: _lame_get_framesize
undef: _id3tag_set_comment
undef: _lame_get_noclipGainChange
undef: _lame_set_VBR_q
undef: _lame_get_noclipScale
undef: _lame_set_num_samples
undef: _lame_get_id3v2_tag
undef: _lame_init
undef: _lame_set_msgf
undef: _lame_bitrate_stereo_mode_hist
undef: _lame_set_errorf
undef: _lame_get_frameNum
undef: _lame_get_findReplayGain
undef: _lame_close
undef: _lame_set_in_samplerate
undef: _lame_set_VBR_quality
undef: _lame_get_lametag_frame
undef: _lame_set_lowpassfreq
undef: _lame_get_in_samplerate
undef: _lame_set_nogap_total
undef: _lame_get_VBR
undef: _lame_set_athaa_sensitivity
undef: _lame_get_RadioGain
undef: _lame_get_version
undef: _lame_get_VBR_q
undef: _lame_get_quality
undef: _lame_get_totalframes
undef: _lame_init_bitstream
undef: _lame_init_params
undef: _lame_set_nogap_currentindex
undef: _lame_get_force_ms
undef: _lame_set_emphasis
undef: _lame_get_VBR_min_bitrate_kbps
undef: _lame_set_highpassfreq
undef: _lame_get_num_samples
undef: _lame_set_debugf
undef: _lame_set_write_id3tag_automatic
undef: _lame_encode_flush_nogap
undef: _lame_get_out_samplerate
undef: _lame_encode_buffer_int
undef: _lame_get_scale
undef: _hip_set_errorf
undef: _id3tag_set_artist
undef: _lame_get_maximum_number_of_samples
undef: _lame_set_VBR_hard_min
undef: _lame_print_internals
undef: _lame_get_VBR_mean_bitrate_kbps
undef: _hip_decode1_headers
undef: _lame_get_compression_ratio
undef: _lame_get_mode
undef: _id3tag_init
undef: _lame_get_bWriteVbrTag
undef: _get_lame_url
undef: _lame_print_config
undef: _lame_set_copyright
undef: _lame_get_VBR_quality
undef: _lame_get_VBR_max_bitrate_kbps
undef: _id3tag_set_comment_utf16
undef: _lame_bitrate_kbps
undef: _lame_block_type_hist
undef: _lame_set_VBR
undef: _lame_set_disable_reservoir
undef: _lame_stereo_mode_hist
undef: _id3tag_set_title
undef: _lame_bitrate_hist
undef: _lame_get_num_channels
undef: _lame_get_decode_only
undef: _hip_decode1_headersB
undef: _lame_get_brate
undef: _hip_set_debugf
undef: _lame_set_VBR_mean_bitrate_kbps
undef: _lame_set_strict_ISO
undef: _hip_set_msgf
undef: _hip_decode_init
undef: _hip_decode_exit
Undefined symbols for architecture x86_64:
"_id3tag_set_genre", referenced from:
_set_id3tag in lto.o
"_id3tag_set_album", referenced from:
_set_id3tag in lto.o
"_id3tag_set_track", referenced from:
_set_id3tag in lto.o
"_id3tag_set_fieldvalue", referenced from:
_set_id3tag in lto.o
"_id3tag_set_fieldvalue_utf16", referenced from:
_id3_tag in lto.o
"_id3tag_set_textinfo_utf16", referenced from:
_id3_tag in lto.o
"_lame_set_error_protection", referenced from:
_parse_args_ in lto.o
"_lame_set_experimentalZ", referenced from:
_parse_args_ in lto.o
"_lame_set_experimentalY", referenced from:
_parse_args_ in lto.o
"_lame_set_VBR_min_bitrate_kbps", referenced from:
_parse_args_ in lto.o
"_lame_set_quality", referenced from:
_parse_args_ in lto.o
"_lame_set_original", referenced from:
_parse_args_ in lto.o
"_lame_set_force_ms", referenced from:
_parse_args_ in lto.o
"_id3tag_set_albumart", referenced from:
_set_id3_albumart in lto.o
"_lame_set_preset", referenced from:
_parse_args_ in lto.o
_presets_set in lto.o
"_lame_set_decode_only", referenced from:
_parse_args_ in lto.o
"_lame_set_scale", referenced from:
_parse_args_ in lto.o
"_lame_set_scale_left", referenced from:
_parse_args_ in lto.o
"_lame_set_scale_right", referenced from:
_parse_args_ in lto.o
"_lame_set_asm_optimizations", referenced from:
_parse_args_ in lto.o
"_lame_set_free_format", referenced from:
_parse_args_ in lto.o
"_id3tag_add_v2", referenced from:
_parse_args_ in lto.o
"_id3tag_set_year", referenced from:
_set_id3tag in lto.o
"_id3tag_v1_only", referenced from:
_parse_args_ in lto.o
"_id3tag_space_v1", referenced from:
_parse_args_ in lto.o
"_id3tag_pad_v2", referenced from:
_parse_args_ in lto.o
"_id3tag_set_pad", referenced from:
_parse_args_ in lto.o
"_lame_set_mode", referenced from:
_parse_args_ in lto.o
_presets_set in lto.o
"_lame_set_lowpasswidth", referenced from:
_parse_args_ in lto.o
"_lame_set_highpasswidth", referenced from:
_parse_args_ in lto.o
"_lame_set_compression_ratio", referenced from:
_parse_args_ in lto.o
"_lame_set_findReplayGain", referenced from:
_parse_args_ in lto.o
"_lame_set_VBR_max_bitrate_kbps", referenced from:
_parse_args_ in lto.o
"_lame_set_decode_on_the_fly", referenced from:
_parse_args_ in lto.o
"_lame_set_bWriteVbrTag", referenced from:
_parse_args_ in lto.o
"_id3tag_v2_only", referenced from:
_parse_args_ in lto.o
"_lame_get_free_format", referenced from:
_parse_args_ in lto.o
"_id3tag_genre_list", referenced from:
_parse_args_ in lto.o
"_lame_get_bitrate", referenced from:
_display_bitrates in lto.o
"_get_lame_os_bitness", referenced from:
_lame_version_print in lto.o
"_get_lame_version", referenced from:
_lame_version_print in lto.o
"_lame_encode_flush", referenced from:
_lame_encoder in lto.o
"_lame_set_out_samplerate", referenced from:
_parse_args_ in lto.o
"_lame_get_encoder_delay", referenced from:
_init_files in lto.o
"_lame_set_brate", referenced from:
_parse_args_ in lto.o
"_lame_set_num_channels", referenced from:
_init_files in lto.o
_open_mpeg_file_part2 in lto.o
_parse_args_ in lto.o
"_lame_get_id3v1_tag", referenced from:
_lame_encoder in lto.o
"_lame_get_decode_on_the_fly", referenced from:
_lame_encoder in lto.o
"_lame_get_framesize", referenced from:
_brhist_disp in lto.o
_get_audio_common in lto.o
_timestatus in lto.o
"_id3tag_set_comment", referenced from:
_set_id3tag in lto.o
"_lame_get_noclipGainChange", referenced from:
_lame_encoder in lto.o
"_lame_set_VBR_q", referenced from:
_presets_set in lto.o
"_lame_get_noclipScale", referenced from:
_lame_encoder in lto.o
"_lame_set_num_samples", referenced from:
_init_files in lto.o
_open_mpeg_file_part2 in lto.o
"_lame_get_id3v2_tag", referenced from:
_lame_encoder in lto.o
"_lame_init", referenced from:
_main in lto.o
"_lame_set_msgf", referenced from:
_main in lto.o
"_lame_bitrate_stereo_mode_hist", referenced from:
_brhist_disp in lto.o
"_lame_set_errorf", referenced from:
_main in lto.o
"_lame_get_frameNum", referenced from:
_lame_encoder in lto.o
_timestatus in lto.o
"_lame_get_findReplayGain", referenced from:
_lame_encoder in lto.o
"_lame_close", referenced from:
_main in lto.o
"_lame_set_in_samplerate", referenced from:
_init_files in lto.o
_open_mpeg_file_part2 in lto.o
_parse_args_ in lto.o
"_lame_set_VBR_quality", referenced from:
_parse_args_ in lto.o
"_lame_get_lametag_frame", referenced from:
_lame_encoder in lto.o
"_lame_set_lowpassfreq", referenced from:
_parse_args_ in lto.o
"_lame_get_in_samplerate", referenced from:
_main in lto.o
_init_files in lto.o
_read_samples_mp3 in lto.o
"_lame_set_nogap_total", referenced from:
_main in lto.o
"_lame_get_VBR", referenced from:
_lame_encoder in lto.o
_parse_args_ in lto.o
"_lame_set_athaa_sensitivity", referenced from:
_parse_args_ in lto.o
"_lame_get_RadioGain", referenced from:
_lame_encoder in lto.o
"_lame_get_version", referenced from:
_main in lto.o
_lame_encoder in lto.o
"_lame_get_VBR_q", referenced from:
_short_help in lto.o
_long_help in lto.o
"_lame_get_quality", referenced from:
_lame_encoder in lto.o
"_lame_get_totalframes", referenced from:
_brhist_disp in lto.o
_timestatus in lto.o
"_lame_init_bitstream", referenced from:
_main in lto.o
"_lame_init_params", referenced from:
_main in lto.o
"_lame_set_nogap_currentindex", referenced from:
_main in lto.o
"_lame_get_force_ms", referenced from:
_lame_encoder in lto.o
"_lame_set_emphasis", referenced from:
_parse_args_ in lto.o
"_lame_get_VBR_min_bitrate_kbps", referenced from:
_lame_encoder in lto.o
"_lame_set_highpassfreq", referenced from:
_parse_args_ in lto.o
"_lame_get_num_samples", referenced from:
_main in lto.o
_init_files in lto.o
_get_audio_common in lto.o
"_lame_set_debugf", referenced from:
_main in lto.o
"_lame_set_write_id3tag_automatic", referenced from:
_main in lto.o
"_lame_encode_flush_nogap", referenced from:
_lame_encoder in lto.o
"_lame_get_out_samplerate", referenced from:
_main in lto.o
_lame_encoder in lto.o
_brhist_disp in lto.o
_timestatus in lto.o
"_lame_encode_buffer_int", referenced from:
_lame_encoder in lto.o
"_lame_get_scale", referenced from:
_lame_encoder in lto.o
"_hip_set_errorf", referenced from:
_lame_decode_initfile in lto.o
"_id3tag_set_artist", referenced from:
_set_id3tag in lto.o
"_lame_get_maximum_number_of_samples", referenced from:
_lame_encoder in lto.o
"_lame_set_VBR_hard_min", referenced from:
_parse_args_ in lto.o
"_lame_print_internals", referenced from:
_lame_encoder in lto.o
"_lame_get_VBR_mean_bitrate_kbps", referenced from:
_lame_encoder in lto.o
"_hip_decode1_headers", referenced from:
_read_samples_mp3 in lto.o
"_lame_get_compression_ratio", referenced from:
_lame_encoder in lto.o
"_lame_get_mode", referenced from:
_lame_encoder in lto.o
_parse_args_ in lto.o
"_id3tag_init", referenced from:
_parse_args_ in lto.o
"_lame_get_bWriteVbrTag", referenced from:
_parse_args_ in lto.o
"_get_lame_url", referenced from:
_lame_version_print in lto.o
"_lame_print_config", referenced from:
_lame_encoder in lto.o
"_lame_set_copyright", referenced from:
_parse_args_ in lto.o
"_lame_get_VBR_quality", referenced from:
_lame_encoder in lto.o
"_lame_get_VBR_max_bitrate_kbps", referenced from:
_lame_encoder in lto.o
"_id3tag_set_comment_utf16", referenced from:
_id3_tag in lto.o
"_lame_bitrate_kbps", referenced from:
_brhist_init in lto.o
"_lame_block_type_hist", referenced from:
_brhist_disp in lto.o
"_lame_set_VBR", referenced from:
_parse_args_ in lto.o
_presets_set in lto.o
"_lame_set_disable_reservoir", referenced from:
_parse_args_ in lto.o
"_lame_stereo_mode_hist", referenced from:
_brhist_disp in lto.o
"_id3tag_set_title", referenced from:
_set_id3tag in lto.o
"_lame_bitrate_hist", referenced from:
_brhist_disp in lto.o
"_lame_get_num_channels", referenced from:
_main in lto.o
_init_files in lto.o
_get_audio_common in lto.o
_read_samples_mp3 in lto.o
"_lame_get_decode_only", referenced from:
_main in lto.o
_init_files in lto.o
_parse_args_ in lto.o
"_hip_decode1_headersB", referenced from:
_lame_decode_initfile in lto.o
"_lame_get_brate", referenced from:
_lame_encoder in lto.o
_parse_args_ in lto.o
"_hip_set_debugf", referenced from:
_lame_decode_initfile in lto.o
"_lame_set_VBR_mean_bitrate_kbps", referenced from:
_parse_args_ in lto.o
"_lame_set_strict_ISO", referenced from:
_parse_args_ in lto.o
"_hip_set_msgf", referenced from:
_lame_decode_initfile in lto.o
"_hip_decode_init", referenced from:
_lame_decode_initfile in lto.o
"_hip_decode_exit", referenced from:
_lame_decode_initfile in lto.o
_close_infile in lto.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
包含构建工具和编译器的 Bin 文件夹,
x86_64-apple-darwin21.4-ObjectDump
x86_64-apple-darwin21.4-ar
x86_64-apple-darwin21.4-as
x86_64-apple-darwin21.4-bitcode_strip
x86_64-apple-darwin21.4-c++
x86_64-apple-darwin21.4-cc
x86_64-apple-darwin21.4-check_dylib
x86_64-apple-darwin21.4-checksyms
x86_64-apple-darwin21.4-clang
x86_64-apple-darwin21.4-clang++
x86_64-apple-darwin21.4-clang++-gstdc++
x86_64-apple-darwin21.4-clang++-libc++
x86_64-apple-darwin21.4-clang++-stdc++
x86_64-apple-darwin21.4-cmake
x86_64-apple-darwin21.4-cmpdylib
x86_64-apple-darwin21.4-codesign_allocate
x86_64-apple-darwin21.4-ctf_insert
x86_64-apple-darwin21.4-dsymutil
x86_64-apple-darwin21.4-dyldinfo
x86_64-apple-darwin21.4-inout
x86_64-apple-darwin21.4-install_name_tool
x86_64-apple-darwin21.4-ld
x86_64-apple-darwin21.4-libtool
x86_64-apple-darwin21.4-lipo
x86_64-apple-darwin21.4-machocheck
x86_64-apple-darwin21.4-makerelocs
x86_64-apple-darwin21.4-mtoc
x86_64-apple-darwin21.4-mtor
x86_64-apple-darwin21.4-nm
x86_64-apple-darwin21.4-nmedit
x86_64-apple-darwin21.4-osxcross
x86_64-apple-darwin21.4-osxcross-cmp
x86_64-apple-darwin21.4-osxcross-conf
x86_64-apple-darwin21.4-osxcross-env
x86_64-apple-darwin21.4-osxcross-man
x86_64-apple-darwin21.4-otool
x86_64-apple-darwin21.4-pagestuff
x86_64-apple-darwin21.4-pkg-config
x86_64-apple-darwin21.4-ranlib
x86_64-apple-darwin21.4-redo_prebinding
x86_64-apple-darwin21.4-seg_addr_table
x86_64-apple-darwin21.4-seg_hack
x86_64-apple-darwin21.4-segedit
x86_64-apple-darwin21.4-size
x86_64-apple-darwin21.4-strings
x86_64-apple-darwin21.4-strip
x86_64-apple-darwin21.4-sw_vers
x86_64-apple-darwin21.4-unwinddump
x86_64-apple-darwin21.4-vtool
x86_64-apple-darwin21.4-wrapper
x86_64-apple-darwin21.4-xcodebuild
x86_64-apple-darwin21.4-xcrun
我确实将主机标志更改为自动识别必要的工具,但它没有检测到交叉编译。--host=x86_64-apple-darwin21.4
根据错误和配置输出,我认为链接器存在一些问题。我认为它无法继续进行链接时间优化。也许缺少包含 lto-plugn 的 bfd-plugins 文件夹,我不太确定。
如何解决这个问题?
答: 暂无答案
评论