When dump compiled library with
lib.export_library(filename), if the filename does not end with “.so” or “.dylib”, there will lead to compiler error like
Traceback (most recent call last): File "export_tvm.py", line 14, in <module> lib.export_library("tvm_output/mylib") File "/incubator-tvm/python/tvm/runtime/module.py", line 340, in export_library fcompile(file_name, files, **kwargs) File "/incubator-tvm/python/tvm/contrib/cc.py", line 48, in create_shared _linux_compile(output, objects, options, cc) File "/incubator-tvm/python/tvm/contrib/cc.py", line 189, in _linux_compile raise RuntimeError(msg) RuntimeError: Compilation error: /lib/../lib64/crt1.o：In function `_start': (.text+0x20)：undefined reference to 'main' collect2: error: ld returned 1 exit status
Since we almost always expect to export shared library (except tar), can this restrict be removed or more friendly noted? The current error is somewhat confusing.
One quick fix PR is here: https://github.com/apache/incubator-tvm/pull/5751