为什么 arm-poky-linux-gnueabi-ar 说 "invalid option -- 'g'" 而这个选项没有出现在命令行的 args 列表中?
Why arm-poky-linux-gnueabi-ar says "invalid option -- 'g'" whereas this option doesn't appear in the args list of the command line?
我正在使用 bitbake 构建命令“bitbake -v update-engine-titan-c”,这是日志:
[le944v7:latest] /LE944V7/meta-titan bitbake -v update-engine-titan-c
.../...
Build Configuration:
BB_VERSION = "1.40.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "le944v7"
DISTRO = "poky-ivt-systemd"
DISTRO_VERSION = "12.0.0"
TUNE_FEATURES = "arm armv7ve vfp neon vfpv4 callconvention-hard cortexa7"
TARGET_FPU = "hard"
.../...
make[2]: Entering directory '/LE944V7/meta-titan/build/artefacts/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/update-engine-titan-c/1.0-r0/build/src/wrapper'
rm -f libupdate_engine_titan_c_wrapper.a
arm-poky-linux-gnueabi-ar cru libupdate_engine_titan_c_wrapper.a update_attempter_wrapper.o -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcrypto -lcurl -llog -lssl -lprotobuf-lite -lpthread -lbz2 -lgflags -lbase -lchrome -lbrillo -lbrillo_stream -levent -lbspatch -lfstab -lbootctrl -lxz -lpuffpatch -lbrotli
arm-poky-linux-gnueabi-ar: invalid option -- 'g'
Usage: arm-poky-linux-gnueabi-ar [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
arm-poky-linux-gnueabi-ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib
t[O][v] - display contents of the archive
x[o] - extract file(s) from the archive
command specific modifiers:
[a] - put file(s) after [member-name]
[b] - put file(s) before [member-name] (same as [i])
[D] - use zero for timestamps and uids/gids (default)
[U] - use actual timestamps and uids/gids
[N] - use instance [count] of name
[f] - truncate inserted file names
[P] - use full path names when matching
[o] - preserve original dates
[O] - display offsets of files in the archive
[u] - only replace files that are newer than current archive contents
generic modifiers:
[c] - do not warn if the library had to be created
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
[T] - make a thin archive
[v] - be verbose
[V] - display the version number
@<file> - read options from <file>
--target=BFDNAME - specify the target object format as BFDNAME
optional:
--plugin <p> - load the specified plugin
emulation options:
No emulation specific options
arm-poky-linux-gnueabi-ar: supported targets: elf32-littlearm elf32-littlearm-fdpic elf32-bigarm elf32-bigarm-fdpic elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
我不明白为什么 arm-poky-linux-gnueabi-ar 说“无效选项 -- 'g'”,而这个选项没有出现在 arm-poky-linux-gnueabi-ar 参数列表在命令行中(查看日志)?
似乎 ar
不接受 -lgio-2.0
参数。我认为您应该将 libgio-2.0.so
文件的路径直接放在命令行上,而不是通过 -l
参数。
(在 ar
联机帮助页中它说 -l
参数被接受但被忽略,所以我怀疑 G.M。在评论中说 -lgio-2.0
是正确的是 -g
的来源)
@ptomato 的答案的扩展是 ar
会将以 -
开头的任何内容解释为一堆 short-letter 个选项,因此 -l
是 ar
中的有效 short-letter 选项,它后面的其他字母可能不是,这就是它触发“未知选项”错误的原因。
如果所有传递的字母都奇迹般地有效,实际上情况会更糟,因为那样 ar
将以未定义的方式 运行 并在以后出现更细微的错误。
例如,将 -lm
传递给 ar
(例如,如果您在 automake *_LIBADD
变量中指定它,就会发生这种情况)可能会让您认为您正在链接到数学库,但它实际上会告诉 ar
在静态库中移动 文件(-m
选项)。
我正在使用 bitbake 构建命令“bitbake -v update-engine-titan-c”,这是日志:
[le944v7:latest] /LE944V7/meta-titan bitbake -v update-engine-titan-c
.../...
Build Configuration:
BB_VERSION = "1.40.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "arm-poky-linux-gnueabi"
MACHINE = "le944v7"
DISTRO = "poky-ivt-systemd"
DISTRO_VERSION = "12.0.0"
TUNE_FEATURES = "arm armv7ve vfp neon vfpv4 callconvention-hard cortexa7"
TARGET_FPU = "hard"
.../...
make[2]: Entering directory '/LE944V7/meta-titan/build/artefacts/work/cortexa7hf-neon-vfpv4-poky-linux-gnueabi/update-engine-titan-c/1.0-r0/build/src/wrapper'
rm -f libupdate_engine_titan_c_wrapper.a
arm-poky-linux-gnueabi-ar cru libupdate_engine_titan_c_wrapper.a update_attempter_wrapper.o -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lcrypto -lcurl -llog -lssl -lprotobuf-lite -lpthread -lbz2 -lgflags -lbase -lchrome -lbrillo -lbrillo_stream -levent -lbspatch -lfstab -lbootctrl -lxz -lpuffpatch -lbrotli
arm-poky-linux-gnueabi-ar: invalid option -- 'g'
Usage: arm-poky-linux-gnueabi-ar [emulation options] [-]{dmpqrstx}[abcDfilMNoOPsSTuvV] [--plugin <name>] [member-name] [count] archive-file file...
arm-poky-linux-gnueabi-ar -M [<mri-script]
commands:
d - delete file(s) from the archive
m[ab] - move file(s) in the archive
p - print file(s) found in the archive
q[f] - quick append file(s) to the archive
r[ab][f][u] - replace existing or insert new file(s) into the archive
s - act as ranlib
t[O][v] - display contents of the archive
x[o] - extract file(s) from the archive
command specific modifiers:
[a] - put file(s) after [member-name]
[b] - put file(s) before [member-name] (same as [i])
[D] - use zero for timestamps and uids/gids (default)
[U] - use actual timestamps and uids/gids
[N] - use instance [count] of name
[f] - truncate inserted file names
[P] - use full path names when matching
[o] - preserve original dates
[O] - display offsets of files in the archive
[u] - only replace files that are newer than current archive contents
generic modifiers:
[c] - do not warn if the library had to be created
[s] - create an archive index (cf. ranlib)
[S] - do not build a symbol table
[T] - make a thin archive
[v] - be verbose
[V] - display the version number
@<file> - read options from <file>
--target=BFDNAME - specify the target object format as BFDNAME
optional:
--plugin <p> - load the specified plugin
emulation options:
No emulation specific options
arm-poky-linux-gnueabi-ar: supported targets: elf32-littlearm elf32-littlearm-fdpic elf32-bigarm elf32-bigarm-fdpic elf32-little elf32-big plugin srec symbolsrec verilog tekhex binary ihex
我不明白为什么 arm-poky-linux-gnueabi-ar 说“无效选项 -- 'g'”,而这个选项没有出现在 arm-poky-linux-gnueabi-ar 参数列表在命令行中(查看日志)?
似乎 ar
不接受 -lgio-2.0
参数。我认为您应该将 libgio-2.0.so
文件的路径直接放在命令行上,而不是通过 -l
参数。
(在 ar
联机帮助页中它说 -l
参数被接受但被忽略,所以我怀疑 G.M。在评论中说 -lgio-2.0
是正确的是 -g
的来源)
@ptomato 的答案的扩展是 ar
会将以 -
开头的任何内容解释为一堆 short-letter 个选项,因此 -l
是 ar
中的有效 short-letter 选项,它后面的其他字母可能不是,这就是它触发“未知选项”错误的原因。
如果所有传递的字母都奇迹般地有效,实际上情况会更糟,因为那样 ar
将以未定义的方式 运行 并在以后出现更细微的错误。
例如,将 -lm
传递给 ar
(例如,如果您在 automake *_LIBADD
变量中指定它,就会发生这种情况)可能会让您认为您正在链接到数学库,但它实际上会告诉 ar
在静态库中移动 文件(-m
选项)。