链接:无效选项--'s'

链接:无效选项--'s'

我尝试在 CentOS 7.5 中执行 makefile,但以下错误阻止了我:

make export
make[1]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src'
make[2]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config'
make[3]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config/mkdepend'
make[3]: Nothing to be done for `export'.
make[3]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config/mkdepend'
/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config/nsinstall -R nsinstall ../dist/bin
make[2]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config'
make[2]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/editline'
make[2]: Nothing to be done for `export'.
make[2]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/editline'
make[2]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/shell'
make[2]: Nothing to be done for `export'.
make[2]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/shell'
make[2]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/jsapi-tests'
make[2]: Nothing to be done for `export'.
make[2]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/jsapi-tests'
make[2]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/tests'
make[2]: Nothing to be done for `export'.
make[2]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/tests'
/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/config/nsinstall -R -m 644 js-config.h jsautocfg.h /shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src/jsautokw.h js.msg jsanalyze.h jsapi.h jsarray.h jsarena.h jsatom.h jsbit.h jsbool.h jsclist.h jsclone.h jscntxt.h jscompat.h jsdate.h jsdbgapi.h jsdhash.h jsdtoa.h jsemit.h jsfun.h jsfriendapi.h jsgc.h jscell.h jsgcchunk.h jsgcstats.h jscompartment.h jshash.h jsinterp.h jsinttypes.h jsiter.h jslock.h jslong.h jsmath.h jsobj.h jsobjinlines.h json.h jsopcode.tbl jsopcode.h jsopcodeinlines.h jsotypes.h jsparse.h jsproxy.h jsprf.h jsprobes.h jspropertycache.h jspropertycacheinlines.h jspropertytree.h jsproto.tbl jsprvtd.h jspubtd.h jsreflect.h jsregexp.h jsscan.h jsscope.h jsscript.h jsscriptinlines.h jsstaticcheck.h jsstdint.h jsstr.h jstracer.h jshotloop.h jstypedarray.h jstypes.h jsutil.h jsvector.h jstl.h jshashtable.h jsversion.h jswrapper.h jsxdrapi.h jsxml.h jsval.h jsvalue.h prmjtime.h jsbuiltins.h ./nanojit/Assembler.h ./nanojit/Allocator.h ./nanojit/CodeAlloc.h ./nanojit/Containers.h ./nanojit/LIR.h ./nanojit/LIRopcode.tbl ./nanojit/avmplus.h ./nanojit/Fragmento.h ./nanojit/Native.h ./nanojit/NativeCommon.h ./nanojit/NativeX64.h ./nanojit/njconfig.h ./nanojit/njcpudetect.h ./nanojit/RegAlloc.h ./nanojit/nanojit.h ./nanojit/VMPI.h ./tracejit/Writer.h ./perf/jsperf.h ./dist/include
mkdir -p nanojit
make[1]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src'
make libs
make[1]: Entering directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src'
rm -f libmozjs185.so
link -shared -h libmozjs185.so -o libmozjs185.so  jsanalyze.o jsapi.o jsarena.o jsarray.o jsatom.o jsbool.o jsclone.o jscntxt.o jscompartment.o jsdate.o jsdbgapi.o jsdhash.o jsdtoa.o jsemit.o jsexn.o jsfriendapi.o jsfun.o jsgc.o jsgcchunk.o jsgcstats.o jshash.o jsinterp.o jsinvoke.o jsiter.o jslock.o jslog2.o jsmath.o jsnativestack.o jsnum.o jsobj.o json.o jsopcode.o jsparse.o jsproxy.o jsprf.o jsprobes.o jspropertycache.o jspropertytree.o jsreflect.o jsregexp.o jsscan.o jsscope.o jsscript.o jsstr.o jstypedarray.o jsutil.o jswrapper.o jsxdrapi.o jsxml.o prmjtime.o sharkctl.o jstracer.o Assembler.o Allocator.o CodeAlloc.o Containers.o Fragmento.o LIR.o njconfig.o RegAlloc.o avmplus.o NativeX64.o jsbuiltins.o VMPI.o Writer.o MethodJIT.o StubCalls.o Compiler.o FrameState.o FastArithmetic.o FastOps.o StubCompiler.o MonoIC.o PolyIC.o ImmutableSync.o InvokeHelpers.o Retcon.o TrampolineCompiler.o checks.o conversions.o diy-fp.o v8-dtoa.o fast-dtoa.o platform.o utils.o Assertions.o ExecutableAllocatorPosix.o ExecutableAllocatorWin.o ExecutableAllocatorOS2.o ExecutableAllocator.o ARMAssembler.o Logging.o MacroAssemblerARM.o MacroAssemblerX86Common.o RegexCompiler.o RegexJIT.o pcre_compile.o pcre_exec.o pcre_tables.o pcre_xclass.o pcre_ucp_searchfuncs.o jsperf.o pm_linux.o     -lpthread   -Wl,-rpath-link,/bin -Wl,-rpath-link,/usr/local/lib  -L/usr/local/lib -lplds4 -lplc4 -lnspr4 -Wl,-soname,libmozjs185.so.1.0 -ldl  -lm -ldl  
link: invalid option -- 's'
Try 'link --help' for more information.
make[1]: *** [libmozjs185.so] Error 1
make[1]: Leaving directory `/shilpa/audiocodes/unimrcp-1.5.0/GrammarSrv/libs/smonkey/common/js/src'
make: *** [default] Error 2
[root@localhost src]# 

答案1

看起来您似乎打算调用链接器ld,而是调用现有的程序link以允许超级用户创建到目录的硬链接。

如果 makefile 不包含任何直接调用link,您应该检查您的环境,例如 make 宏如何LD获取该值link

我建议致电:

make -n -p

捕获文件中的输出,然后link在该输出中查找。

如果你看到这样的情况:

make -f /dev/null -p

同样,这些值很可能是从环境中导入的。

答案2

似乎您正在尝试使用很少的 shell 命令来运行 shell,因此您的 shell 脚本文件中有多行 shell 脚本代码。

有几个换行符,请参考这里

每个 shell 脚本行都应以LR字符结尾,但实际上您的 shell 脚本文件是以字符结尾CRLF

更改CRLFLF

1.记事本++

  1. 检查行 vreak 字符 => 查看 -> 显示符号 -> 显示行尾
  2. 替换CRLFLF 在此输入图像描述

尝试运行您的 shell 脚本文件,它现在应该可以工作了。

相关内容